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
event FractionalApproval(address indexed owner, address indexed spender, uint256 value);: Emitted when spending approval for the fractional representation changes or is reconfirmed.event FractionalTransfer(address indexed from, address indexed to, uint256 amount);: Emitted when ownership of the fractional-representation token changes. On minting and burning, from and to are the zero address, respectively.event NonFungibleTransfer(address indexed from, address indexed to, uint256 indexed id);: Emitted when ownership of the NFT changes. On minting and burning, from and to are the zero address, respectively.function decimals() external view returns (uint8 decimals);: Returns the number of decimal places used by the fractional representation. This serves as the basis for determining whether a balance is a whole unit or a pure fraction.function totalSupply() external view returns (uint256 totalSupply);: Returns the total supply in terms of the fractional representation. The total NFT supply is obtained via totalSupply() / 10 ** decimals().function balanceOf(address owner_) external view returns (uint256 balance);: Returns an address's balance in the fractional representation.function ownerOf(uint256 id_) external view returns (address owner);: Looks up the owner of a specific NFT. A token owned by the zero address is considered invalid and the lookup must fail.function setApprovalForAll(address operator_, bool approved_) external;: Approves or revokes a third party to manage all of the caller's NFTs.function transfer(address to_, uint256 amount_) external returns (bool success);: Moves a fractional quantity to another address.function safeTransferFrom(address from_, address to_, uint256 id_) external;: Same as above, but an NFT transfer function that passes empty bytes as data.function name() external view returns (string memory name);: Returns the long name of the token collection. Belongs to the recommended metadata interface.function symbol() external view returns (string memory symbol);: Returns the short symbol of the token collection.function tokenURI(uint256 id_) external view returns (string memory uri);: Returns the metadata URI for a specific NFT. Must fail for an invalid NFT.function getBankedNFTsLength() external view returns (uint256 bankedNFTsLength);: Returns the count of NFTs that have been minted but currently have no owner, held in the bank.function totalNonFungibleSupply() external view returns (unit256);: Looks up the NFT supply currently in circulation. Must always be less than or equal to totalSupply() / 10 ** decimals().isNFTTransferExempt(address account_) external view returns (bool);: Looks up whether the given address is exempt from NFT transfers. Belongs to the recommended exemption interface.setSelfNFTTransferExempt(bool isExempt_) external;: Lets the caller set their own NFT transfer exemption status.
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
- Interface misidentification: The source only sets aside a placeholder for discussing the security implications of mistakenly identifying an ERC-7651 contract as ERC-20 or ERC-721, and notes that thorough further discussion is needed.