TOBA - Token Bound Accounts On Tron

Project Name: TOBA - Token Bound Accounts On Tron.
Project Track: Artistry
Team Name: TOBA team
Team Member(s): 2 @tobatrx
HackerEarth Project Link: TOBA - Token Bound Accounts On Tron | Devpost

:rocket: Project Goal: Bring for the first time to the TRON network a new way to interact with NFTs expanding its capabilities beyond simple static collectibles, allowing any TRC-721 asset to be a token-bound account.

:star: Project Value: The implementation of token-bound accounts opens up a wide range of possibilities for the advanced use of NFTs. These are some examples:

  • Games: By using token-bound accounts, game creators have the ability to set up inventories for players, enabling the automatic transfer of all their game items to their character’s collection. This enriches the player experience and facilitates the creation of game user interfaces that were previously more complex to develop. :video_game:

  • Portfolio Management: NFTs can represent unique investment assets, and these assets can be further diversified and managed within the NFT itself. This offers an innovative way for investors to manage their portfolios while maintaining a clear record of ownership and diversified holdings within a single NFT. :moneybag:

  • Music: One utility of NFT token-bound accounts in the music industry is the ability to provide exclusive access to music and other content for fans. For example, an artist could create NFTs that represent ownership of a specific song or album, and fans who purchase these NFTs could gain access to exclusive content such as unreleased tracks, behind-the-scenes footage, or virtual meet-and-greets with the artist. This could help artists connect more directly with their fans and create new revenue streams through the sale of these exclusive NFTs. :musical_note:

  • Additional security layers: The ability to manage individual wallets through an NFT, which in turn provides an additional level of security to a user’s main account (EOA) because the user can sign transactions through a TBA. For example: A user could execute transactions from a Token Bound Account to interact on untrusted sites and in case of any malicious action the consequences would only affect that account. :closed_lock_with_key:

:information_source: Project Info:

What is the TRC-721 standard?
The TRC-721 is a technical standard used for creating non-fungible tokens (NFTs) on the TRON blockchain. Just like the ERC-721 standard on Ethereum, the TRC-721 standard defines a set of rules and functionalities that NFTs must follow in order to be compatible with the TRON blockchain. :chains:

What is the ERC-6551 standard (Token-Bound Accounts)?
It’s a standard that allows NFTs to operate as smart contract wallets, these wallets are customizable and can be used to store assets & make transactions. Token-bound accounts also keep an unalterable record of all on-chain activities executed by the accounts. :receipt:

Token-bound accounts are also backward compatible with the TRC-721 standard, meaning existing NFTs can implement this standard without undergoing any fundamental changes, avoiding the unnecessary friction of deploying a new contract or wrapping an existing TRC-721 NFT to enable token-bound accounts.

How do Token-bound accounts work?
Token bound accounts (TBA) are smart contract wallets that are technically owned by an NFT in this case, but the control of token-bound accounts is delegated to the owner of that NFT. The owner, on behalf of the NFT, can initiate on-chain actions using the token bound account.

Token Bound Accounts are not spontaneously generated, they are created through the Registry contract. It keeps track of NFTs and their corresponding Token Bound Accounts. This registry is essentially a smart contract that can be deployed on any EVM-compatible blockchain. The two main functions of the registry are to compute a TBA address for the TRC-721 token and to deploy a TBA for an TRC-721 token with a given implementation address.

Each account is deployed via a minimal proxy contract which allows to get a gas optimized experience on the deploying phase and to store essential data, including the salt, chain ID, token contract address, and token ID into the bytecode. :id:

What will be the scope of this project for the HackaTRON?
For this hackathon we’ll be deploying, adjusting and testing all the required contracts for the implementation of the Token-bound Accounts (ERC-6551) on the Tron network, after that we’ll continue with the dApp frontend where users will be able to create the token-bound accounts for their NFTs and manage the assets inside them.

