Trait

sigmastate.interpreter

ProverInterpreter

Related Doc: package interpreter

Permalink

trait ProverInterpreter extends Interpreter with AttributionCore

Interpreter with enhanced functionality to prove statements.

Linear Supertypes
AttributionCore, AttributionCommon, Interpreter, ScorexLogging, StrictLogging, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ProverInterpreter
  2. AttributionCore
  3. AttributionCommon
  4. Interpreter
  5. ScorexLogging
  6. StrictLogging
  7. AnyRef
  8. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. abstract type CTX <: InterpreterContext

    Permalink
    Definition Classes
    Interpreter
  2. class CachedAttribute[T, U] extends Attribute[T, U]

    Permalink
    Definition Classes
    AttributionCore
  3. class CachedDynamicAttribute[T, U] extends CachedAttribute[T, U]

    Permalink
    Definition Classes
    AttributionCore
  4. class CachedParamAttribute[A, T, U] extends (A) ⇒ Attribute[T, U]

    Permalink
    Definition Classes
    AttributionCore
  5. class CircularAttribute[T, U] extends Attribute[T, U]

    Permalink
    Definition Classes
    AttributionCore
  6. class ConstantAttribute[T, U] extends Attribute[T, U]

    Permalink
    Definition Classes
    AttributionCommon
  7. class MutableCell[T] extends AnyRef

    Permalink
    Definition Classes
    Interpreter
  8. type ProofT = UncheckedTree

    Permalink
    Definition Classes
    ProverInterpreterInterpreter

