Architecture Overview
Infrastructure is developed in collaboration with Nethermind (smart contract engineering and security) and the XDC Core team (network-level validator integration).
Infrastructure is developed in collaboration with Nethermind (smart contract engineering and security) and the XDC Core team (network-level validator integration).
System Design
Contract Topology
| Contract | Function | Upgradeability | Address |
|---|---|---|---|
PrimeStakedXDC_V3_2 | ERC-4626 native-XDC vault. Mints/burns psXDC shares, serves instant withdrawals from unencumbered liquidity, runs the FIFO queue from a ring-fenced budget, interfaces with masternodes. | None (regular constructor, no proxy) | 0xDc74…c734 |
PrimeStakedXDC_V3_2MigrationBridge | One-way V2 psXDC → V3.2 share migration. Time-locked admin, daily withdrawal caps. (The original V3 bridge 0x6c57…373C was retired with the old V3 token.) | None | 0x313e…c280 |
Full inventory in Deployed Contracts & Addresses.
Validator Infrastructure
StakeXDC operates XDC Network masternodes that generate the underlying staking yield:
- Validator delegation is performed by
PrimeStakedXDC_V3_2directly against the on-chain XDC validator contract. No off-chain custodian. - Operator onboarding is admin-controlled (KYC-verified masternode operators); operator scans are bounded by
operatorScanLimitto prevent gas-griefing. - Auto-propose runs opportunistically during stake or via
triggerAutoPropose(maxNodes). It is blocked whenever the withdrawal queue has a backlog, so user redemptions are prioritised over new validator locks. - Resignation returns principal to the vault after the network
candidateWithdrawDelay(~35 days under typical block times).reportMasternodeResignPrincipal(operator)accounts for the returned principal without inflating the reward share. - Per-operator tracking of outstanding principal both globally and per operator (
outstandingValidatorPrincipalByOperator). - No principal-stake slashing. XDC penalizes underperforming masternodes via temporary exclusion (~2h) and missed rewards, but never burns staked capital.
Security Layers
| Layer | Implementation |
|---|---|
| Smart contract audits | QuillAudits (98.8% on liquid staking) + Nethermind Security (custody / V3 surface) |
| Permissionless custody | Validator keys and treasury secured by on-chain contracts |
| Reentrancy protection | OpenZeppelin ReentrancyGuard on every state-changing function |
| Delayed governance | Every sensitive parameter change (role rotations, loss caps, governance delay itself, ownership transfer) is a schedule → wait → execute flow |
| Loss caps | reportValidatorLoss is bounded by maxLossBpsPerReport and maxDailyLossBps, both governed via delayed changes |
Data Flow
Staking
- User calls
stake()ordepositNative(assets, receiver)onPrimeStakedXDC_V3_2with native XDC asmsg.value. - Vault mints psXDC shares at the current exchange rate (
totalAssets / totalShares). - Excess liquidity above the buffer triggers auto-propose if no queue backlog exists; XDC is delegated to a masternode through the XDC validator contract.
Reward Accrual
- Masternode rewards are collected off-vault and distributed into it by the operations team (
distributeRewards, roughly monthly, sized to the 5.5% target). totalAssetsincreases; share supply does not.- Exchange rate rises automatically, so every psXDC share is worth more XDC. There is no manual
claimstep for the base layer.
Withdrawal
- User calls
redeemWithQueue(shares, receiver)(orwithdrawWithQueue(assets, ...)). - If
maxRedeem(user) >= shares, the redemption settles instantly in the same transaction. - Otherwise the request enters the FIFO queue; shares are escrowed inside the vault. Settlement uses the live exchange rate at processing time.
processWithdrawalQueue(maxRequests)is permissionless; anyone can push the queue forward.- Failed receiver payouts defer into
pendingQueuedAssets; the user claims later viaclaimQueuedAssets.
Integration Points
| Integration Level | Description | Use Case |
|---|---|---|
| Frontend | Embed StakeXDC widgets or build a custom frontend on top of the contracts | White-label web integration |
| Smart Contract | Call PrimeStakedXDC_V3_2 directly for stake/withdraw, ERC-4626 standard means partner contracts can wrap psXDC as collateral. | Backend / API integration |
Institutional overview
StakeXDC is more than a retail staking app, it is staking infrastructure for the XDC Network, designed to serve exchanges, custodians, and institutional partners at scale.
Custody Model
StakeXDC operates a non-custodial, smart contract-based custody model. Validator keys and staked assets are managed entirely by audited on-chain contracts - no human interaction…