Skip to content

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:

nftId=100×year+level

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: {0,3,6,,99}. Each level determines:

  • Denomination D=10 — the XPOW value per NFT
  • Maturity year =mintYear+2/31
LevelDenomination (XPOW)Maturity Offset (years)
010
31,0001
61,000,0003
91,000,000,0007
15101531
301030~1,024
601060~1,000,000
991099~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 can be burned to mint 1 NFT at level +3. This preserves the 10× denomination increase because 10+3=1,000×10.

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)
  • TransferrefreshClaimed() 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:

  1. Own 1,000+ XPowerNfts at level
  2. Call XPowerNft.upgrade(account, ids, amounts)
  3. 1,000 NFTs at level are burned
  4. 1 NFT at level +3 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.