Abstract Value Members

  1. abstract val IR: IRContext

    Permalink
    Definition Classes
    Interpreter
  2. abstract val secrets: Seq[SigmaProtocolPrivateInput[_, _]]

    Permalink

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def applyDeserializeContext(context: CTX, exp: Value[SType]): (BoolValue, CTX)

    Permalink

    Substitute Deserialize* nodes with deserialized subtrees We can estimate cost of the tree evaluation only after this step.

    Substitute Deserialize* nodes with deserialized subtrees We can estimate cost of the tree evaluation only after this step.

    Definition Classes
    Interpreter
  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. macro def attr[T, U](f: (T) ⇒ U): CachedAttribute[T, U]

    Permalink
    Definition Classes
    AttributionCore
  7. def attrWithName[T, U](name: String, f: (T) ⇒ U): CachedAttribute[T, U]

    Permalink
    Definition Classes
    AttributionCore
  8. def calcResult(context: Context, calcF: eval.IRContext.Ref[(eval.IRContext.Context) ⇒ Any]): SigmaProp

    Permalink
    Definition Classes
    Interpreter
  9. def checkCost(context: CTX, exp: Value[SType], costF: eval.IRContext.Ref[((Int, eval.IRContext.Size[eval.IRContext.Context])) ⇒ Int]): Int

    Permalink
    Definition Classes
    Interpreter
  10. macro def circular[T, U](init: U)(f: (T) ⇒ U): CircularAttribute[T, U]

    Permalink
    Definition Classes
    AttributionCore
  11. def circularWithName[T, U](name: String, init: U)(f: (T) ⇒ U): CircularAttribute[T, U]

    Permalink
    Definition Classes
    AttributionCore
  12. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  13. val computeCommitments: Strategy

    Permalink

    Verifier Step 4: For every leaf node, compute the commitment a from the challenge e and response $z$, per the verifier algorithm of the leaf's Sigma-protocol.

    Verifier Step 4: For every leaf node, compute the commitment a from the challenge e and response $z$, per the verifier algorithm of the leaf's Sigma-protocol. If the verifier algorithm of the Sigma-protocol for any of the leaves rejects, then reject the entire proof.

    Definition Classes
    Interpreter
  14. def constant[T, U](name: String, u: ⇒ U): Attribute[T, U]

    Permalink
    Definition Classes
    AttributionCommon
  15. macro def constant[T, U](u: ⇒ U): Attribute[T, U]

    Permalink
    Definition Classes
    AttributionCommon
  16. val convertToUnchecked: (ProofTree) ⇒ UncheckedSigmaTree

    Permalink
  17. def convertToUnproven(sigmaTree: SigmaBoolean): UnprovenTree

    Permalink
  18. def deserializeMeasured(context: CTX, scriptBytes: Array[Byte]): (CTX, Value[SType])

    Permalink

    Deserializes given script bytes using ValueSerializer (i.e.

    Deserializes given script bytes using ValueSerializer (i.e. assuming expression tree format). It also measures tree complexity adding to the total estimated cost of script execution. The new returned context contains increased initCost and should be used for further processing.

    The method SHOULD be called only inside trySoftForkable scope, to make deserialization soft-forkable.

    NOTE: While ErgoTree is always of type SigmaProp, ValueSerializer can serialize expression of any type. So it cannot be replaced with ErgoTreeSerializer here.

    Definition Classes
    Interpreter
  19. macro def dynAttr[T, U](f: (T) ⇒ U): CachedDynamicAttribute[T, U]

    Permalink
    Definition Classes
    AttributionCore
  20. def dynAttrWithName[T, U](name: String, f: (T) ⇒ U): CachedDynamicAttribute[T, U]

    Permalink
    Definition Classes
    AttributionCore
  21. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  22. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  23. def extractChallenge(pt: ProofTree): Option[Array[Byte]]

    Permalink
  24. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  25. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  26. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  27. implicit def internalToDynamicAttribute[T, U](f: (T) ⇒ U): CachedDynamicAttribute[T, U]

    Permalink
    Definition Classes
    AttributionCore
  28. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  29. def log: Logger

    Permalink
    Attributes
    protected
    Definition Classes
    ScorexLogging
    Annotations
    @inline()
  30. val logger: Logger

    Permalink
    Attributes
    protected
    Definition Classes
    StrictLogging
  31. val markReal: Strategy

    Permalink

    Prover Step 1: This step will mark as "real" every node for which the prover can produce a real proof.

    Prover Step 1: This step will mark as "real" every node for which the prover can produce a real proof. This step may mark as "real" more nodes than necessary if the prover has more than the minimal necessary number of witnesses (for example, more than one child of an OR). This will be corrected in the next step. In a bottom-up traversal of the tree, do the following for each node:

  32. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  33. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  34. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  35. macro def paramAttr[V, T, U](f: (V) ⇒ (T) ⇒ U): CachedParamAttribute[V, T, U]

    Permalink
    Definition Classes
    AttributionCore
  36. def paramAttrWithName[V, T, U](name: String, f: (V) ⇒ (T) ⇒ U): CachedParamAttribute[V, T, U]

    Permalink
    Definition Classes
    AttributionCore
  37. val polishSimulated: Strategy

    Permalink

    Prover Step 3: This step will change some "real" nodes to "simulated" to make sure each node has the right number of simulated children.

    Prover Step 3: This step will change some "real" nodes to "simulated" to make sure each node has the right number of simulated children. In a top-down traversal of the tree, do the following for each node:

  38. def propositionFromErgoTree(tree: ErgoTree, ctx: CTX): SigmaPropValue

    Permalink

    Extracts proposition for ErgoTree handing soft-fork condition.

    Extracts proposition for ErgoTree handing soft-fork condition.

    Definition Classes
    Interpreter
    Note

    soft-fork handler

  39. def prove(env: ScriptEnv, tree: ErgoTree, ctx: CTX, message: Array[Byte]): Try[CostedProverResult]

    Permalink
  40. def prove(exp: ErgoTree, context: CTX, message: Array[Byte]): Try[CostedProverResult]

    Permalink
  41. def prove(unprovenTree: UnprovenTree, message: Array[Byte]): ProofT

    Permalink

    The comments in this section are taken from the algorithm for the Sigma-protocol prover as described in the white paper

    The comments in this section are taken from the algorithm for the Sigma-protocol prover as described in the white paper

    Attributes
    protected
  42. val proving: Strategy

    Permalink

    Prover Step 9: Perform a top-down traversal of only the portion of the tree marked "real" in order to compute the challenge e for every node marked "real" below the root and, additionally, the response z for every leaf marked "real"

  43. def reduceToCrypto(context: CTX, exp: Value[SType]): Try[ReductionResult]

    Permalink
    Definition Classes
    Interpreter
  44. def reduceToCrypto(context: CTX, env: ScriptEnv, exp: Value[SType]): Try[ReductionResult]

    Permalink

    This method is used in both prover and verifier to compute SigmaProp value.

    This method is used in both prover and verifier to compute SigmaProp value. As the first step the cost of computing the exp expression in the given context is estimated. If cost is above limit then exception is returned and exp is not executed else exp is computed in the given context and the resulting SigmaBoolean returned.

    context

    the context in which exp should be executed

    env

    environment of system variables used by the interpreter internally

    exp

    expression to be executed in the given context

    returns

    result of script reduction

    Definition Classes
    Interpreter
    See also

    ReductionResult

  45. val simulateAndCommit: Strategy

    Permalink

    Prover Step 4: In a top-down traversal of the tree, compute the challenges e for simulated children of every node Prover Step 5: For every leaf marked "simulated", use the simulator of the Sigma-protocol for that leaf to compute the commitment $a$ and the response z, given the challenge e that is already stored in the leaf.

    Prover Step 4: In a top-down traversal of the tree, compute the challenges e for simulated children of every node Prover Step 5: For every leaf marked "simulated", use the simulator of the Sigma-protocol for that leaf to compute the commitment $a$ and the response z, given the challenge e that is already stored in the leaf. Prover Step 6: For every leaf marked "real", use the first prover step of the Sigma-protocol for that leaf to compute the commitment a.

  46. def substDeserialize(context: CTX, updateContext: (CTX) ⇒ Unit, node: SValue): Option[SValue]

    Permalink

    updateContext

    call back to setup new context (with updated cost limit) to be passed next time

    Definition Classes
    Interpreter
  47. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  48. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  49. def toValidScriptType(exp: SValue): BoolValue

    Permalink
    Definition Classes
    Interpreter
  50. def verify(exp: ErgoTree, context: CTX, proof: ProverInterpreter.ProofT, message: Array[Byte]): Try[VerificationResult]

    Permalink
    Definition Classes
    Interpreter
  51. def verify(env: ScriptEnv, exp: ErgoTree, context: CTX, proverResult: ProverResult, message: Array[Byte]): Try[VerificationResult]

    Permalink
    Definition Classes
    Interpreter
  52. def verify(exp: ErgoTree, context: CTX, proverResult: ProverResult, message: Array[Byte]): Try[VerificationResult]

    Permalink
    Definition Classes
    Interpreter
  53. def verify(env: ScriptEnv, tree: ErgoTree, context: CTX, proof: Array[Byte], message: Array[Byte]): Try[VerificationResult]

    Permalink

    Executes the script in a given context.

    Executes the script in a given context. Step 1: Deserialize context variables Step 2: Evaluate expression and produce SigmaProp value, which is zero-knowledge statement (see also SigmaBoolean). Step 3: Verify that the proof is presented to satisfy SigmaProp conditions.

    env

    environment of system variables used by the interpreter internally

    tree

    ErgoTree to execute in the given context and verify its result

    context

    the context in which exp should be executed

    proof

    The proof of knowledge of the secrets which is expected by the resulting SigmaProp

    message

    message bytes, which are used in verification of the proof

    returns

    verification result or Exception. If if the estimated cost of execution of the tree exceeds the limit (given in context), then exception if thrown and packed in Try. If left component is false, then: 1) script executed to false or 2) the given proof faild to validate resulting SigmaProp conditions.

    Definition Classes
    Interpreter
    See also

    reduceToCrypto

  54. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  55. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  56. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AttributionCore

Inherited from AttributionCommon

Inherited from Interpreter

Inherited from ScorexLogging

Inherited from StrictLogging

Inherited from AnyRef

Inherited from Any

Ungrouped