Consensus Mechanism
The R5 Network employs a proof-of‑work (PoW) consensus based on an improved version of Ethereum's Ethash algorithm called Ethash-R5. This updated algorithm incorporates key enhancements in cache and dataset generation, along with additional sequential mixing rounds in the hashimoto work function. The result is faster block confirmation times, more predictable emission, and improved security while maintaining full compatibility with Geth.
Overview of Ethash-R5
Ethash‑R5 is designed to verify blocks by:
Verifying Block Headers: Each header is checked for correct timestamps, gas limits, and difficulty levels.
Sealing via Proof‑of‑Work: The algorithm validates the seal by confirming that the mix digest and nonce satisfy the current difficulty. Ethash‑R5 introduces extra sequential mixing rounds to further increase the work’s sequential dependency.
Reward and Supply Management: A custom reward schedule based on “Super Epochs” governs token emission, with a strict supply cap beyond which no further block rewards are issued.
The mechanism is divided into modular components to ensure clarity, ease of maintenance, and efficient resource management.
Key Customisations and Differences from Ethereum’s Ethash
1. Modified Cache and Dataset Generation
Custom Size Lookups and Generation: Ethash‑R5 uses new lookup tables for both cache and dataset sizes for the first set of epochs (up to a defined maximum). For epochs beyond this threshold, the sizes are calculated dynamically, ensuring that the growth of both cache and dataset is predictable.
Enhanced Cache Generation: The verification cache is generated with additional progress tracking and logging. It now makes use of a customised Keccak‑512 hasher, and if the system is not little‑endian, the cache bytes are swapped to maintain consistency.
Dataset Generation Improvements: The R5 DAG (dataset) generation process is parallelised across CPU cores. Each thread computes its own portion of the dataset, with optional byte‑swapping for non‑little‑endian systems. This ensures that the dataset can be generated quickly and reliably.
2. Extra Sequential Mixing Rounds
Additional Mixing in the Hashimoto Function: Ethash‑R5 introduces four extra sequential mixing rounds during the execution of the hashimoto work function. In these rounds, the digest is repeatedly combined with selected words from the seed and re‑hashed. This extra step increases the resistance to certain classes of hardware optimisation, thereby improving overall network security.
3. Custom Emission Schedule and Supply Cap
Super Epoch Reward Schedule: The block rewards are distributed over multiple super epochs, with rewards gradually decreasing as the network matures. For example:
Super Epoch 1 (Blocks 1 – 4,000,000): 2 R5 per block
Super Epoch 2 (Blocks 4,000,001 – 8,000,000): 1 R5 per block
Super Epoch 3 (Blocks 8,000,001 – 16,000,000): 0.5 R5 per block
Super Epoch 4 (Blocks 16,000,001 – 32,000,000): 0.25 R5 per block
Super Epoch 5 (Blocks 32,000,001 – 64,000,000): 0.125 R5 per block
Super Epoch 6 (Blocks 64,000,001 – 128,000,000): 0.0625 R5 per block
Super Epoch 7 (Blocks > 128,000,000): 0.03125 R5 per block
Strict Supply Cap Enforcement: Once the network reaches the predetermined supply cap of 66,337,700 coins, no further block rewards are issued. Up to that point, transaction fees are routed to a fee pool wallet (rather than directly to miners), which helps stabilise network incentives. After the supply cap is reached, the Fee Pool becomes defunct and transaction fees are paid directly to miners.
4. Improved Block Validation and Integration
Optimised Block Header and Seal Verification: The Ethash‑R5 engine retains the robust block header and seal validation of Ethereum’s original Ethash, while updating the difficulty adjustment (using a divisor tuned for a ~7‑second target) and incorporating the extra mixing rounds.
Seamless Geth Integration: Despite these modifications, Ethash‑R5 remains fully compatible with Geth. This allows developers to integrate our consensus mechanism into existing Ethereum tooling with minimal effort while benefiting from the enhanced performance and security.
Benefits of Ethash‑R5
Faster Confirmations: With a target block time of around 7 seconds, Ethash‑R5 enables quicker transaction finality.
Enhanced Security: The additional sequential mixing rounds and custom cache/dataset generation steps increase the difficulty of optimising the PoW for specialised hardware, thereby enhancing network security.
Predictable Emission and Supply Control: The super epoch reward structure combined with a strict supply cap offers a transparent and predictable token emission schedule, aiding long‑term economic planning.
Efficient Resource Utilisation: Parallelised dataset generation and optimised memory‑mapping techniques ensure that mining resources are used efficiently.
Smooth Transition from Ethash: The Ethash‑R5 modifications build directly on Ethereum’s Ethash, so developers familiar with the original algorithm will find the transition straightforward, while still gaining the benefits of our custom improvements.
Last updated