1.3 Concepts
Programs, transactions, transitions, blocks. These are the core structures of Aleo, and you’ll run into them constantly. So let’s break them down.
Programs first. A program is the backbone of Aleo applications. It’s both the logic and the state. Think of it like a contract that lives on-chain, defining rules that must be followed. But unlike traditional smart contracts, Aleo programs use zero-knowledge proofs. This means they can execute logic privately while still proving correctness to the network. Aleo uses its own language called Aleo instructions, which is statically typed and designed for writing privacy-preserving applications. You’ll write a lot of Aleo programs, so get familiar.
Next, transactions. Transactions move things forward. They publish new programs, execute program functions, and handle fees. There are three types:
Deploy Transaction: This is how you publish an Aleo program. Once deployed, it’s available on the network for execution.
Execute Transaction: This calls a function in an Aleo program. If you want to interact with a deployed contract, you send one of these.
Fee Transaction: This pays for rejected transactions. If a transaction fails, the network still needs compensation for the work done.
Every transaction has an ID, computed from its transitions using a Merkle Tree Digest. The ledger keeps track of all these transactions, making sure they follow the rules.
Now, transitions. A transition is what actually changes state on Aleo. You can think of it as a state update inside a transaction. Every transition has inputs and outputs, just like a function. It takes in some data, does something with it, and produces a new state. Transitions can be public or private, and validators process them to update the blockchain. Important fields include:
id: The transition ID, derived from its inputs and outputs.
program_id: The program this transition belongs to.
function_name: The function being executed.
inputs & outputs: Data going in and out of the transition.
tpk: A public key to verify the digital signature of the transaction.
tcm: The transition commitment, ensuring correctness.
Finally, blocks. A block is just a container for transactions. It groups transactions together, adds cryptographic proofs, and advances the ledger. Every block has a unique hash and points to the previous block, forming the Aleo blockchain. Inside each block, you’ll find:
Transactions: A list of included transactions.
Block Header: Metadata summarizing the block’s state.
Ratifications: Prover rewards.
Coinbase: The accumulated solution for the coinbase puzzle.
Signature: A digital signature proving validity.
The block header itself tracks important things like the Merkle root of transactions, finalize state, ratifications, and proof targets. It also holds metadata like the block’s height, network ID, and timestamp. Every new block extends the chain, ensuring Aleo remains secure and up to date.
Last updated