Each Ergo transaction is an atomic state transition operation, which means that it destroys a box from the state and creates new ones.
Each transaction executed on Ergo consists of these three things.
One or moreInput boxes
- This is the source of your funds for the transaction.
- These boxes must already exist and will be destroyed by the transaction.
- The guard script in each box will be evaluated and must return
truefor the transaction to be considered valid.
One or moreOutput boxes
- This is your destination of funds.
- These boxes will be created.
Zero or moreData-Input boxes
- These are additional boxes whose data can be referenced and used by smart contracts of the inputs.
- The guard script in these boxes will not be evaluated.
- Data inputs are a unique concept created by Ergo, which were added to Cardano with the Vasil Hardfork. These allow multiple transactions to share a data-input box, storing only a single reference to the box in the block.
- If the transaction is spending boxes protected by a non-trivial script, its inputs should also contain proof of spending correctness - context extension (user-defined key-value map) and data inputs (links to existing boxes in the state) that you may use during script reduction to crypto, signatures that satisfies the remaining cryptographic protection of the script.
- Transactions are not encrypted, meaning you can publicly view transactions included in blocks.