Decoding Aleo’s Transitions, Blocks, and More: A Dive into Core Data Structures

Dmytriiev Petro
3 min readAug 31, 2023

--

In the realm of Aleo, the promise of a secure and private blockchain ecosystem comes to life through its intricate architecture. Central to this architecture are essential data structures that power the network’s functionality. In this exploration, we unveil the components and inner workings of Aleo’s transitions, blocks, and more.

Transitions: Constructing the Journey

Aleo transitions are the building blocks that power the network’s operations. They are elegantly serialized, following a specific format:

1. id: A finite field element representing the transition’s unique identifier, computed from the Merkle tree digest formed from Input and Output IDs.

2. program_id: A string denoting the program’s ID, associated with a verification key in the network’s global ledger.

3. function_name: A string used to compute a function_id using the program_id.

4. inputs: An array of Inputs, including constants, public and private inputs, as well as inputRecords.

5. outputs: An array of Outputs, encompassing constants, public and private outputs, and outputRecords.

6. finalize: An array of inputs required for finalization.

7. tpk: A group element representing the transition public key, essential for verifying digital signatures provided by transaction owners.

8. tcm: A finite field element representing the transition commitment.

Input and Output Records: Transparent Spending

  • Input Record: An inputRecord comprises a serial_number and a tag. The serial number discloses the record being spent, while the tag is computed to track spendable records. A tag is formed using tag = CRH.Eval(sk_tag, record_commitment).
  • Output Record: An outputRecord consists of record_commitment, checksum, and record_ciphertext. A record_commitment is computed via Pedersen.Commit(pp, apk || data || nonce || microcredits ; r). The record_encryption and checksum, validating the record commitment, are computed via SymmEnc.Eval(pp, apk || data || nonce || microcredits ; r) and CRH.Eval(record_encryption) respectively.

Blocks: The Fabric of Time

Aleo blocks, fundamental to organizing transactions chronologically, follow a clear serialization:

1. block_hash: Hash of the block.

2. previous_hash: Hash of the previous block.

3. header: The block header summarizing the block’s state and the ledger’s status.

4. transactions: A list of transactions included in the block.

5. ratifications: Ratifications for proving rewards.

6. coinbase: Solution to the coinbase puzzle.

7. signature: The block’s signature.

Block Header: A Snapshot of State

The block header encapsulates the block’s status, reflecting the network’s history and current state:

1. previous_state_root: Merkle root representing previous block ledger state.

2. transactions_root: Merkle root representing transactions in the block.

3. finalize_root: Merkle root for on-chain finalize including the current block.

4. ratifications_root: Merkle root representing ratifications in the block.

5. coinbase_accumulator_point: Accumulator point of the coinbase puzzle.

6. metadata: Block metadata, including network ID, round, height, total supply, weights, targets, and timestamps.

Unveiling Aleo’s Core

In delving into Aleo’s core data structures, we uncover the intricate tapestry that powers this innovative blockchain. Transitions, blocks, and headers work in harmony, weaving together privacy, security, and functionality. As the journey to the future continues, Aleo’s data structures remain the bedrock of its vision.

--

--

Dmytriiev Petro
Dmytriiev Petro

Written by Dmytriiev Petro

crypto geek from austria @ogpetya

No responses yet