In the main page we’ll be also deploying a mini game to show the advantages of using the token-bound accounts in the field of web3 gaming. Here you could connect your TronLink wallet to get a profile NFT and as you accumulate more points while playing you will be able to earn special abilities for your character that are represented as NFTs too, with this users will have the opportunity to transfer full profiles between wallets or even send abilities to other profiles using the dApp.

Currently we are deploying and testing the contracts on the Nile testnet. :computer:

:desktop_computer: Project Website: https://www.tobaontron.xyz/
:open_book: Project Test Instructions:

To test you will need to have the TronLink wallet extension installed in your browser. Once you have the wallet you must be conected to the Nile testnet and get some TRX and USDT from this faucet TRON | NILE TESTNET, then go to https://tobaontron.xyz

In the landing you can press the button “try it with your NFTs” and that will take you to your wallet’s view (It will only show TRC721 assets). If you don’t have assets a button to mint some test NFTs will show, then after mint you will be able to generate token-bound accounts by accessing to the details of the token.

After the creation of the TBA you will be able to send tokens and collectibles into those accounts using the address that appears in the NFT details. You can transfer out the assets from the TBA using the transfer button at the right of each asset.

You will be able to access the mini game by clicking in the image on the bottom of the landing page and mint a game profile by clicking in the “Profile” button. Then you can play and collect power-ups for your character by getting high scores and those NFTs will be shown in the TBA view too.

:mag: Project Details:






:paperclip: Smart Contract links:

:movie_camera: YouTube Video
TOBA - TRON HACKATHON SEASON 6 - YouTube

:gem: Project Milestones:

  • :white_check_mark: Deploy, adjust and test the required contracts for the implementation of token-bound accounts on the Tron Virtual Machine (TVM)
    — Deploy Registry contract
    — Deploy Accounts implementation contract

  • :white_check_mark: Make the dApp frontend to create and manage the token-bound accounts
    — Show TRC721 assets from user wallet
    — Show all assets inside the TBAs
    — Deploy new TBAs with one button
    — Transfer TRX, TRC20 and TRC721 assets from the TBA

  • :white_check_mark: Generate a NFT(TRC-721) collection to easily test the dApp

  • :white_check_mark: Make the mini game and use NFTs with TBAs as game profiles

Pending

  • Rewrite our services script as a JS library for other devs to experiment with TBAs [08/05- 30/05]
  • Deploy the contracts and dApp to the mainnet after testing and feedback phases
    — Tron DAO Community testing and feedback [08/05- 30/05]
    — Review, implement and test feedback [30/05-07/06]
    — Mainnet deploy [10/06]
14 Likes

welcome team, love the concept. Keep building

6 Likes

Can you explain what you mean by this by explaining how your project plan to implement the management of assets within NFTs?

4 Likes

Welcome to Hackathon Season 6, nice offering you’ve here. From my read I can deduce, the TOBA project proposes to add Token Bound Accounts (TBAs) to the TRON network, expanding the usefulness of NFTs beyond simple souvenirs.
Can you provide additional information about the token-bound accounts’ technical design and how they interact with existing TRC-721 NFTs?

3 Likes

Welcome welcome welcome, can you please give more information of the technical aspects of the token bound accounts, thank you

1 Like

Hi Chukseucharia, thanks for your interest in the project. Let me start my answer with this short concept:

“Token-bound accounts (TBA) are smart contract wallets that are technically owned by an NFT in this case, but the control of token-bound accounts is delegated to the owner of that NFT. The owner, on behalf of the NFT, can initiate on-chain actions using the token-bound account.”

Now let’s say you’re accumulating tokens for this bull run, and your instinct as a crypto native is to do the same for some members of your family (mom, dad, sister). You have 3 NFTs inside your wallet (A, B and C), then for each one you create a token-bound account and transfer the assets to them depending on each family member.

With this, you will have 3 baskets of assets inside your wallet which you can manage or track performance separately, and if you want to move an entire basket to another wallet (like dad’s wallet), you can do it with just one transaction.

