Discover more from CR3 Labs
What are Token Bound Accounts?
A deep dive into the new EIP-6551 standard.
EIP-6551 is an Ethereum improvement proposal created by the Future Primitive team in collaboration with many contributing developers. The standard proposes a method for adding smart contract accounts to every ERC-721 NFT. These accounts are referred to as Token Bound Accounts.
We believe this proposal will be one of the most impactful innovations in Web3 for a number of reasons:
It enables every ERC-721 NFT to own/hold an arbitrary amount of any other token (ERC-20, 721, 1155, etc.).
It doesn’t require any changes to existing NFTs or any new NFT contracts to be deployed.
It “automagically” adds these accounts to all existing NFTs without the NFT owner needing to perform any transactions (more on this later).
It is practically infinitely extensible.
It already supports Account Abstraction (ERC-4337) – read more about Account Abstraction in our previous post.
It enables new “stateful” use cases for NFTs, including “sci-fi like” concepts such as autonomous on-chain AI agents (more on this later).
It's a major step in the evolution of NFTs taking them from simple PFPs to Tokenized Avatars.
How does it work?
Token Bound Accounts (TBAs) are added to Ethereum via a registry contract that manages the deployment of each account. Every account uses a Proxy (ERC-1167) and an implementation Smart Contract.
The account Smart Contract is relatively simple, apart from a few administrative functions including permission management, a time lock, and nonce management, an account has one primary function
executeCall. This function is able to execute any function on any contract. For example,
transferFrom(from, to, tokenId) for an ERC721.
executeCall can only be called by the owner of the NFT that the account is attached to or addresses permissioned by the owner.
Due to the manner in which addresses are generated for new NFT accounts, the account can exist before it is actually deployed (”initialized”). This is because NFT account addresses are derived from properties which are already known including the Account implementation address, the NFT contract address, NFT token ID, and a salt. These accounts come enabled with deposit capabilities by default, however, in order to enable withdrawals from an account, a transaction must be submitted to initialize the account. Fortunately, this transaction can be performed by any external account and has a fairly low gas cost.
Downsides, Risks, and Mitigation
The following outlines some downsides/risks to Token Bound Accounts and the ways in which these risks are addressed.
1) Gas Costs
Thinking about composable NFTs, the first thought that comes to mind is the inherent added gas costs. Many previous attempts at composable NFTs (e.g. ERC-998) introduced additional gas costs to create NFTs with relationships to other NFTs.
For end-users, EIP-6551 mitigates added gas fees by treating composability the same as any other account. e.g. to “bind” an NFT to another, it costs the same as a typical token transfer.
For developers, gas costs are reduced by making use of the ERC-1167 minimal proxy pattern. This approach enables inexpensive deployment of clone contracts instead of deploying NFT contracts multiple times, which would require significant gas.
2) Delegated Permissions
The default permission capabilities within TBAs is to require all actions to be performed by the owner of the associated accounts parent NFT. There are often times that it’s critical to be able to delegate the management of specific NFTs or accounts to alternate wallets.
To account for this scenario, TBAs allow permissions to be set by the primary owner of the NFT to enable any address to manage the TBA on the primary owners behalf.
Another common use case, especially within communities with high-value NFTs such as Bored Apes, is the use of wallet delegation services like Delegate.cash and Warm.xyz. Our team created a TBA delegate extension to allow delegated hot wallets to manage an NFT’s TBA on behalf of a cold wallet.
3) Front Running
One of the main issues that occurs when NFTs become stateful (have relationships or ownership over other assets) is the risk of these assets being “front run” before a transfer occurs. This can occur due to Maximal Extractable Value (MEV) .
Example: As an owner of an NFT with a bound account, I could deposit several high-value NFTs into the NFTs account. I could then list my NFT for sale at a price equivalent to the NFT + all of the assets in its account. Once the NFT sale occurs, I can submit a transaction to withdraw all of the NFTs with a premium gas fee. Due to MEV, my transaction could be included in the same block that the sale occurs. The end result is I received my payment for the original amount, however, the buyer receives the NFT with an empty account.
To mitigate this issue, a time lock has been included in the account Smart Contract implementation. This simple mechanism enables a marketplace to require a seller to “lock” the account for several blocks prior to a sale, there-by preventing “front-running” scenarios.
In addition, the Token Bound team is working directly with major marketplaces, such as OpenSea, to create safeguarding mechanisms to further help with issues such as pre-existing token approvals.
4) Malicious Implementations
Using proxy contracts to create accounts mitigates gas and enables “auto-magic” NFT accounts, however, it also introduces a somewhat less obvious risk. As an NFT owner, I have permission to update/replace the underlying implementation Smart Contract for my NFTs account. As a hacker, this could allow me to introduce a “back door” to my NFTs Account, with the ability to withdraw assets from an account even after I no longer own the associated NFT.
To mitigate this issue, the Token Bound team introduced an
AccountGuardian registry which contains an allow list of trusted implementation addresses. This registry is checked before an NFT’s Account implementation can be upgraded. Unfortunately, this introduces a small level of centralization to the upgradability of Token Bound Accounts. Ideally, this
AccountGuardian registry will eventually be managed by several impartial and trusted third-parties.
Exploring Use Cases
Okay, so Token Bound Accounts are technically cool but what can we actually do with them?
There are many use cases for Token Bound Accounts (TBAs), but the most prominent ones are:
Game avatar inventories
Composability is not a new concept in the NFT world, there have been many impressive composable NFTs and standards over the years. However, Token Bound Accounts change the composable NFT landscape due to one key differentiator–they do not require any changes to the existing ERC-721 standard.
Examples of composable NFT predecessors:
Developers can use TBAs to create NFTs that serve as building blocks for larger applications. For example, Staple Verse, one of the first projects to make use of TBAs, is building an entire ecosystem around their primary NFT, Sapienz. Sapienz are NFTs with TBAs that enable the display of clothing, gear, and achievements within the Staple Verse “Workshop”.
Another practical example of composability outside the realm of the current digital artwork/web3 space is in logistics and manufacturing. For a simple example, imagine a car NFT with its own account. The account holds records about insurance, registration, sales tax, manufacturing data, part recalls, and more.
Unlike previous composable NFT examples, TBAs can hold nearly an unlimited number of assets, similar to a standard externally owned account (EOA) and are nearly infinitely extensible making TBAs extremely impactful for NFT composability.
Another compelling use case for TBAs is in the realm of on-chain reputation systems.
Let's consider the scenario of a loyalty program implemented through NFTs. With TBAs, it becomes possible to track and record all the contributions made by individuals to a DAO, organization, or similar entities. By sending soul/token-bound NFTs to the wallet associated with a loyalty NFT, it allows for seamless tracking of loyalty-related activities.
For example, imagine you are a devoted fan of a musician. You acquire an NFT album from that artist. For each concert you attend, you are able to redeem a proof-of-attendance token that is deposited into the album NFT’s TBA. This mechanism not only enables on-chain tracking and verification of loyalty but also enhances the value of the original album NFT over time. The artist could then reward loyal fans who attend every concert by simply tracking the contents of the NFT’s account.
Thanks to TBAs, it also becomes feasible to airdrop NFTs to existing NFT holders without knowledge of their wallet addresses (think back to those automagic account addresses). This functionality opens up new possibilities for fostering brand loyalty and creating engaging experiences for users in a transparent and secure manner.
Our personal favorite use case for TBAs is game character inventories.
When playing a game, there is a significant distinction between the player and the avatar. Most players create numerous avatars with unique attributes, skills, achievements, in-game reputation, and more. TBAs enable every NFT to have its own character inventory and thus, its own agency that exists separate to the owners wallet (read our previous article on Avatar Centered Design).
Inventories for Existing PFPs
The CR3 Labs team recognized early-on that the current generation of NFT “PFPs” will ultimately evolve into game Avatars that become the center of the entire ecosystem. We call these evolved PFPs Tokenized Avatars. With the recent release of TBAs, the notion of Tokenized Avatars as game characters with inventories, a social presence, DEFI staking mechanisms, and more is beginning to surface. These avatars carry with them reputation, stats, achievements, and even provide access to IRL events.
As these assets evolve, it’s becoming increasingly important to have a central location to manage them.
Our upcoming product release, Other Page, enables character inventory management for all Yuga Labs assets, as well as future ally projects.
Having a central location to manage these assets is critical for several reasons:
Comprehensive NFT Profiles: Character profiles allow anyone to dive into the immersive world of Tokenized Avatars by showcasing their lore, licensing deals, game achievements, guild associations, and the collection of items they possess. This brings depth and context to NFTs like never before.
Seamless Ownership Transfer: When it's time to sell or transfer an NFT, Character profiles ensure a smooth transition. Every aspect of your NFT, including its associated in-game items and achievements, will seamlessly accompany it to its new owner or a different wallet without having to execute batch transfers of all associated items.
Enhanced Interoperability: Other Page harnesses the power of on-chain inventories to enable interoperability between games and provides a central location to define which items are equipped both visually and on-chain. Suppose you earned a specific set of gear in game "A" and want game "B" to recognize and equip it. With Other Page, you can effortlessly communicate your preferences across different gaming experiences, breaking down the barriers between virtual worlds.
Monetization: As Tokenized Avatars become ubiquitous, assets with significant IP, reputation, and equipped items will be sought after. This opens the door for new paradigms to license IP and even lend out access to individual slots within inventories.
View a live demo of a Tokenized Avatar:
“Stateful” NFTs with TBAs adds a new dimension of complexity to marketplaces. There are two primary challenges:
Price discovery: the current methods for price discovery rely on auction mechanics, rarity trait analysis, or simple floor price appraisal efforts. TBAs add a unique challenge when it comes to pricing assets not only based on the associated items in its account, but also the more ambiguous associated clout and reputation.
NFT immutability: Existing NFTs can only be managed by the original creator of the Smart Contract. In addition they are often intentionally immutable. This means that updating the visual display and metadata contextually based on the assets within the NFTs TBA is often not possible.
While the Token Bound team is working directly with marketplaces to promote support of NFTs with TBAs, it will likely take time for all marketplaces to adapt and the associated complexities to be resolved.
To overcome the second issue mentioned above, our team developed a novel approach to attaching new metadata to existing tokens through the use of our Token Bound Tokens. These assets can be used to add context and additional metadata, including updates to the
animation_url (a metadata property that can be rendered as a video or embedded website iframe) to display the contents of an NFTs TBA and other associated information directly inside marketplaces.
See it in action on OpenSea:
Autonomous AI NPCs
Web3 games, particularly massively multiplayer online games (MMOs), often suffer from what is known as the "empty world" problem. This refers to the lack of an engaging experience when there are few players logged-in due to limited player interactions and non-playable characters (NPCs) that lack depth and autonomy.
A potential solution to this problem lies in the combination of TBAs and artificial intelligence (AI). By integrating AI-powered autonomous NPCs with TBAs, the gaming experience is significantly enhanced. For instance, imagine encountering a shopkeeper NPC with a rich AI-driven backstory and an on-chain inventory, allowing you to purchase unique and valuable in-game items directly from the NPC. Each interaction with this NPC could morph its personality and affect the prices at which it offers items. Have a friendly interaction? Maybe the shopkeeper offers a discount the next time you visit.
The development of autonomous NPCs supported by AI and TBAs is not as far-fetched as it may appear, with many experiments already underway. The convergence of these technologies holds immense potential for creating immersive and engaging gaming worlds.
In addition to game NPCs, more generic “Virtual Beings” such as VTubers, AI Instagram and Twitter profiles all capable of earning their own income are also possible. In fact, according to Messari Research, “The global Vtuber (Virtual YouTuber) market alone was valued at USD $2.18 billion in 2022 and is expected to expand at a CAGR of 6.4% over the next seven years.”
If you're interested in exploring this concept further, we recommend reading a thought-provoking article on "Virtual Beings" by 1kx. The article delves into the topic extensively, providing valuable insights and analysis.
To ensure EIP-6551 becomes a finalized Ethereum standard (ERC-6551) you can contribute to the relevant discussions on the forum. Additionally, showing your support and advocating for its official passage as an ERC can help drive its implementation and adoption within the Web3 community.
Create your own NFT accounts and read the docs on the Token Bound site.
Check out and support the Sapienz project.
About CR3 Labs
CR3 Labs builds tooling for Web3 gaming to help creators, collectors, and gamers unlock value in the new digital frontier.