A transaction is a fundamental data structure for publishing a state transition on the ledger.
An Aleo transaction is serialized in the following format:
The old serial numbers are the serial numbers for corresponding records that were consumed by the transaction.
The new commitments are the commitments for corresponding records that were produced by the transaction.
The program commitment on the programs being used to spend the old records and the programs used to create the new records in the transaction.
The local data root is a commitment of the following record data in the transaction - old records, new records, memorandum, and network ID.
The value balance denotes difference between input and output record values. This value effectively becomes the transaction fee for the miner. Only coinbase transactions can have a negative value balance representing Aleo credits being minted.
The transaction memorandum is arbitrary public information associated with the transaction. This value must be unique among all transactions in the network.
The network ID indicates the network that the transaction is included in. For convention, the mainnet network ID is
The randomized signatures used by the record spenders to allow for authorized delegation of transaction generation.
The ledger digest is the root of a global Merkle tree that contains all record commitments from transactions on the ledger. When creating a transaction, the user must select a ledger digest that includes the record commitments for both of the old records being consumed.
The encrypted records are ciphertexts of the new records created by the transaction.
The transaction proof is a zero-knowledge proof attesting to the validity of the transaction.
The steps to create a transaction are as follows:
- Generate the serial numbers of the records being spent
- Generate the new records
- Generate the program commitment
- Generate the local data commitment
- Generate the transaction signatures
- Generate the ledger digest and ledger membership witnesses for the input record commitments
- Generate the inner SNARK proof
- Generate the program SNARK proofs
- Generate the transaction proof
- Compose the transaction with the attributes above
The steps to verify a transaction are as follows:
- Verify that each serial number in
old_serial_numbersdoes not already exist in the ledger.
- Verify that each commitment in
new_commitmentsdoes not already exist in the ledger.
- Verify that the memo
memorandumdoes not already exist in the ledger.
- Verify that the transaction proof