Skip to content

The Ergo Data Model#

This document provides a comprehensive and in-depth exploration of Ergo's unique data model, based on the UTXO (Unspent Transaction Output) model, enhanced with powerful smart contract capabilities (eUTXO).


1. Theoretical Foundations & Core Concepts#

1.1 Computational Model Evolution & UTXO vs. Account Model#

Ergo represents a significant advancement in blockchain computational models, extending the traditional Unspent Transaction Output (UTXO) paradigm through its enhanced eUTXO (Extended UTXO) model. Unlike conventional blockchain architectures, Ergo's model introduces:

  • Programmable State Transitions: Enabling complex computational logic within transaction outputs. This contrasts with the account-based model used in other blockchains (like Ethereum), where state is globally mutable. See UTXO Model Explained for a comparison of Ergo's model in terms of parallelism, privacy, and scalability.
  • Stateless Verification: Allowing efficient validation without maintaining complete blockchain state.
  • Deterministic Execution: Ensuring predictable and verifiable transaction outcomes.

1.2 Fundamental Design Principles#

  1. Computational Completeness: Supporting Turing-complete smart contract execution within strict cryptographic constraints.
  2. Cryptographic Composability: Enabling complex cryptographic protocols through Sigma Protocols.
  3. Scalable State Management: Designing a model that supports parallel transaction processing and efficient state verification.

2. Blockchain Structure: Components and Function#

A solid understanding of the blockchain structure lays the groundwork for exploring Ergo’s data model. Ergo blocks contain critical metadata, transactions, and proofs.

2.1 Block Components#

  • Block Overview: Comprehensive introduction to block structure in Ergo, detailing how blocks aggregate transactions, references, and proofs.
  • Block Header: Detailed examination of block header components, which include references to previous blocks, difficulty, and other crucial metadata.
  • Block Transactions: Understanding how transactions are organized within a block to form the ledger state.
  • AD Proofs: Authenticated Data Proofs enable efficient stateless client verification by providing cryptographic proofs of state transitions.
  • Extension Section: An exploration of Ergo’s flexible data storage section that can hold additional metadata and information beyond basic transactions.

3. Boxes: Foundational State Units#

At the core of Ergo's data model is the "Box," which is Ergo's implementation and extension of the UTXO (Unspent Transaction Output) concept. While traditional UTXOs simply track unspent coins, Ergo's Boxes enhance this model with additional programmable capabilities.

3.1 The Box Concept#

A Box is essentially a "smart UTXO" - it serves the same role as a UTXO in tracking unspent value, but extends this with sophisticated computational features. Like a UTXO, a Box is created when value is sent in a transaction and is consumed (spent) when that value is transferred elsewhere. However, Boxes add the following capabilities that go beyond basic UTXOs:

  • Immutable State: Each box represents an atomic, immutable state unit that cannot be modified after creation. See Box Lifecycle for details on creation, spending, and destruction.

  • Typed Registers: Boxes contain 10 registers (R0-R9) with specific purposes and rich computational potential:

    • R0: Monetary Value (in nanoERGs)
    • R1: Protection Script (Smart Contract)
    • R2: Assets/Tokens
    • R3: Creation Details
    • R4-R9: Flexible, Typed Custom Data Storage
      • Supports multiple data types: Int, Long, BigInt, GroupElement, Coll[Byte]
      • Can store complex structures and collections
      • Densely packed with type-safe access
  • Programmable Spending Conditions: Each box specifies precise conditions under which it can be spent, enabling complex logic through ErgoScript. See Box Modeling and Box Overview for detailed exploration.

By transforming UTXOs from simple value trackers to programmable state containers, Ergo enables more expressive and flexible blockchain interactions while maintaining cryptographic integrity and computational efficiency.


4. Transactions: Engines of State Change#

Transactions define how boxes are created, transformed, and consumed, and are central to Ergo’s dynamic state evolution.

4.1 Transaction Foundations#

  • Transaction Overview: Fundamental principles of how transactions work in Ergo.
  • Transaction Composition: Detailed guide to constructing complex transactions off-chain before submitting them on-chain.
  • Transaction Format: Technical specification of transaction structure, ensuring interoperability and standardization.

4.2 Advanced Transaction Mechanisms#

4.3 Specialized Transaction Features#


5. Assets and Tokens: Powering a Diverse Economy#

Ergo supports a rich ecosystem of assets, from fungible tokens to NFTs, enabling complex economic models.

5.1 Fungible Tokens#

5.2 Non-Fungible Tokens (NFTs)#

5.3 Special Token Concepts#


6. Addressing and Identity#

Ergo uses an address system that ensures security, privacy, and flexibility.

  • Address Basics: Fundamental concepts of Ergo addresses, including encoding, format, and usage
  • Address Types: Detailed overview of Pay-to-Public-Key (P2PK), Pay-to-Script-Hash (P2SH), and Pay-to-Script (P2S) address types
  • Address Validation: Methods and best practices for validating Ergo addresses, including checksum verification and format validation

7. Payment Standards and Protocols#

Ergo defines protocols to streamline user interactions with wallets and applications.


8. Cryptographic Foundations#

Ergo’s cryptographic design ensures robust security, privacy, and flexibility.

8.1 Sigma Protocols#

8.2 Cryptographic Primitives#


9. Verification, Consensus, and Sustainability#

9.1 Transaction Validation and Script Execution#

Ergo employs a robust, stateless transaction validation approach:

9.2 Consensus Algorithm & Storage Rent#

  • Difficulty Adjustment: A dynamic mechanism that adjusts mining difficulty every block to maintain a target block time of approximately 2 minutes, ensuring network stability and predictable block creation despite fluctuations in mining power. See this page for technical details.
  • Storage Rent Mechanism: A novel approach that prevents blockchain bloat and ensures long-term sustainability by requiring users to pay rent for storing data on-chain. See this page for details on implementation, fees, and economic incentives.

10. Data Structures and Performance#

10.1 Authenticated Data Structures#

10.2 Scalability and Efficiency#

  • Parallel transaction validation inherent in the eUTXO model.
  • Stateless validation reduces computational and storage overhead.
  • Just-in-time costing ensures resource use is always checked.

For more information see the scaling section.


11. Advanced Concepts: Mastering Ergo's Capabilities#

11.1 Multi-Stage Transactions#