Class/Object

org.ergoplatform.wallet.interpreter

ErgoProvingInterpreter

Related Docs: object ErgoProvingInterpreter | package interpreter

Permalink

class ErgoProvingInterpreter extends ErgoInterpreter with ProverInterpreter

A class which is holding secrets and signing transactions. Signing a transaction means producing spending proofs for all of the input boxes of the transaction.

This interpreter also acts as a wallet, in the sense that it is a vault holding user's secrets.

There are two basic types of secrets, hierarchical deterministic keys corresponding to BIP-32 implementation, and also "primitive" keys, such as just secret exponent for a Schnorr signature scheme done in Ergo.

It is considered that there could be very many hierarchical deterministic keys (for example, if we are talking about an exchange there could be thousands of them), and not so many primitive keys. Optimizations are centered around this assumption.

Linear Supertypes
ProverInterpreter, AttributionCore, AttributionCommon, ProverUtils, ErgoInterpreter, ErgoLikeInterpreter, Interpreter, ScorexLogging, StrictLogging, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ErgoProvingInterpreter
  2. ProverInterpreter
  3. AttributionCore
  4. AttributionCommon
  5. ProverUtils
  6. ErgoInterpreter
  7. ErgoLikeInterpreter
  8. Interpreter
  9. ScorexLogging
  10. StrictLogging
  11. AnyRef
  12. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ErgoProvingInterpreter(secretKeys: IndexedSeq[SecretKey], params: ErgoLikeParameters, cachedHdPubKeysOpt: Option[IndexedSeq[ExtendedPublicKey]] = None)(implicit IR: IRContext)

    Permalink

    secretKeys

    - secrets used by the prover

    params

    - ergo network parameters at the moment of proving

    cachedHdPubKeysOpt

    - optionally, public keys corresponding to the BIP32-related secrets (to not to recompute them)

