This section provides a detailed explanation of the Shibarium Proof of Stake (PoS) architecture, focusing on the node perspective. The Shibarium PoS system comprises two essential layers: Heimdall, responsible for consensus, and Bor, responsible for execution.
Nodes on Shibarium are structured with a two-layer implementation, represented by Bor (the block producer layer) and Heimdall (the validator layer). On the execution client side, the explanation delves into snapshots, state syncing, network configurations, and commonly used commands for running PoS nodes.
On the consensus client side, it describes how Heimdall manages the authentication of account addresses, validator key management, gas limit management, transaction verification enhancement, balance transfers, staking, and general chain management.
Architectural Overview- The Shibarium Network is divided into three layers:
Ethereum layer — a collection of contracts on the Ethereum mainnet. Heimdall layer — a set of proof-of-stake Heimdall nodes running alongside the Ethereum mainnet. Heimdall monitors staking contracts on Ethereum and commits Polygon Network checkpoints to the Ethereum mainnet, utilizing Tendermint. Bor layer — a set of Bor nodes responsible for block production, shuffled by Heimdall nodes. Bor is built on Go Ethereum. Figure: Ethereum, Bor, and Heimdall Architecture
Staking Smart Contracts on Ethereum- To implement the Proof of Stake (PoS) mechanism on Shibarium, a series of staking management contracts on the Ethereum mainnet are utilized.
These staking contracts offer the following functionalities:
Allows anyone to stake Bone tokens on the Ethereum mainnet staking contracts and become a validator in the system. Earn staking rewards for validating state transitions on the Polygon Network. Record checkpoints on the Ethereum mainnet. The PoS mechanism serves as a solution to the data unavailability problem for Shibarium sidechains.
Heimdall (Validation Layer)- The Heimdall layer manages the aggregation of blocks produced by Bor into a Merkle tree and periodically publishes the Merkle root to the Ethereum mainnet. These published snapshots of Bor are known as checkpoints.
For every few blocks on Bor, a validator on the Heimdall layer:
Validates all blocks since the last checkpoint. Creates a Merkle tree of block hashes. Publishes the Merkle root hash on the Ethereum mainnet. Checkpoints are crucial for:
Providing finality on the root chain. Providing proof of burn for asset withdrawals. The process overview:
A subset of active validators is selected to act as block producers for a span, responsible for creating and broadcasting blocks. A checkpoint includes the Merkle root hash of all blocks created during a specific interval. All nodes validate and sign the Merkle root hash. A selected proposer collects all signatures for a checkpoint and commits it to the Ethereum mainnet. The responsibility of creating blocks and proposing checkpoints depends on a validator's stake ratio in the overall pool.
See also Heimdall Architecture.
Bor (Block Producer Layer)- Bor is Shibarium's sidechain block producer, responsible for aggregating transactions into blocks.
Bor block producers, a subset of validators, are periodically shuffled by Heimdall validators.