ERC-4950 Entangled token (Entangled Tokens)
Stagnant · NFTs & multi-token · created 2022-03-28
A standard that allows exactly two ERC-721 NFTs to be issued as a pair at contract deployment, and creates a smart contract wallet jointly managed by the owners of those two tokens.
Why it is needed
A typical NFT is issued as a single item, with authority belonging only to a single owner. As a result, there is no separate way for an artist to prove continued connection to their own work NFT, or for a buyer to verify the artist's authenticity. There is also no standard that lets a single NFT be used like a wallet shared by two people, jointly managing assets such as ERC-20 tokens held within it. Without this functionality, a custom contract has to be newly designed every time for use cases requiring two parties to prove each other, such as proof of creation, royalty distribution, authenticity verification, and identity linking.
What to implement
function tokenTransfer(IERC20 token, address recipient, uint256 amount) public onlyOwners;: A function called by a holder of either of the two tokens to transfer the ERC-20 tokens held by the contract to a specified address.modifier onlyOwners() {: A modifier that checks whether msg.sender holds either of the two tokens (via balanceOf) and allows the function to execute only in that case.function _mint(address to, uint256 tokenId) internal virtual override {: An internal minting function that blocks further issuance once two tokens have already been minted (_minted is true), enforcing that exactly two tokens exist per contract.
In depth
Exactly two tokens are issued
The entangled token contract implements ERC-721 as-is, with the added constraint that only tokenId 0 and tokenId 1 are minted at contract deployment. In the reference implementation, the constructor directly _mints the two tokens and sets the _minted flag to true, then overrides the _mint function itself so that if _minted is already true, a require statement blocks further minting. This ensures the NFT collection always consists of exactly two tokens.
The contract itself is a smart contract wallet
The entangled token contract doubles as a smart contract wallet alongside its ERC-721 token issuance function. This wallet can hold various kinds of tokens and can also become the owner of other NFTs. Since the owners of the two tokens (tokenId 0, 1) have authority to jointly operate this wallet, buying or selling the NFT itself amounts to buying or selling access rights to that wallet.
Moving ERC-20 assets via tokenTransfer
To withdraw and use the ERC-20 tokens held by the contract, call the tokenTransfer(IERC20 token, address recipient, uint256 amount) function. It carries the onlyOwners modifier, so it can only be called by an address for which balanceOf(msg.sender) > 0 holds for either token. Internally, it simply calls transfer(recipient, amount) on the received ERC-20 token contract to send it to the specified address.
Why ERC-721 was chosen
The standard's author states that while it could have been implemented with ERC-1155, ERC-721 was extended instead for compatibility with currently operating NFT marketplaces. As a result, entangled tokens can be listed and traded as-is on general marketplaces, and the buyer immediately gains, upon the transaction, access to the assets (both fungible and non-fungible) of the wallet linked to that token.
Proposed use cases
The Motivation section lists seven use cases for Entangled Tokens: proof of NFT creator, royalty distribution to creators, verifying authenticity of a work (e.g., if there are 1,000 limited editions, only 1,000 pairs of entangled tokens exist), usowner (a structure where whoever consumes the work becomes a partial owner), redesigning ownership structures, proof of identity (treating only credentials entangled with oneself as relevant to oneself), and vreserver (value reserver). However, these are presented as use case ideas, and the specific implementation methods are not included in the specification.
Proposal status
This ERC is currently in Stagnant status, a proposal that is no longer being discussed or revised and has stalled. As such, its content may change or be withdrawn in the future.