ERC-6551

ERC-6551: Non-Fungible Token Bound Accounts 🔗

ERC-6551 proposes a standard for creating unique blockchain accounts for non-fungible tokens (NFTs). This allows each NFT to own assets and interact with applications, effectively turning them into smart contract wallets.

Key features of ERC-6551:

  • Each NFT can have its own account to hold assets and execute transactions

  • Enables NFTs to own other NFTs, creating complex ownership structures

  • Allows for the creation of "nested NFTs" and more complex digital asset management

Example of creating an account for an NFT:

interface IERC6551Registry {
    function createAccount(
        address implementation,
        uint256 chainId,
        address tokenContract,
        uint256 tokenId,
        uint256 salt,
        bytes calldata initData
    ) external returns (address);
}

contract NFTWallet {
    IERC6551Registry private registry;
    
    constructor(address _registry) {
        registry = IERC6551Registry(_registry);
    }
    
    function createAccountForNFT(
        address tokenContract,
        uint256 tokenId
    ) external returns (address) {
        return registry.createAccount(
            address(this),  // implementation
            block.chainid,  // chainId
            tokenContract,
            tokenId,
            0,  // salt
            ""  // initData
        );
    }
}

These ERCs represent significant advancements in Ethereum's capabilities, enabling more flexible and powerful smart contract interactions and asset management.

Last updated

Was this helpful?