|
1 |
| ---- |
2 |
| -tags: |
3 |
| - - Blocks |
4 |
| ---- |
5 |
| - |
6 | 1 | # Understanding Blocks in Ergo
|
7 | 2 |
|
8 |
| -Ergo's blockchain operates on a block interval [set at two minutes](difficulty.md). Initially, each block released 75 ERG, which were distributed among miners and the EF Treasury. This setup applied for the first two years of operation. From the second year onwards, the release rate decreased by 3.0 ERGs, with this reduction continuing every three months. This systematic decrease was initially programmed to halt emission eight years post Ergo's launch. However, with the introduction of [EIP-27](eip27.md), the emission period has been extended to approximately the year 2045. |
9 |
| - |
10 |
| -## Ergo Block Structure |
11 |
| - |
12 |
| -Ergo, similar to other blockchains like Bitcoin and Ethereum, segregates blocks into different sections for enhanced functionality. However, Ergo's structure is more complex than Bitcoin's, which only consists of a block header and transactions. Ergo's structure includes additional sections: |
13 |
| - |
14 |
| -1. **Header**: The header contains essential metadata about the block, including information necessary for synchronizing the chain and validating Proof-of-Work (PoW) accuracy. It also includes hashes that link to other sections of the block. |
15 |
| - - The `Header` class, which defines the structure of the block header, can be explored in the [Header.scala](https://github.com/ergoplatform/ergo/blob/master/ergo-core/src/main/scala/org/ergoplatform/modifiers/history/header/Header.scala) file on GitHub. |
| 3 | +In blockchain technology, a **block** is a fundamental unit of data that groups together a set of transactions. These blocks are linked together chronologically to form a "blockchain," serving as a secure and transparent record of all transactions. |
16 | 4 |
|
17 |
| -2. **Block Transactions**: This section consists of all the transactions included within the block. It plays a critical role in defining the state changes in the Ergo blockchain. |
18 |
| - - The transaction data structure is detailed in the [ErgoTransaction.scala](https://github.com/ergoplatform/ergo/blob/master/ergo-core/src/main/scala/org/ergoplatform/modifiers/mempool/ErgoTransaction.scala) file. |
| 5 | +PoW is a consensus mechanism that requires miners to solve complex mathematical problems to add new blocks to the blockchain. This process, known as "mining," involves significant computational effort, ensuring the security and immutability of the blockchain. |
19 | 6 |
|
20 |
| -3. **ADProofs**: Also known as authenticated data proofs, these are associated with transactions in the corresponding Block Transactions section. ADProofs allow light clients to authenticate all transactions and compute a new root hash without downloading the entire block. |
21 |
| - - ADProofs are managed and structured within the [ADProofs.scala](https://github.com/ergoplatform/ergo/blob/master/ergo-core/src/main/scala/org/ergoplatform/modifiers/history/ADProofs.scala) file. |
| 7 | +Ergo, like other Proof-of-Work (PoW) blockchains such as Bitcoin, uses blocks to record transactions and ensure the integrity of the network. However, Ergo's block structure is more sophisticated, offering enhanced functionality and efficiency. |
22 | 8 |
|
23 |
| -4. **Extension**: This section holds additional information that doesn't fit into the previous sections. It includes interlinks and the chain's current parameters when the extension belongs to a block at the end of a voting epoch. |
24 |
| - - For a detailed look at how the extension data is managed, refer to the [Extension.scala](https://github.com/ergoplatform/ergo/blob/master/ergo-core/src/main/scala/org/ergoplatform/modifiers/history/extension/Extension.scala) file. |
| 9 | +In Ergo, a new block is created approximately every **two minutes**. Initially, each block rewarded miners with 75 ERG, which were distributed among them and the Ergo Foundation Treasury. This emission schedule applied for the first two years of the network's operation. You can find more details in the [emission section](emission.md). |
25 | 10 |
|
26 |
| -### The Extension Section in Detail |
27 | 11 |
|
28 |
| -The 'extension' section of Ergo's block structure contains specific mandatory fields, including NIPoPoWs links (which appear once every 1,024 block epoch) and parameters for [miner voting](governance.md), such as the current block size. The extension section can also include arbitrary fields as required. |
| 12 | +## Ergo Block Structure |
29 | 13 |
|
30 |
| -The extension section serves as a key-value storage accommodating a diverse range of data. The key is consistently 2 bytes long, and the maximum size of a value is 64 bytes. The overall Extension size should not exceed 16,384 bytes. |
| 14 | +Ergo's blocks are divided into distinct sections to optimize organization and functionality: |
31 | 15 |
|
32 |
| -Certain keys have predefined meanings: |
| 16 | +1. [**Header**](block-header.md): The header acts as a summary of the block's content. It includes metadata (block version, timestamp, etc.), hashes linking to other block sections, and the Proof-of-Work solution. |
33 | 17 |
|
34 |
| -- If the first byte of a key equals `0x00`, the second byte identifies the parameter, and the value determines the parameter's value. |
35 |
| -- Another predefined key is used for storing the interlinks vector. In this case, the first byte of the key is `0x01`, the second one matches the index of the link in the vector, and the value contains the actual link (32 bytes) prefixed with the frequency it appears in the vector (1 byte). |
| 18 | +2. [**Block Transactions**](block-transactions.md): This section contains the core data of the block – a list of all transactions included within it. These transactions define how tokens and assets are transferred on the Ergo blockchain. |
36 | 19 |
|
37 |
| -This intricate design allows various nodes and clients to download only the block sections relevant to them, significantly reducing storage, bandwidth, and CPU usage demands, thereby enhancing system efficiency. |
| 20 | +3. [**ADProofs**](block-adproofs.md): These cryptographic proofs, short for Authenticated Data Proofs, allow light clients (nodes with limited storage) to verify transactions without downloading the entire block or the full UTXO set (the record of unspent transaction outputs). |
38 | 21 |
|
39 |
| -### Additional Resources |
| 22 | +4. [**Extension**](extension-section.md): This section provides a flexible space to store additional data that doesn't fit into the other sections. It includes interlinks for NiPoPoWs (efficient proof-of-work verification) and system parameters (e.g., block size). |
40 | 23 |
|
41 |
| -To further enhance its flexibility and efficiency, Ergo supports [Superblock Clients](log_space.md), providing an additional layer of adaptability to accommodate diverse user needs. |
| 24 | +This structured approach enhances efficiency and allows for greater flexibility in incorporating new features and upgrades into the Ergo blockchain. |
42 | 25 |
|
43 |
| -## Related Concepts: Ergo Modifiers |
| 26 | +## Related Concepts |
44 | 27 |
|
45 |
| -In Ergo's P2P protocol, blocks and transactions are referred to as "[Modifiers](modifiers.md)". Modifiers are transmitted between nodes as part of the network synchronization process. The Modifier Exchange process encompasses the protocols and systems in place to exchange this information efficiently and securely across the network. |
| 28 | +* **Ergo Modifiers:** In Ergo's peer-to-peer network protocol, blocks and transactions are referred to as "modifiers." These modifiers are exchanged between nodes to keep the network synchronized. [More details](modifiers.md) |
| 29 | +* **Superblock Clients:** Ergo supports "superblock clients," which provide an additional layer of efficiency and flexibility for specific use cases. [More details](log_space.md). |
0 commit comments