Architecture
Ramestta is a Proof-of-Stake side chain to Polygon, built using the same proven architecture that powers Polygon. The network consists of two main layers: Heimdall (consensus) and Bor (execution), working together to provide fast, secure, and low-cost transactions.
The Layer Stack
Ethereum (Root Chain)
Settlement Layer âĸ Ultimate Security âĸ ~$50B+ Staked
Polygon (Parent Chain - ID: 137)
Scaling Layer âĸ Staking Contracts âĸ RootChain
Ramestta (PoS Side Chain - ID: 1370)
Application Layer âĸ Heimdall + Bor âĸ ~2s Blocks
Heimdall - Consensus Layer
Heimdall is the heart of the Ramestta network. It manages validators, block producer selection, spans, the state-sync mechanism between Polygon and Ramestta, and other essential aspects of the system. It uses the Cosmos-SDK and a forked version of Tendermint, called Peppermint.
Key Responsibilities
Validator Management
Manages the validator set, staking, delegation, and rewards distribution. Validators stake RAMA tokens on Polygon and are tracked via Heimdall state.
Span Management
Defines spans (sets of blocks) and selects block producers for each span. Uses weighted random selection based on validator stake/power.
Checkpoints
Creates and submits checkpoints to Polygon containing Merkle root of Bor blocks. Requires 2/3+ validator signatures for submission.
State Sync
Handles state synchronization between Polygon and Ramestta. Listens for StateSynced events and passes them to Bor layer.
Heimdall Modules
| Module | Purpose | Key Functions |
|---|---|---|
| Auth | Transaction authentication | Gas/fees, signatures, replay protection |
| Bank | Balance transfers | MsgSend, MsgMultiSend between accounts |
| Staking | Validator operations | Join, exit, stake update, signer change |
| Checkpoint | Checkpoint management | Propose, ack, no-ack checkpoints |
| Bor | Span management | Span proposal, producer selection |
| Topup | Fee management | Top-up Heimdall fees, withdraw |
| Governance | Parameter changes | Proposals, voting, param updates |
| Chainmanager | Chain configuration | Contract addresses, chain IDs |
Key Management
Each validator uses two keys to manage activities on Ramestta:
- Signer Key (Hot Wallet): Kept on the node, used for signing Heimdall blocks, checkpoints, and other signing activities. Requires RAMA tokens for Heimdall fees.
- Owner Key (Cold Wallet): Kept secure, used for staking, re-stake, changing signer key, withdraw rewards, and managing delegation. Transactions via Polygon chain.
Bor - Execution Layer
Bor is the core execution layer that processes all transactions. It operates on the principles outlined in EIP-225, following the Clique consensus protocol. Bor produces blocks and executes smart contracts with full EVM compatibility.
Block Production
Sprint Duration: 16 blocks
Span Duration: 1600 blocks
Producer Count: 4 validators per span
Block Time: ~2 seconds
Bor Chain ID: 1370Validator Selection Process
- Validators are assigned slots proportionally based on their stake
- Historical Polygon block data is used as a seed to shuffle the validator array
- Validators are selected based on producer count maintained by governance
- Tendermint's proposer selection algorithm chooses a producer for each sprint
- Backup producers are designated in case primary fails (with wiggle time delay)
Consensus Mechanics
In Ramestta's PoS system:
- Stake: Participants stake RAMA tokens on Polygon's staking contract to become validators
- Selection: The bor module in Heimdall selects active validators as block producers
- Spans: A span is a defined set of blocks with a specific subset of validators
- Sprints: Within a span, each sprint designates a single block producer
- Difficulty: In-turn blocks have higher difficulty than out-of-turn signatures
- Fork Resolution: Forks are resolved by selecting the chain with highest cumulative difficulty
Checkpoints
Checkpoints are vital components of the Ramestta network, representing snapshots of the Bor chain state. These checkpoints are attested by a majority of the validator set before being validated and submitted on Polygon contracts.
Checkpoint Lifecycle
- Heimdall selects the next proposer using Tendermint's leader selection algorithm
- Proposer creates checkpoint with Merkle root of Bor blocks
- Validators verify and sign the checkpoint (requires 2/3+ agreement)
- Checkpoint is submitted to Polygon's RootChain contract
- Success triggers ACK transaction; failure triggers NO-ACK and proposer change
Checkpoint Structure
interface CheckpointBlockHeader {
Proposer: HeimdallAddress; // Validator who proposed
StartBlock: number; // First Bor block in range
EndBlock: number; // Last Bor block in range
RootHash: Hash; // Merkle root of block hashes
AccountRootHash: Hash; // Merkle root of account state
TimeStamp: number; // Checkpoint timestamp
}State Sync
State Sync is the mechanism that transfers data from Polygon to Ramestta. This enables cross-chain communication and ensures consistency between layers.
How State Sync Works
- StateSynced event is triggered on Polygon's StateSender contract
- Heimdall validators listen for and validate these events
- Events are passed to the Bor layer via the state-sync mechanism
- Bor executes system calls to update state at the start of every sprint
- Receiver contract on Bor implements IStateReceiver interface
interface IStateReceiver {
function onStateReceive(
uint256 stateId,
bytes calldata data
) external;
}Genesis Contracts
Ramestta deploys several genesis contracts that are essential for network operation:
| Contract | Address | Purpose |
|---|---|---|
| BorValidatorSet | 0x0000...1000 | Manages validator set on Bor |
| StateReceiver | 0x0000...1001 | Receives state sync from Polygon |
| MRC20 (Native) | 0x0000...1010 | Native RAMA token contract |
Network Comparison
| Metric | Ethereum | Polygon | Ramestta |
|---|---|---|---|
| Block Time | ~12 sec | ~2 sec | ~2 sec |
| Consensus | PoS (Casper) | PoS (Heimdall) | PoS (Heimdall) |
| TPS | ~15-30 | ~7,000 | 65,000+ |
| Avg Fee | $1-100+ | $0.01-0.10 | <$0.01 |
| Finality | ~15 min | ~5 min | ~2 sec* |
| EVM | Native | Compatible | Compatible |
* Soft finality at Ramestta level. Full finality achieved after checkpoint to Polygon.
Use Cases
Gaming
In-game transactions, NFTs, player rewards with instant confirmation
Payments
Micro-payments, remittances, point-of-sale with minimal fees
DeFi
DEXs, lending, yield farming with fast execution
NFTs
Minting, trading, marketplaces at low cost
Enterprise
Supply chain, identity, records with predictable costs
Social
Social tokens, tipping, community rewards