The Staking Manager is the primary contract for validator-related activities in Shibarium, including stake management, reward distribution, and signature verification. All proof verification and staking operations are executed on Ethereum, while computation-heavy tasks are handled on L2.
Roles in Staking
- Validator: Stakes BONE, validates blocks, can accept delegation.
- Delegator: Delegates BONE to validators for a share of rewards.
- Watcher: Reports fraud.
A single Ethereum address can only be a validator or a delegator, not both.
Key Concepts
- NFT Ownership: Each stake mints a unique NFT (ERC721) representing validator ownership. Ownership changes do not impact system integrity.
- Validator Threshold: Maximum number of validators (slots) allowed.
- AccountStateRoot: Used for accounting and reward claims; submitted with each checkpoint.
Staking Functions
Stake & StakeFor
Stake & StakeFor
- Stake BONE to become a validator (if below threshold).
- Transfers
amount + heimdallFee
. - Mints a unique NFT for each new stake.
acceptDelegation
deploys a ValidatorShare contract for delegation.
Unstake & UnstakeClaim
Unstake & UnstakeClaim
- Unstake: Removes validator from set in next epoch; updates timeline and locks delegation contract.
- UnstakeClaim:
- After withdrawal delay, allows settlement (rewards, staked tokens, NFT burn).
Restake
Restake
- Increase stake with new amount or rewards.
- Updates timeline for active stake.
Withdraw Rewards
Withdraw Rewards
- Withdraw accumulated rewards (including from delegation contract if applicable).
Update Signer
Update Signer
- Update validator’s signer address for block and checkpoint validation.
Top Up & Claim Fee
Top Up & Claim Fee
- Top Up Heimdall Fee:
- Claim Fee:
- Withdraw fee from Heimdall using proof of inclusion in accountStateRoot.
Validator Replacement & Auction
Validator Replacement & Auction
- startAuction:
- confirmAuctionBid:
- Periodic auctions allow replacement of poor-performing validators.
- Bidding and confirmation logic ensures dynamic security and fair validator selection.
Check Signatures
Check Signatures
- Validates checkpoint signatures (BFT 2/3+1 agreement).
- Ensures rewards are distributed proportionally to stake.
Timeline Data Structure
Timeline Data Structure
- Tracks active validators and staking per epoch/checkpoint.
StakingInfo & ValidatorShareFactory
StakingInfo & ValidatorShareFactory
Notes & Additional Info
- NFT is standard ERC721 with restrictions (one per user, sequential minting).
jail
,unJail
, andslash
functions are not currently used.- Some mechanisms are inspired by Polygon’s open-source design.