Trait/Object

sigmastate.interpreter

Interpreter

Related Docs: object Interpreter | package interpreter

Permalink

trait Interpreter extends ScorexLogging

Linear Supertypes
ScorexLogging, StrictLogging, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Interpreter
  2. ScorexLogging
  3. StrictLogging
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. abstract type CTX <: InterpreterContext

    Permalink
  2. class MutableCell[T] extends AnyRef

    Permalink
  3. type ProofT = UncheckedTree

    Permalink

Abstract Value Members

  1. abstract val IR: IRContext

    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.

  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. 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.

  8. 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.

  9. final def eq(arg0: AnyRef): Boolean

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

    Permalink
    Definition Classes
    AnyRef → Any
  11. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  12. def fullReduction(ergoTree: ErgoTree, context: CTX, env: ScriptEnv): (SigmaBoolean, Long)

    Permalink

    Full reduction of initial expression given in the ErgoTree form to a SigmaBoolean value (which encodes whether a sigma-protocol proposition or a boolean value, so true or false).

    Full reduction of initial expression given in the ErgoTree form to a SigmaBoolean value (which encodes whether a sigma-protocol proposition or a boolean value, so true or false).

    Works as follows: 1) parse ErgoTree instance into a typed AST 2) go bottom-up the tree to replace DeserializeContext nodes only 3) estimate cost and reduce the AST to a SigmaBoolean instance (so sigma-tree or trivial boolean value)

    ergoTree

    - input ErgoTree expression to reduce

    context

    - context used in reduction

    env

    - script environment

    returns

    sigma boolean and the updated cost counter after reduction

  13. final def getClass(): Class[_]

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

    Permalink
    Definition Classes
    AnyRef → Any
  15. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  16. def log: Logger

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

    Permalink
    Attributes
    protected
    Definition Classes
    StrictLogging
  18. final def ne(arg0: AnyRef): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef
  21. def propositionFromErgoTree(ergoTree: ErgoTree, context: CTX): SigmaPropValue

    Permalink

    Extracts proposition for ErgoTree handing soft-fork condition.

    Extracts proposition for ErgoTree handing soft-fork condition.

    Note

    soft-fork handler

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

    Permalink
  23. def reduceToCrypto(context: CTX, env: ScriptEnv, exp: Value[SType]): Try[ReductionResult]

    Permalink

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

    This method is used in both prover and verifier to compute SigmaBoolean 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

    See also

    ReductionResult

  24. 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

  25. final def synchronized[T0](arg0: ⇒ T0): T0

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

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

    Permalink
  28. def verify(ergoTree: ErgoTree, context: CTX, proof: ProofT, message: Array[Byte]): Try[VerificationResult]

    Permalink
  29. def verify(env: ScriptEnv, ergoTree: ErgoTree, context: CTX, proverResult: ProverResult, message: Array[Byte]): Try[VerificationResult]

    Permalink
  30. def verify(ergoTree: ErgoTree, context: CTX, proverResult: ProverResult, message: Array[Byte]): Try[VerificationResult]

    Permalink
  31. def verify(env: ScriptEnv, ergoTree: 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

    ergoTree

    ErgoTree expression 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 exp 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 failed to validate resulting SigmaProp conditions.

    See also

    reduceToCrypto

  32. final def wait(): Unit

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

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

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

Inherited from ScorexLogging

Inherited from StrictLogging

Inherited from AnyRef

Inherited from Any

Ungrouped