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⌊ℓ/3⌋−1
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)
  • 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:

  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.