Skip to main content
The ledger block module defines the core data structures for blocks in the Aleo blockchain.

Block

A block represents a collection of transactions and solutions added to the blockchain.

Creating Blocks

Beacon Block (Testing)

Beacon blocks are signed by a single private key and used for testing.

Quorum Block (Production)

Quorum blocks are produced by the Narwhal consensus protocol and contain a subdag of certificates.

Block Properties

Hash and Headers

Consensus Information

Merkle Roots

Block Contents

Accessing Components

Finding Elements

Existence Checks

Iterators

Reference Iterators

Consuming Iterators

The block header contains metadata and Merkle roots for efficient verification.

Creating Headers

Headers are automatically validated on creation to ensure well-formedness.

Header Validation

Validation rules:
  • Height 0 blocks must be genesis blocks
  • Non-genesis blocks cannot have zero roots (except solutions_root and subdag_root)
  • Metadata must be valid

Genesis Headers

Genesis blocks have special properties:
  • Height is 0
  • Previous state root is zero
  • Round is 0
  • All validators start with equal stake

Metadata

Block metadata contains consensus and timing information.

Creating Metadata

Metadata Fields

Transaction

Transactions represent state transitions on the blockchain. See the Synthesizer documentation for detailed transaction types.

Transaction Types

  • Deploy: Deploys a new program to the network
  • Execute: Executes a function in a deployed program
  • Fee: Standalone fee transaction

Confirmed Transactions

Confirmed transactions include:
  • The transaction index in the block
  • The transaction itself
  • Finalize operations (state changes) performed

Transition

Transitions are the atomic units of execution within transactions.

Transition Components

  • ID: Unique transition identifier
  • Program ID: The program being executed
  • Function name: The function being called
  • Inputs: Function inputs (records, private data, public data)
  • Outputs: Function outputs (records, data)
  • Proof: Zero-knowledge proof of correct execution
  • TPK: Transition public key
  • TCM: Transition commitment

Input and Output Types

Inputs:
  • Constant: Public constant input
  • Public: Public variable input
  • Private: Private variable input
  • Record: Record input (consumes a record)
  • ExternalRecord: Record from another program
Outputs:
  • Constant: Public constant output
  • Public: Public variable output
  • Private: Private variable output
  • Record: Record output (creates a record)
  • ExternalRecord: Record for another program

Ratifications

Ratifications represent consensus-level state changes like validator bonding/unbonding.

Ratify Types

  • Genesis: Establishes the initial committee
  • BlockReward: Distributes block rewards to validators
  • PuzzleReward: Distributes coinbase rewards to provers

Solutions

Solutions are proof-of-work submissions for coinbase rewards.

Solution Structure

Each solution contains:
  • Address: Prover’s address for rewards
  • Counter: Nonce for the proof-of-work
  • Target: Difficulty target the solution meets
  • Solution commitment: Commitment to the solution
  • Proof: Zero-knowledge proof of work

Transactions

The Transactions type is a collection of confirmed transactions in a block.

Constants

Authority

Block authority determines how the block was produced.
  • Beacon: Single-signature authority (testing only)
  • Quorum: Narwhal consensus subdag (production)

Example: Processing a Block

Next Steps