POC on how a multichain delegation work focused on the soft usage of NFTS
The primary motivation is to leverage each blockchain storage by allowing users to log in with an account at any dApp and see all the NFTs owned in different blockchains. It uses soft delegation, meaning you need to be connected to only one blockchain. E.g., If my FLOW address: 0xNachoFlow has 10 NFTs, I can set a delegation to my Ethereum address: 0xNachoEVM. Therefore, I can join Metaverses like Decentraland, Marketplaces like OpenSea, etc., using 0xNachoEVM and see EVM NFTs and the 10 NFTs owned in the FLOW blockchain by 0xNachoFlow.
The POC is using @ethereum and @flow, but it can be any. The (ugly) UI to play is identity-nachomazzara.vercel.app. Transactions in Flow using @blocto are free, and for Ethereum, you need to be connected to Goerli, but the NFTs will be fetched from OpenSea API, so it will retrieve NFTs from every EVM blockchain supported there. To fully use it, you may need to have NFTs in Flow and Ethereum. After delegating to the desired address, you can then connect with that delegated address and see all the NFTs displayed together. For example, if you want to connect with Ethereum and see your NFTs from it and Flow, you will need to do first:
- Connect with Flow.
- Set a delegation to your EVM address (transaction needed).
- The next time you connect to Ethereum, you will see the NFTs from Ethereum and Flow.
For example, if you want to connect with Flow and see your NFTs from it and Ethereum, you will need to do first:
- Connect with Ethereum.
- Set a delegation to your FLow address (transaction needed).
- The next time you connect to Flow, you will see the NFTs from Flow and Ethereum.
To make it work, dApps may know in advance each contract address (fixed address, one per blockchain) and consume delegation lookups. A delegation lookup is called when you find which addresses from other blockchains have been added to the blockchain where you must fetch the NFTs.
After the delegation is set, you only need to be connected to one chain to see all the NFTS delegated to you.
Try it: https://identity-nachomazzara.vercel.app/
blockchain_0
,blockchain_1
,blockchain_2
, andblockchain_n
are blockchain with different account protocol.user1.b_0
,user1.b_1
,user1.b_2
, anduser1.b_n
are valid blockchain 0, 1, 2, and n accounts.Identity_EVM_SC
,Identity_Flow_SC
,Identity_Blockchain_1_SC
,Identity_Blockchain_2_SC
, andIdentity_Blockchain_n_SC
are the Identity smart contract deployed on each blockchain.user1.eth
is a valid Ethereum account.user1.flow
is a valid Flow account.
Delegate the usage of your Blockchain_0 NFTs to other Blockchain accounts
Fetch delegated NFTs.
- Delegate the usage of your EVM NFTs to user1.flow
- Fetch NFTs from user1.flow and EVM accounts by only being connected to Flow.
- Delegate the usage of your Flow NFTs to user1.eth
- Fetch NFTs from user1.eth and Flow accounts by only being connected to EVM.
- Only working for EVM chains and Flow. For EVM chains, only Ethereum Goerli can be used to set up delegations.
- Contracts are not battle tested and may have vulnerabilities. DO NOT USE IT for production.
- TRON, SOLANA, CARDANO, etc., can be easily added. This is just a proof of concept.
Simple create react-app + lambda with vercel:
# Instal
npm ci
npm i -g vercel
# Run
vercel dev