Type Members

  1. type CTX = ErgoLikeContext

    Permalink
    Definition Classes
    ErgoInterpreter → ErgoLikeInterpreter → 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. type ProofT = UncheckedTree

    Permalink
    Definition Classes
    ProverInterpreter → Interpreter

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. val CostPerByteDeserialized: Int

    Permalink
    Definition Classes
    Interpreter
  5. val CostPerTreeByte: Int

    Permalink
    Definition Classes
    Interpreter
  6. implicit val IR: IRContext

    Permalink
    Definition Classes
    ErgoLikeInterpreter → Interpreter
  7. val activatedScriptVersion: Byte

    Permalink

    Activated script version, 0 is for Ergo mainnet since block #1 until 417,792, 1 for Ergo mainnet since 417,792, etc.

    Activated script version, 0 is for Ergo mainnet since block #1 until 417,792, 1 for Ergo mainnet since 417,792, etc. Note: version N of ErgoProtocol corresponds to version N-1 of ErgoTree (aka script version)

  8. def addCryptoCost(jitRes: JitReductionResult, costLimit: Long): Long

    Permalink
    Attributes
    protected
    Definition Classes
    Interpreter
  9. final def asInstanceOf[T0]: T0

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

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

    Permalink
    Definition Classes
    AttributionCore
  12. def bagForMultisig(context: CTX, sigmaTree: SigmaBoolean, proof: Array[Byte], realSecretsToExtract: Seq[SigmaBoolean], simulatedSecretsToExtract: Seq[SigmaBoolean]): HintsBag

    Permalink
    Definition Classes
    ProverUtils
  13. def bagForMultisig(context: CTX, ergoTree: ErgoTree, proof: Array[Byte], realSecretsToExtract: Seq[SigmaBoolean], simulatedSecretsToExtract: Seq[SigmaBoolean]): HintsBag

    Permalink
    Definition Classes
    ProverUtils
  14. def bagForTransaction(tx: ErgoLikeTransaction, boxesToSpend: IndexedSeq[ErgoBox], dataBoxes: IndexedSeq[ErgoBox], stateContext: ErgoLikeStateContext, realSecretsToExtract: Seq[SigmaBoolean], simulatedSecretsToExtract: Seq[SigmaBoolean]): TransactionHintsBag

    Permalink

    Extract hints from (supposedly, partially) signed transaction.

    Extract hints from (supposedly, partially) signed transaction. Useful for distributed signing.

    tx

    - signed transaction

    boxesToSpend

    - input boxes the transaction are spending

    dataBoxes

    - read-only inputs of the transaction

    stateContext

    - context used for signing

    realSecretsToExtract

    - public images of secrets used in signing

    simulatedSecretsToExtract

    - public images of simulated secrets

    returns

    hints for (further) transaction signing

  15. val cachedHdPubKeysOpt: Option[IndexedSeq[ExtendedPublicKey]]

    Permalink

    - optionally, public keys corresponding to the BIP32-related secrets (to not to recompute them)

  16. def checkExpiredBox(box: ErgoBox, output: ErgoBoxCandidate, currentHeight: ErgoLikeContext.Height): Boolean

    Permalink

    Checks that expired box is spent in a proper way

    Checks that expired box is spent in a proper way

    box

    - box being spent

    output

    - newly created box when storage fee covered, otherwise any output box

    currentHeight

    - current height of the blockchain (at the moment of spending)

    returns

    whether the box is spent properly according to the storage fee rule

    Attributes
    protected
    Definition Classes
    ErgoInterpreter
  17. def checkSoftForkCondition(ergoTree: ErgoTree, context: CTX): Option[VerificationResult]

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

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

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

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  21. def constant[T, U](name: String, u: ⇒ U): Attribute[T, U]

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

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

    Permalink
    Definition Classes
    ProverInterpreter
  24. def convertToUnproven(sigmaTree: SigmaBoolean): UnprovenTree

    Permalink
    Definition Classes
    ProverInterpreter
  25. def deserializeMeasured(context: CTX, scriptBytes: Array[Byte]): (CTX, Value[SType])

    Permalink
    Attributes
    protected
    Definition Classes
    Interpreter
  26. macro def dynAttr[T, U](f: (T) ⇒ U): CachedDynamicAttribute[T, U]

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

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  30. def evalSettings: EvalSettings

    Permalink
    Attributes
    protected
    Definition Classes
    Interpreter
  31. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  32. def fullReduction(ergoTree: ErgoTree, ctx: CTX): FullReductionResult

    Permalink
    Definition Classes
    Interpreter
  33. def fullReduction(ergoTree: ErgoTree, ctx: CTX, env: ScriptEnv): FullReductionResult

    Permalink
    Definition Classes
    Interpreter
  34. def generateCommitments(sigmaTree: SigmaBoolean): HintsBag

    Permalink
    Definition Classes
    ProverInterpreter
  35. def generateCommitments(ergoTree: ErgoTree, ctx: CTX): HintsBag

    Permalink
    Definition Classes
    ProverInterpreter
  36. def generateCommitmentsFor(unsignedTx: UnsignedErgoLikeTransaction, boxesToSpend: IndexedSeq[ErgoBox], dataBoxes: IndexedSeq[ErgoBox], stateContext: ErgoLikeStateContext): Try[TransactionHintsBag]

    Permalink

    A method which is generating commitments to randomness.

    A method which is generating commitments to randomness. A commitment is about a first step of a zero-knowledge proof-of-knowledge knowledge protocol.

    Method checks whether secret is known to the prover, and returns None if the secret is not known.

    unsignedTx

    - transaction to be signed with commitments to be generated first

    boxesToSpend

    - boxes the transaction is spending

    dataBoxes

    - read-only inputs of the transaction

    stateContext

    - context used for signing

    returns

    - hints for signing transaction

  37. def generateCommitmentsFor(sigmaTree: SigmaBoolean, generateFor: Seq[SigmaBoolean]): HintsBag

    Permalink
    Definition Classes
    ProverUtils
  38. def generateCommitmentsFor(ergoTree: ErgoTree, context: CTX, generateFor: Seq[SigmaBoolean]): HintsBag

    Permalink
    Definition Classes
    ProverUtils
  39. def generateProof(sb: SigmaBoolean, message: Array[Byte], hintsBag: HintsBag): Array[Byte]

    Permalink
    Definition Classes
    ProverInterpreter
  40. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  41. def getEvaluationMode(context: CTX): EvaluationMode

    Permalink
    Attributes
    protected
    Definition Classes
    Interpreter
  42. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  43. val hdKeys: IndexedSeq[ExtendedSecretKey]

    Permalink

    Only secrets corresponding to hierarchical deterministic scheme (BIP-32 impl)

  44. val hdPubKeys: IndexedSeq[ExtendedPublicKey]

    Permalink

    Only public keys corresponding to hierarchical deterministic scheme (BIP-32 impl)

  45. implicit def internalToDynamicAttribute[T, U](f: (T) ⇒ U): CachedDynamicAttribute[T, U]

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

    Permalink
    Definition Classes
    Any
  47. def log: Logger

    Permalink
    Attributes
    protected
    Definition Classes
    ScorexLogging
    Annotations
    @inline()
  48. def logMessage(msg: String): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Interpreter
  49. val logger: Logger

    Permalink
    Attributes
    protected
    Definition Classes
    StrictLogging
  50. def markReal(hintsBag: HintsBag): Strategy

    Permalink
    Definition Classes
    ProverInterpreter
  51. final def ne(arg0: AnyRef): Boolean

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

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

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

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

    Permalink
    Definition Classes
    AttributionCore
  56. val polishSimulated: Strategy

    Permalink
    Definition Classes
    ProverInterpreter
  57. val precompiledScriptProcessor: PrecompiledScriptProcessor

    Permalink
    Definition Classes
    ErgoLikeInterpreter → Interpreter
  58. def propositionFromErgoTree(ergoTree: ErgoTree, context: CTX): SigmaPropValue

    Permalink
    Attributes
    protected
    Definition Classes
    Interpreter
  59. def prove(env: ScriptEnv, ergoTree: ErgoTree, context: CTX, message: Array[Byte], hintsBag: HintsBag): Try[CostedProverResult]

    Permalink
    Definition Classes
    ProverInterpreter
  60. def prove(ergoTree: ErgoTree, context: CTX, message: Array[Byte]): Try[CostedProverResult]

    Permalink
    Definition Classes
    ProverInterpreter
  61. def prove(ergoTree: ErgoTree, context: CTX, message: Array[Byte], hintsBag: HintsBag): Try[CostedProverResult]

    Permalink
    Definition Classes
    ProverInterpreter
  62. def prove(unprovenTree: UnprovenTree, message: Array[Byte], hintsBag: HintsBag): ProofT

    Permalink
    Attributes
    protected
    Definition Classes
    ProverInterpreter
  63. def proving(hintsBag: HintsBag): Strategy

    Permalink
    Definition Classes
    ProverInterpreter
  64. def publicKeys: Seq[SigmaBoolean]

    Permalink
    Definition Classes
    ProverInterpreter
  65. def reduceToCrypto(context: CTX, env: ScriptEnv, exp: Value[SType]): Try[AotReductionResult]

    Permalink
    Attributes
    protected
    Definition Classes
    Interpreter
  66. def reduceToCryptoJITC(context: CTX, env: ScriptEnv, exp: SigmaPropValue): Try[JitReductionResult]

    Permalink
    Attributes
    protected
    Definition Classes
    Interpreter
  67. val secretKeys: IndexedSeq[SecretKey]

    Permalink

    - secrets used by the prover

  68. val secrets: IndexedSeq[SigmaProtocolPrivateInput[_, _]]

    Permalink

    Interpreter's secrets, in form of sigma protocols private inputs

    Interpreter's secrets, in form of sigma protocols private inputs

    Definition Classes
    ErgoProvingInterpreter → ProverInterpreter
  69. def setPositions(uc: UnprovenConjecture): UnprovenConjecture

    Permalink
    Attributes
    protected
    Definition Classes
    ProverInterpreter
  70. def sign(unsignedTx: UnsignedErgoLikeTransaction, boxesToSpend: IndexedSeq[ErgoBox], dataBoxes: IndexedSeq[ErgoBox], stateContext: ErgoLikeStateContext, txHints: TransactionHintsBag = TransactionHintsBag.empty): Try[ErgoLikeTransaction]

    Permalink

    Note

    requires unsignedTx and boxesToSpend have the same boxIds in the same order.

  71. def signInputs(unsignedTx: UnsignedErgoLikeTransaction, boxesToSpend: IndexedSeq[ErgoBox], dataBoxes: IndexedSeq[ErgoBox], stateContext: ErgoLikeStateContext, txHints: TransactionHintsBag): Try[(IndexedSeq[Input], Long)]

    Permalink
  72. def signMessage(sigmaTree: SigmaBoolean, message: Array[Byte], hintsBag: HintsBag): Try[Array[Byte]]

    Permalink
    Definition Classes
    ProverInterpreter
  73. def simulateAndCommit(hintsBag: HintsBag): Strategy

    Permalink
    Definition Classes
    ProverInterpreter
  74. def substDeserialize(context: CTX, updateContext: (CTX) ⇒ Unit, node: SValue): Option[SValue]

    Permalink
    Definition Classes
    ErgoLikeInterpreter → Interpreter
  75. final def synchronized[T0](arg0: ⇒ T0): T0

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

    Permalink
    Definition Classes
    AnyRef → Any
  77. def verify(env: ScriptEnv, exp: ErgoTree, context: CTX, proof: Array[Byte], message: Array[Byte]): Try[VerificationResult]

    Permalink

    Checks that given exp evaluates to true.

    Checks that given exp evaluates to true.

    env

    - environment to use during expression evaluation

    exp

    - expression to check

    context

    - expression evaluation context

    proof

    - cryptographic proof

    message

    - message

    Definition Classes
    ErgoInterpreter → Interpreter
  78. def verify(ergoTree: ErgoTree, context: CTX, proof: ErgoProvingInterpreter.ProofT, message: Array[Byte]): Try[VerificationResult]

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

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

    Permalink
    Definition Classes
    Interpreter
  81. def verifySignature(sigmaTree: SigmaBoolean, message: Array[Byte], signature: Array[Byte])(implicit E: ErgoTreeEvaluator): Boolean

    Permalink
    Definition Classes
    Interpreter
  82. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  85. def withNewExtendedSecret(secret: ExtendedSecretKey): ErgoProvingInterpreter

    Permalink

    Produces updated instance of ErgoProvingInterpreter with a new secret included

    Produces updated instance of ErgoProvingInterpreter with a new secret included

    secret

    - new secret to add

    returns

    modified prover

  86. def withNewParameters(newParams: ErgoLikeParameters): ErgoProvingInterpreter

    Permalink

    Produces updated instance of ErgoProvingInterpreter with updated parameters

    Produces updated instance of ErgoProvingInterpreter with updated parameters

    newParams

    - updated parameters

    returns

    modified prover

Inherited from ProverInterpreter

Inherited from AttributionCore

Inherited from AttributionCommon

Inherited from ProverUtils

Inherited from ErgoInterpreter

Inherited from ErgoLikeInterpreter

Inherited from Interpreter

Inherited from ScorexLogging

Inherited from StrictLogging

Inherited from AnyRef

Inherited from Any

Ungrouped