header-langage
简体中文
繁體中文
English
Tiếng Việt
Scan to Download the APP
Partnered With:

Overview of ERC 6551: What new use cases will token-bound accounts bring to Lens?

Read this article in 5 Minutes
This article outlines the feasible use cases of ERC 6551 and explores its practical applications in on-chain identity management and membership management in conjunction with the Lens Protocol.

Editor's note:

ERC 6551 proposes the deployment of "Bound Account Tokens" (TBA), which are essentially ERC-721 tokens with Ethereum account functionality. This new standard aims to give NFTs full Ethereum smart contract account functionality, opening up endless possibilities for developers and users. Cryptocurrency researcher Naruto11.eth outlines the feasible use cases of ERC6551 and explores its practical applications in on-chain identity and membership management in conjunction with Lens Protocol.

Original author: Naruto11.eth
Original translation: Kaori, BlockBeats


I am a practitioner in the encryption industry. Please translate the following Chinese text into English without considering the context or industry-specific terms and names. Do not omit any English words or phrases, such as ZKS, STARK, SCROLL. If there are English characters in an a tag, do not translate them and return them directly. When the content only contains punctuation marks, return the punctuation marks as they are. Do not translate HTML tags in the content, such as

, , ,

, etc. If there are English characters in the HTML tags, omit the translation and return them directly. Please preserve the content in the a tag. Do not translate any Chinese characters. The content to be translated is:

I have been trying ERC 6551 recently and want to propose some use cases and projects. Today we will delve into what it is and what can be achieved through token-bound accounts.


ERC 6551 is a Token-Bound Account (TBA) for non-fungible tokens (NFTs), which essentially means that each of your ERC721 tokens can be converted into a wallet that can hold multiple ERC20, 721, and 1155 tokens. Essentially, your NFT becomes your wallet, allowing users to simulate Ethereum's ownership model with NFTs.


The important thing here is that this does not require any changes to existing NFT contracts, but is accomplished through a single registry that assigns a unique, deterministic smart contract account address to all existing and future NFTs.


First, let's take a look at some use cases:


Game Project


Assuming you have Charmander as your Pokemon (by the way, all great developers choose Charmander), now you have to battle Bulbasaur (Certik company - an inside joke). You won, so now the loser TBA will transfer ERC 20 to you. This means that every battle you win can be programmed into your game to earn points or capture your opponent's Pokemon characters. This is something I recently built and will be open-sourced soon.


Or you can have other roles, such as Captain America, and equip them with shield NFTs. By using TBA to equip shield NFTs as ERC 721 equipment, they can increase their defense and attack power, and hold a variety of different combat weapons in their accounts. All collected NFTs and weapons will be transferred to Captain America's TBA.


Quite good, right?


On-chain Identity Management


I once thought about integrating this idea with Lens, where everyone "collects" posts on Lens, but when you look at your wallet, it's filled with various tokens. Sometimes this is not a pleasant visual experience. Therefore, developers can change the interface so that every owner of .lens can convert it into a TBA, and all collected posts, artworks, or anything else will go directly into the .lens TBA. This is a good example of layered ownership management.


Member Management


For the membership status of the community, we have adopted a similar approach and stored it in the Lens Handle. This way, all information is centralized in one place, making it more convenient. Why is that? Let's say you have membership status in 20 communities on Lens. Now, if you move the Lens Handle to Wallet B, but your membership status is in Wallet A, transferring 20 membership statuses would be very troublesome. However, with TBA, you only need to move the Lens Handle, and all membership statuses will move with it.


Reputation System


You can transform your NFT into assets with independent identity and reputation, which may realize loyalty programs and direct airdrops to the wallet (imagine apecoin airdropped to your APE TBA based on its rarity). These are just some of the use cases, and these are some of my personal ideas. I believe many people can come up with great ideas, and I will continue to explore more use cases in the future. Now let's delve into some technical discussions based on EIP as a resource.


This overview is excerpted from "https://t.co/eVMeeVH7vS".


You can think of the registry as a single contract that will serve as the entry point for all TBAs. This contract:


-Create a TBA for an NFT based on the implementation address.

-Calculate the TBA address of this NFT.


The registry has a simple interface:


- Event [ERC6551AccountCreated] is used to emit an account creation event.

-Function [createAccount(implementation, salt, chainId, tokenContract, tokenId): returns the address of TBA.]

-Function [account(<SAME PARAMS>):Returns the calculated TBA address of a certain NFT.]


Account Interface:


We will be dealing with some fairly simple things. Directly quoted from the EIP:


- All TBA accounts should be created through the singleton registry.- All TBA implementations must implement the ERC165 interface detection and ERC1271 signature verification.


Account Interface:


-receive() External Payable Function.-token(): Returns the NFT identifier of the account that owns it.

-state(): Returns a value that should be modified when the account status changes.-isValidSigner(signer, context): returns the magicValue used for authorization.


Need to implement the Execution Interface to allow authorized signers to execute operations on behalf of the account.


IERC6551 executable contract contains the execute() function to support additional operations.


There are various resources that can help you get started. I suggest first reading EIP: "https://t.co/eVMeeVH7vS".


Then, you can refer to the tokenbound document: "https://t.co/ATxiEAcCHP".


Tokenbound has deployed registration and implementation contracts on multiple chains.


Registration address: 0x000000006551c19487814612e58FE06813775758


Tokenbound account implementation address: 0x41C8f39463A868d3A88af00cd0fe7102F30E44eC


TokenBound Labs also provides a software development kit (SDK) and open-source tools for reference. Using their SDK is very simple, and if you follow their implementation guidelines and SDK, you can quickly create decentralized applications (dApps) and integrate TBA.


Welcome to join the official BlockBeats community:

Telegram Subscription Group: https://t.me/theblockbeats

Telegram Discussion Group: https://t.me/BlockBeats_App

Official Twitter Account: https://twitter.com/BlockBeatsAsia

举报 Correction/Report
Choose Library
Add Library
Cancel
Finish
Add Library
Visible to myself only
Public
Save
Correction/Report
Submit