ERC-7651 Split-representation NFT standard (Fractionally Represented Non-Fungible Token)

Draft · NFTs & multi-token · created 2024-03-05

A standard that allows an NFT and its fractional, fungible representation to be jointly owned and transferred within a single contract, without splitting or locking the NFT.

Why it is needed

Until now, fractional ownership of NFTs has relied on external protocols: a specific NFT is deposited into a protocol, which then issues fractional tokens for that NFT. In this approach, fragments from different NFTs are not treated as equivalent, so each must be traded separately, scattering the liquidity of the overall token supply. Also, a fractionalized NFT is locked in the protocol, so the NFT itself cannot be freely moved until the fragments are gathered and recombined. This standard offers a unified solution that manages an NFT and its corresponding fungible representation together in a single contract, increasing liquidity and accessibility without splitting the NFT or going through a separate conversion step.

What to implement

In depth

Unifying both representations in one contract

This standard manages an NFT and its underlying fractional (fungible) representation together in a single contract. Balances and supply are based on the fractional representation, and decimals() defines the number of decimal places. One NFT corresponds to 10 ** decimals() in the fractional representation, and the total NFT supply is calculated as totalSupply() / 10 ** decimals(). When a transfer specifies an NFT ID, that NFT and its entire corresponding fractional value move together. Compliant contracts must implement the ERC-7651 and ERC-165 interfaces.

The non-overlap principle between ID and amount

approve and transferFrom take a single argument, amountOrId_, that serves as both the fractional quantity and the NFT ID. This makes the non-overlap principle, that no input should be interpretable as both an ID and a quantity at once, central to the design. The source does not mandate a specific implementation, but gives examples such as verifying ownership for ID inputs or reserving a separate range for token IDs. This separates the logic of the overlapping interfaces, minimizing the chance of unexpected outcomes.

A prefix-separated event scheme

The Transfer and Approval events of ERC-20 and ERC-721 have colliding signatures, making a hybrid that fully follows both standards impossible. This standard keeps the traditional transfer/approval event definitions but defines new events distinguished by the Fractional and NonFungible prefixes. Compliant contracts must emit FractionalApproval and FractionalTransfer for approvals/transfers of the fractional representation, and ApprovalForAll, NonFungibleApproval, and NonFungibleTransfer for approvals/transfers of the NFT representation. The judgment is that descriptive, isolated events are ideal, though they require extra work for indexing software.

Three scenarios for fractional transfers

A transfer by NFT ID is simple: the NFT and its entire attached fractional value (10 ** decimals()) move together. A fractional-quantity transfer, on the other hand, requires managing NFT allocation and falls into three cases. First, if neither side's whole-unit balance changes, NFT allocation stays the same. Second, if the sender's balance drops below a whole unit, a proportional number of NFTs must be removed from their holdings. Third, if the recipient's balance crosses a whole unit, their NFT holdings must be increased proportionally. The standard does not mandate a specific handling method, but common examples given are minting/burning tokens in a monotonically increasing fashion or tracking NFT ownership with a stack or queue.

Gas savings via NFT transfer exemption

Moving a large fractional quantity can move many NFTs together in a single transaction, driving up gas costs. For this reason, an optional opt-in mechanism is recommended that lets addresses which don't need the NFT representation skip NFT transfers, usable by both externally owned accounts (EOAs) and contracts. Turning on the exemption sends held NFTs to the bank and zeroes the NFT balance; turning it off pulls out the number of NFTs matching the fractional balance from the bank. The recommended interface IERC7651NFTTransferExemptable defines isNFTTransferExempt for lookups and setSelfNFTTransferExempt for setting it.

NFT banking and ID reuse

The bank is a space that tracks NFTs that exist in supply but have no owner. One approach is to burn an NFT when it leaves circulation and mint a new one when it returns, but minting costs are high and are not offset by the small gas refund from burning, and this doesn't suit collections that want a fixed, finite ID space. The alternative is to keep IDs without burning them, storing them in a queue or stack for reuse, which saves significant gas and provides a predictable, externally readable ID flow. For implementations that reuse IDs, the recommended interface IERC7651NFTBanking defines getBankedNFTsLength, getBankedNFTs, and totalNonFungibleSupply.

Boundaries of compatibility with ERC-20 and ERC-721

This standard aims to be as compatible as possible with the two existing standards, but does not fully conform to either. balanceOf returns the balance in the fractional representation, which differs from the ERC-721 definition. transfer and approve return a success boolean, which is the ERC-20 approach and nonstandard for ERC-721. supportsInterface must not claim support for ERC-20 or ERC-721. Also note that the recommended metadata interface has the same function definitions as ERC-721 metadata, so its ERC-165 interfaceId is identical as well.

A proposal still in Draft stage

This proposal is in Draft status, created on March 5, 2024. Its content may change, and the Security Considerations section is explicitly noted as still needing discussion.

Things to watch out for

Original ERC · ← ERCs