NFT Staking
XPower uses two ERC-1155 NFT contracts to represent different stages of the staking lifecycle: XPowerNft (deposit receipt) and APowerNft (staking receipt).
XPowerNft — Deposit Receipt
When a user deposits XPOW, they receive an XPowerNft — a multi-token ERC-1155 that represents locked XPOW with specific tier parameters.
NFT ID Encoding
Each XPowerNft is identified by:
Where year is the UTC calendar year (e.g., 2026) and level is the NFT tier.
Levels and Denominations
NFT levels must be multiples of 3:
- Denomination
— the XPOW value per NFT - Maturity year
| Level | Denomination (XPOW) | Maturity Offset (years) |
|---|---|---|
| 0 | 1 | 0 |
| 3 | 1,000 | 1 |
| 6 | 1,000,000 | 3 |
| 9 | 1,000,000,000 | 7 |
| 15 | 31 | |
| 30 | ~1,024 | |
| 60 | ~1,000,000 | |
| 99 | ~8,600,000,000 |
Levels above ~75 are effectively permanent — their maturity dates exceed any practical timeframe.
Why Multiples of 3?
The level step of 3 enables the upgrade mechanism: 1,000 NFTs at level
APowerNft — Staking Receipt
When a user stakes an XPowerNft in the NftTreasury, they receive an APowerNft — an ERC-1155 that tracks:
- Staked amount — the XPOW denomination represented
- Age accumulator — time-weighted presence in the staking pool
- Total shares — per-level aggregate, used for dynamic rate calculation
Age Tracking
The APowerNft maintains an _age accumulator that increases with each block while the NFT is staked. This age is the key input to the APB (Annual Percentage Bonus) calculation — older stakes earn higher rates.
Proportional Adjustments
When staking or unstaking part of a position:
- Staking — mints new APowerNft with age=0
- Partial unstaking — burns proportion of APowerNft, proportionally reduces age (proved to preserve average staking duration)
- Transfer —
refreshClaimed()updates the total claimed counter, preventing double-claiming
Ownership
Only the NftTreasury contract can mint or burn APowerNfts — users cannot create them directly. This ensures every APowerNft corresponds to a legitimate staking position.
Upgrade Mechanism
Users can combine XPowerNfts into higher-level NFTs:
- Own 1,000+ XPowerNfts at level
- Call
XPowerNft.upgrade(account, ids, amounts) - 1,000 NFTs at level
are burned - 1 NFT at level
is minted
Tradeoff: Upgrading increases the denomination (and thus the reward rate) by 10×, but also extends the maturity lock period. You're trading liquidity for earning power.