class ErgoBox extends ErgoBoxCandidate

Box (aka coin, or an unspent output) is a basic concept of a UTXO-based cryptocurrency. In Bitcoin, such an object is associated with some monetary value (arbitrary, but with predefined precision, so we use integer arithmetic to work with the value), and also a guarding script (aka proposition) to protect the box from unauthorized opening.

In other way, a box is a state element locked by some proposition (ErgoTree).

In Ergo, box is just a collection of registers, some with mandatory types and semantics, others could be used by applications in any way. We add additional fields in addition to amount and proposition~(which stored in the registers R0 and R1). Namely, register R2 contains additional tokens (a sequence of pairs (token identifier, value)). Register R3 contains height when block got included into the blockchain and also transaction identifier and box index in the transaction outputs. Registers R4-R9 are free for arbitrary usage.

A transaction is unsealing a box. As a box can not be open twice, any further valid transaction can not be linked to the same box.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ErgoBox
  2. ErgoBoxCandidate
  3. ErgoBoxAssets
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ErgoBox(value: Long, ergoTree: ErgoTree, additionalTokens: Coll[(TokenId, Long)] = Colls.emptyColl[(TokenId, Long)], additionalRegisters: Map[NonMandatoryRegisterId, _ <: EvaluatedValue[_ <: SType]] = Map.empty, transactionId: ModifierId, index: Short, creationHeight: Int)

    value

    - amount of money associated with the box

    ergoTree

    - guarding script, which should be evaluated to true in order to open this box

    additionalTokens

    - secondary tokens the box contains

    additionalRegisters

    - additional registers the box can carry over

    transactionId

    - id of transaction which created the box

    index

    - index of the box (from 0 to total number of boxes the transaction with transactionId created - 1)

    creationHeight

    - height when a transaction containing the box was created. This height is declared by user and should not exceed height of the block, containing the transaction with this box.

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. val additionalRegisters: Map[NonMandatoryRegisterId, _ <: EvaluatedValue[_ <: SType]]
    Definition Classes
    ErgoBoxErgoBoxCandidate
  5. val additionalTokens: Coll[(TokenId, Long)]
    Definition Classes
    ErgoBoxErgoBoxCandidate
  6. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. lazy val bytes: Array[Byte]

    Serialized content of this box.

    Serialized content of this box.

    See also

    ErgoBox.sigmaSerializer

  8. lazy val bytesWithNoRef: Array[Byte]

    Serialized bytes of this Box without transaction reference data (transactionId and boxIndex).

    Serialized bytes of this Box without transaction reference data (transactionId and boxIndex).

    Definition Classes
    ErgoBoxCandidate
  9. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  10. val creationHeight: Int
    Definition Classes
    ErgoBoxErgoBoxCandidate
  11. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  12. def equals(arg: Any): Boolean
    Definition Classes
    ErgoBoxErgoBoxCandidate → AnyRef → Any
  13. val ergoTree: ErgoTree
    Definition Classes
    ErgoBoxErgoBoxCandidate
  14. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  15. def get(identifier: RegisterId): Option[Value[SType]]

    Extracts register by id.

    Extracts register by id.

    identifier

    id of the register to return.

    returns

    Some(value) if the register is present, None otherwise

    Definition Classes
    ErgoBoxErgoBoxCandidate
  16. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  17. def hashCode(): Int
    Definition Classes
    ErgoBoxErgoBoxCandidate → AnyRef → Any
  18. lazy val id: BoxId

    Blake2b256 hash of the serialized bytes.

  19. val index: Short
  20. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  21. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  22. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  23. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  24. def proposition: SigmaPropValue

    Transforms this tree to a proposition, substituting the constants if the constant segregation flag is set.

    Transforms this tree to a proposition, substituting the constants if the constant segregation flag is set.

    Definition Classes
    ErgoBoxCandidate
    See also

    SigmaPropValue

  25. lazy val propositionBytes: Array[Byte]

    Returns the serialized bytes of the guarding ErgoTree.

    Returns the serialized bytes of the guarding ErgoTree.

    Definition Classes
    ErgoBoxCandidate
  26. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  27. def toBox(txId: ModifierId, boxIndex: Short): ErgoBox

    Creates a new ErgoBox based on this candidate using the given transaction reference data.

    Creates a new ErgoBox based on this candidate using the given transaction reference data.

    txId

    id of transaction which created the box

    boxIndex

    index of the box in the transaction's OUTPUTS

    Definition Classes
    ErgoBoxCandidate
  28. def toCandidate: ErgoBoxCandidate

    Convert this box to ErgoBoxCandidate by forgetting transaction reference data (transactionId, index).

  29. def toString(): String
    Definition Classes
    ErgoBoxErgoBoxCandidate → AnyRef → Any
  30. lazy val tokens: Map[ModifierId, Long]

    Additional tokens stored in the box.

    Additional tokens stored in the box.

    Definition Classes
    ErgoBoxCandidateErgoBoxAssets
  31. val transactionId: ModifierId
  32. val value: Long
    Definition Classes
    ErgoBoxErgoBoxCandidateErgoBoxAssets
  33. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  34. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  35. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()

Inherited from ErgoBoxCandidate

Inherited from ErgoBoxAssets

Inherited from AnyRef

Inherited from Any

Ungrouped