Hi manfred_jr, thanks for your interest in the project. Yes, the main goal of the token-bound accounts is to expand the utility of the NFTs beyond simple static assets.

Technically there are 3 main components in this architecture account implementations, TRC-721 tokens (NFTs) and the registry.

  • Account Implementation: This is the implementation for the smart contract wallets that will be storing the assets of the account. Here are defined the methods to execute on-chain actions dictated by the NFT owner, verify that the signer making the calls is indeed the owner’s address and provide details about which TRC-721 token is linked to the token-bound account.

  • TRC-721 tokens (NFTs): Those assets represent the ownership of the smart contract wallets they are linked to.

  • Registry: The registry serves as the single entry point of this system, it creates the token-bound accounts (using a minimal proxy contract to the account implementation) and links them to a TRC-721 token by generating a standardized contract bytecode that contains the info about the relationship between the smart contact wallet and the assigned NFT. This is also the component you have to query to get the token-bound account address associated with an NFT

For more technical information here you have the EIP-6551 reference for token-bound accounts: EIPs/EIPS/eip-6551.md at jw/erc6551_interface_update · jaydenwindle/EIPs · GitHub

1 Like

Hi ines_valerie, thanks for that welcome, I’ve commented some technical info and references in this response

2 Likes

waiting for your website to try it out.

With this your explanation, you move your entire portfolio by moving the token bound account (nft)?

Have you researched the market?
And what do you think about your competitors in the market, and what distinguishes you from them?

Welcome to Tron Hackathon season 6 team what are the plans made to ensure the security and integrity of these token-bound accounts on the TRON network?

1 Like

Welcome to hackathon season 6
There are some few questions I want to ask.

  • How will you ensure the security of the token-bound accounts (TBAs), and also will there be any additional security measures compared to a standard EOA (Externally Owned Account).

  • Since deploying TBAs involves a proxy contract, how will you optimize gas fees for deployment and transactions.

  • In what way will your dApp handle potential errors during TBA creation, asset management, or in the mini-game.

Short answer: Yes.
Long answer: Technically what you’re doing when you send the NFT to another wallet is to transfer the ownership of the TBA too, and in the practical sense you didn’t had to make X number of transactions to move all the assets

This is a relatively recent standard for EVM blockchains and this is the first time been implemented in the TVM so there are no previous references on the TRON network, that was part of the inspiration and motivation for our project. There are a few projects on the EVMs using this standard and the space for growth and disruption is still big.

Hi Andreaxino, thanks for your interest in the project.

On the blockchain side, we’re using the standard wallet implementation and its recommended version by the EIP-6551. On the frontend side, the code will be public and available to be audited.

Hi Okorie, thanks for your interest in the project.

  1. As I said in one of the past answers, the wallet implementation we’re using this the one recommended by the EIP-6551. On the other hand, the standard allows multiple wallet implementations to coexist, which makes it possible to keep deploying versions or alternatives with improved features.

  2. The CREATE2 opcode used for proxy contracts is one of the most expensive energy-wise in the TVM but when you compare it with the deployment of a minimal ERC-6551 account contract is just between 8-15% of that cost, that’s already a nice optimization. For transactions, the energy consumption is close to the ones made with an EOA.

  3. Revert opcodes were used in the contracts for those cases.

1 Like

Oh great so will all these tokens bounded to the nft shown in the new wallet transferred to? Or you still need to do something

3 Likes

Thank you for giving additional information about the project’s technical components. The architecture is clearly specified, with the account implementation, TRC-721 tokens, and registry all playing important roles in enabling token-bound accounts.

Concerning account implementation, ensuring the security and robustness of smart contract wallets will be critical. Have you performed any security audits or stress testing to ensure the viability of these contracts?

5 Likes

This is interesting. Can you explain to me how you plan to achieve this, like how it’s going to work. Both in creating a Token bound account and separating those assets within the NFT.

3 Likes

Thank you for providing plenty technical details, please tell us about any specific challenges that you have passed through in the Integration stage, thank you

2 Likes