- amount of money associated with the box
- guarding script, which should be evaluated to true in order to open this box
- secondary tokens the box contains
- additional registers the box can carry over
- id of transaction which created the box
- number of box (from 0 to total number of boxes the transaction with transactionId created - 1)
- 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.
- additional registers the box can carry over
- additional registers the box can carry over
- secondary tokens the box contains
- secondary tokens the box contains
- height when a transaction containing the box was created.
- 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.
- guarding script, which should be evaluated to true in order to open this box
- guarding script, which should be evaluated to true in order to open this box
- number of box (from 0 to total number of boxes the transaction with transactionId created - 1)
- id of transaction which created the box
- amount of money associated with the box
- amount of money associated with the box
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.