ERC-5173 NFT Future Rewards (nFR)
Draft · NFTs & multi-token · created 2022-05-08
An ERC-721 extension standard that lets previous owners share in a portion of realized gains if an NFT's value rises after they sell it.
Why it is needed
Under the current NFT standard (ERC-721), once an NFT is sold, the relationship with that asset is completely severed. No matter how much the price rises afterward, no share returns to the previous owner. The source text points out that traditional financial markets operate unfavorably for most participants due to inefficiency, opaque practices, and structural imbalances. While blockchain provides transaction transparency, it argues that the current implementation alone makes it difficult to distribute value fairly or align the interests of participants. This standard defines a structure that records ownership and price-change history on the token and distributes a fixed percentage of any sale profit to previous owners. It explains that this keeps owners invested in the asset's growth even after selling, creating a cooperative trading model that recognizes the contribution of every stage of ownership.
What to implement
event FRClaimed(address indexed account, uint256 indexed amount);: An event emitted when an address successfully claims its accumulated Future Rewards.event FRDistributed(uint256 indexed tokenId, uint256 indexed soldPrice, uint256 indexed allocatedFR);: An event emitted when a token is sold at a profit and the Future Reward is distributed to previous owners.event Listed(uint256 indexed tokenId, uint256 indexed salePrice);: An event signaling that a token has been listed for sale at a specific price.event Unlisted(uint256 indexed tokenId);: An event signaling that a token's sale listing has been canceled.event Bought(uint256 indexed tokenId, uint256 indexed salePrice);: An event signaling that a token has been purchased at the listed price.function list(uint256 tokenId, uint256 salePrice) external;: The token owner or an approved address lists the token for sale at a specified price.function unlist(uint256 tokenId) external;: After verifying ownership, deletes the sale listing information for the token.function buy(uint256 tokenId) payable external;: Verifies that the amount sent matches the listed price and purchases the token. This must be a payable function.function releaseFR(address payable account) external;: Pays out the Future Rewards accumulated for a specified address using a pull-payment pattern.function retrieveFRInfo(uint256 tokenId) external returns(uint8, uint256, uint256, uint256, uint256, address[] memory);: Looks up a token's FR information (number of generations, profit distribution ratio, common ratio, last sale price, number of owners, and list of FR-eligible addresses).function retrieveAllottedFR(address account) external returns(uint256);: Looks up the amount of unclaimed Future Rewards allocated to a specific address.function retrieveListInfo(uint256 tokenId) external returns(uint256, address, bool);: Looks up a token's sale listing information (price, lister, and whether it is listed).
In depth
FRInfo and ListInfo storage requirements
The contract must implement and maintain FRInfo for each token ID. FRInfo consists of numGenerations (number of generations, uint8), percentOfProfit (profit distribution ratio scaled by 1e18), successiveRatio (common ratio of the geometric sequence), lastSoldPrice (last sale price in ETH mantissa terms), ownerAmount (number of owners the token has passed through), and addressesInFR (array of addresses currently in the FR cycle). These can be packed into a single mapping or split across several, but they must be public mappings or have accessor functions so clients can query and verify them. ListInfo (salePrice, lister, isListed) must also be stored in a per-token-ID mapping with a public means of querying it, and the _allottedFR mapping holding per-address allotments must likewise be public or have a query function.
Ratios use 1e18 fixed point
The ratio used in the allocatedFR calculation must be fixed point with 1e18 as the scale factor (X/1e18). For example, 5% is 5e16. This is REQUIRED for consistency across the standard, with a maximum and minimum value of 1e18 - 1. The Rationale explains that representing 1e18 as 100% and 1e16 as 1% is a common convention across several Solidity libraries that handle fixed point arithmetic.
ERC-721 function overrides
_mint, _transfer, and _burn must be overridden. _mint must set up the default FR model and update the owner count even when called via the plain ERC-721 _mint rather than an nFR-specific mint, and must add the recipient to the FR cycle immediately. _transfer must update state as if the token were sold for 0 ETH, to prevent FR bypass, and must require that the transfer is not sent to the sender itself or to an address already within the FR sliding window; otherwise the FR order could be filled with the same or duplicate addresses. _burn must delete the FRInfo and ListInfo for that token after burning.
list, unlist, buy
These three functions provide the token sale functionality and must be implemented. list should verify that msg.sender is the owner or an approved address, then update ListInfo and emit a Listed event. unlist should verify ownership and then delete ListInfo. buy must be payable, must verify that msg.value matches salePrice and that the token is listed, and must then call the FR version of _transferFrom. It must also verify that the buyer is not already within the FR sliding window.
FR _transferFrom and distribution logic
The FR version of transferFrom(from, to, tokenId, soldPrice) determines whether there is a profit by comparing against the stored lastSoldPrice. If there is no profit, it updates lastSoldPrice, increments the owner count, shifts generations, and sends the full msg.value to the lister. If there is a profit, it calls _distributeFR. To prevent a seller from paying itself, _distributeFR excludes the last address in addressesInFR when determining recipients; if there are no recipients because this is the first sale, it returns 0 or sends msg.value to the lister. It applies _calculateFR to the difference between the sale price and lastSoldPrice to distribute the profit, returns the difference between the total distributed amount (allocatedFR) and soldPrice to the lister, and emits an FRDistributed event. ListInfo must be cleared once this is complete.
Sliding window and geometric sequence calculation
Distribution recipients are determined using a fixed-size sliding window (n). Owners are ordered from the first owner to the immediately preceding owner, and only prior owners within the window participate in the distribution. The actual number of participating owners is n = min(m, w), where m is the current owner count and w is the window size. The realized profit P is split using a geometric sequence that applies a buyer reward ratio R and a common ratio g, so that earlier buyers receive a larger share and the first-generation owner receives the largest reward. An owner who sold at a loss owes no FR share since there was no profit to split, but still continues to receive distributions from profits realized in later generations.
Claims are full payment, generation shifting is unconditional
FR payouts should use a pull-payment model, similar to OpenZeppelin's PaymentSplitter, where the recipient claims the funds themselves. A successful claim via releaseFR emits an FRClaimed event. According to the Rationale, since a recipient may not be actively watching secondary sales, payout events must be left on record so that, as with ERC-2981, the contract can be queried to confirm a deposit. _shiftGenerations must be called regardless of whether the sale was profitable, and removes the oldest account from _addressesInFR based on the array length and the total number of generations for that token.
Compatibility and proposal status
This proposal states that it is fully compatible with ERC-721 and ERC-2981, and can easily be adapted for ERC-1155. ERC-165 support is required. The reference implementation uses OpenZeppelin contracts and the PRB Math library for fixed point arithmetic. This proposal is currently in Draft status, so its contents may change.
Things to watch out for
- Payout-related attacks: Adding collection, distribution, and payout of royalties and realized-profit rewards widens the attack surface. The source recommends applying reentrancy protection to every function that handles payouts.
- Monopolizing FR through wash trading: If a single entity repeatedly resells a token to itself at a loss across multiple wallets to become the owner across several generations, it can monopolize subsequent FR distributions. This can be partially mitigated with wallet-score or holding-duration-based incentives that reduce rewards for new wallets or short holding periods.
- Wash trading by marketplace operators: There are reports of operators engaging in wash trading themselves, or colluding with specific users, to funnel royalties and FR back to themselves. It is recommended that exchanges implement self-trade prevention and provide access to on-chain transaction monitoring services.
- Excessively long or cyclic generation lists: A malicious contract could create an excessively long or cyclic FR generation list, causing gas exhaustion during distribution or generation shifting and halting operation. Clients should independently verify that the generation count of any contract they interact with is reasonable.
- Royalty avoidance and cost basis: If royalties are avoided through an off-market transfer, the new buyer's recorded cost basis becomes 0, meaning the entire sale price on the next sale is treated as profit, increasing the FR burden. This creates a structure where buyers reject bypass offers out of their own self-interest.