ERC-8520 ERC-721 embedded asset locking extension (ERC-721 Composition Extension)
Draft · NFTs & multi-token · created 2026-11-26
An ERC-721 extension that locks the native assets or ERC-20 holdings declared at the time an NFT is minted into a dedicated container, allowing only the address that was the owner at the moment the token was burned to withdraw them.
Why it is needed
Ways to hold assets inside an NFT already exist, such as ERC-6551, but while the token still exists the holder, an approved party, or the issuing contract can empty the container. ERC-6551 itself notes in its security considerations the scenario where a holder drains the assets and then sells the now-empty token, but leaves preventing this up to implementations and marketplaces. Simply reading the container's current balance cannot distinguish this case. The balance can be arbitrarily topped up or reduced by the asset issuer, so a balance that is neither empty nor full proves nothing about what was declared to be held when the token was minted. The underlying problem is that there is no standard interface for marketplaces, wallets, and indexers running different codebases to commonly read this declaration and lock.
What to implement
function compositionOf(uint256 tokenId) external view returns (Constituent[] memory constituents);: Returns the list of constituent assets (native assets or ERC-20 tokens and their amounts) locked when tokenId was minted.function compositionAccountOf(uint256 tokenId) external view returns (address account, bytes4 accountType, bytes memory accountData);: Returns the container address holding tokenId's constituent assets, its type, and the data needed for verification.
In depth
View functions never revert and their values are fixed
compositionOf and compositionAccountOf never revert for any tokenId. For a tokenId with no declaration, compositionOf returns an empty array and compositionAccountOf returns the zero address, bytes4(0), and empty bytes; this is interpreted as no declaration, not a declaration of zero constituent assets. Once a token is minted, the return values of both functions never change for as long as the contract exists, including after burning.
Constituent assets are limited to native assets and ERC-20
Each constituent's asset MUST be an ERC-20 contract or a native asset address per the ERC-7528 convention. The same asset can appear only once per token, and amount cannot be zero. The constituents returned by compositionOf and CompositionDeclared MUST be sorted in strictly increasing order of asset address. It is recommended not to declare assets, such as rebasing tokens, where the issuer can reduce a holder's balance without a transfer.
The container is either an ERC-6551 account or another design honoring the same lock
compositionAccountOf returns the container address, accountType (the ERC-165 identifier of the interface that container supports), and accountData (the data needed for verification). If the container is an ERC-6551 token-bound account, accountType must be 0x6faff5f1, accountData must be abi.encode(implementation, salt), and account must match the address computed by the standard ERC-6551 registry. A single container cannot be declared for another token on the same contract, and must already be a contract at mint time.
Declaration and funding must be in place before minting
A token can be minted only after its constituent assets and container are declared, the container is an actual contract, and the container holds at least the declared amount for every declared constituent. The declared amount cannot exceed the amount the container received for that token within the minting transaction. Accordingly, a contract receiving the token via onERC721Received or similar will see a state in which the declaration and funding are already in place. This is only a floor; it does not limit how quickly assets can be withdrawn after burning.
Locked while the token exists, released only upon burning
While the token exists, the container must not permit any call, from anyone, to reduce a constituent's balance below its holdings at mint time, nor permit any execution, approval, or authorization aimed at withdrawing assets. On any chain other than the one where the token was minted, no call from anyone may be authorized. After burning, all constituents become movable, but only the address recorded by ERC-8423's burnedBy can move them. If the container is an ERC-6551 account, isValidSigner and isValidSignature must not return the magic value to anyone before burning, and must return it only to the address burnedBy points to after burning.
CompositionDeclared fires exactly once per token
The CompositionDeclared event must fire exactly once in the transaction that mints each token, including batch mints, and must carry the same account, accountType, accountData, and constituents that compositionOf and compositionAccountOf subsequently return for that tokenId. Since a contract cannot read its own past logs, this event provides the only authoritative point where an off-chain indexer can reconcile log replay with live call results.
Prohibits circular references and re-minting through a declared container
Tokens of the same contract cannot be transferred into or minted into any container that the contract has declared via CompositionDeclared (including its own container or another token's container). This prevents two tokens from ending up inside each other's containers in a cycle that can never be burned, but it does not prevent cycles that pass through accounts or other collections the contract has not declared. Also, once a tokenId has been burned it cannot be re-minted by the same contract. Because burnedBy only records the most recent burn, allowing re-minting would make the new minter the sole party able to open the previous container.
Both the container and the token contract must be non-upgradeable
If the container's logic is implemented through a proxy (including an ERC-6551 token bound account), its code must not be upgradeable and must not delegate to code that can later change. The same requirement applies to the token contract itself. If only the container is locked but the token contract is upgradeable, the address that burnedBy points to can be changed to open the container before the burn, so both pieces of code must be immutable for this standard's guarantee to hold. This proposal is currently in Draft status and has not been finalized; it may change or be abandoned.
Things to watch out for
- Verifies the code, not the intent: The two functions only point to the container and state the rules it must follow; they do not themselves prove that the code at that address actually obeys the lock rules. The reader must independently verify that both the container and token contract code can be trusted, and any container it cannot verify should be treated as unverified rather than assumed compliant.
- A contract accepting the signature must also check burn status: A contract that accepts the ERC-1271 signature produced by a token's container as authorization for some other purpose inherits the same lock. If it only queries isValidSignature without checking whether the token has been burned, it may end up accepting a signature from code that is mid-transition and does not yet enforce rule 6.
- The lower bound depends not only on the container but on the constituent asset itself: For assets such as rebasing tokens or freezable assets, where the issuer can reduce a balance without a transfer, even a container that perfectly follows the rules cannot guarantee the lower bound.
- If an intermediary performs the burn, the intermediary's address is recorded: If a contract holds and burns the token on someone else's behalf, burnedBy records that contract itself. If that contract has no path to release the asset again, the container's assets are effectively locked.
- Non-upgradeability must be checked at the level of reachable code, not the address: Even an address whose code never changes may be a proxy whose pointed-to implementation address can change. Verifying rule 10 requires following the proxy to confirm that the actual implementation is immutable; the fact that other parts of the same codebase have a legitimate upgrade mechanism does not mean every contract this standard relies on does.