Dual-layer architecture
Polygon PoS is composed of two layers that operate together:- Heimdall (consensus layer): a set of proof-of-stake nodes that monitor staking contracts on Ethereum, validate Bor block data, and submit periodic checkpoints to the Ethereum mainnet. Heimdall-v2 is built on CometBFT and Cosmos SDK.
- Bor (execution layer): a set of block-producing nodes that execute EVM transactions. Bor is based on Go Ethereum (Geth), with Erigon also supported. Block producers are a rotating subset of validators, selected by Heimdall.
How transactions reach finality
With Heimdall v2, deterministic finality is achieved in 2 to 5 seconds through a milestone mechanism. Validators use vote extensions on the Heimdall consensus layer to agree on the longest common sequence of Bor block hashes since the last finalized milestone. When 2/3 or more of the validating stake agrees, that sequence is finalized as a new milestone. Milestones and checkpoints serve different purposes:- Milestones finalize blocks on the Polygon chain itself, within seconds, using the Heimdall consensus layer.
- Checkpoints are Merkle roots of Bor block data submitted to Ethereum approximately every 256 blocks. They provide proof of state on Ethereum and are required for withdrawals to the mainnet.
Checkpoint verification is required for bridging assets from Polygon PoS to Ethereum. For transactions that stay on Polygon PoS, milestone finality applies instead.
Core contracts on Ethereum
A set of contracts on the Ethereum mainnet connect Polygon PoS to Ethereum. These contracts handle:- Staking: validators lock POL tokens here to participate in consensus.
- Checkpoint storage: Heimdall submits Merkle roots of Bor block data to these contracts periodically.
- Asset bridging: users who want to withdraw tokens to Ethereum interact with an exit queue managed by these contracts.
Validator nodes
Validators run both a Heimdall node and a Bor node. Their responsibilities span two areas:- On Heimdall: monitoring staking events on Ethereum, validating Bor blocks, and proposing or co-signing checkpoints.
- On Bor: producing and validating blocks.