Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a demo xapp that allows bridging an asset like an NFT from Ethereum, Polygon, or Avalanche to Celo #941

Open
ericnakagawa opened this issue Jan 5, 2022 · 20 comments
Labels
design Architecture and design discussion Input requested documentation Improvements or additions to documentation solidity ♦️ Solidity dev work required testing Unit, integrations, and e2e testing xapp

Comments

@ericnakagawa
Copy link

ericnakagawa commented Jan 5, 2022

Cross chain applications (xapps) using Optics are a new way for moving assets between chains. We are looking for a live (testnet okay) example of this between one or more chains that Optics is running on to demonstrate the usefulness of this functionality.

Current xapp developer documentation can be found here. You may also review the token-bridge xapp docs here.

Review this video that walks through the concepts around xapp development.

This issue will be considered resolved once the following is completed:

  • There is a live example of a xapp deployed to testnet (Alfajores) or mainnet that allows bridging erc-721 and erc-1155 NFTs from Ethereum, Polygon, or Avalanche to Celo.
  • There is documentation:
    • explaining how the xapp works
    • design considerations and trade offs
  • At least one NFT has been bridged between Celo and two networks

The Gitcoin bounty will select multiple winners (up to 3) that fulfill the requirements listed above in the required time period. Up to three developers will be selected to submit solutions.

@ericnakagawa ericnakagawa added documentation Improvements or additions to documentation design Architecture and design solidity ♦️ Solidity dev work required testing Unit, integrations, and e2e testing discussion Input requested xapp labels Jan 5, 2022
@gitcoinbot
Copy link

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


This issue now has a funding of 2000.0 cUSD (2020.0 USD @ $1.01/cUSD) attached to it as part of the celo-org fund.

@alecj1240
Copy link

Hey Eric 👋 Quick question for you:
In the description it says, "The Gitcoin bounty will select multiple winners that fulfill the requirements listed above."
How many winners? What is the limit on the number of winning submissions that will receive the bounty? 3? 10? 20?

@gitcoinbot
Copy link

gitcoinbot commented Jan 14, 2022

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work has been started.

These users each claimed they can complete the work by 3 weeks, 1 day ago.
Please review their action plans below:

1) dhruvjain1122 has been approved to start work.

Flow of NFT:-

  1. User send it's NFT to the BridgeRouter of source
  2. BridgeRouter Source hold the NFT ,sends enqueue this message to the Home which sends this to BridgeRouter Destination
  3. BridgeRouter Destination mint verifies and mint new NFT in the Destination chain which is then send to the user.
  4. To retrieve it's NFT at source User can just send this NFT back to the BridgeRouter which burn this and unlock the NFT at source
    2) marcopereira27 has applied to start work (Funders only: approve worker | reject worker).

I'm going to implement a solution to bridge NFT assets between Celo and Polygon.

[ ] BridgeRouter contract implemented on the local domain.
[ ] BridgeRouter contract implemented on the remote domain.
[ ] Contract on local domain can lock NFT's and send messages to contract on remote domain.
[ ] Contract on remote domain is able to authenticate the sender as a valid remote counterpart.
[ ] Contract on remote domain can receive and decode messages and mint NFT's.
[ ] To bridge an NFT back to the local domain, the remote contract is able to burn the NFT and send a message to the local contract, by which turn will unlock the NFT.
3) lucasespinosa28 has been approved to start work.

I read the documentation about Xapp and it does not look hard to create a bridge between eth and Celo for NFTs.

backend: a bridge contract to deposit the NFT on chain A or B, another contract to detect if some NFT was deposited and mint ou burn the NFT
frontend in react to let everyone build your own bridge easy cloning the project
4) kostassagma has applied to start work (Funders only: approve worker | reject worker).

I will create a xapp where the user will be able to:
• Send their nft to a smart contract on ethereum, which "freezes" the nft.
• Receive a just minted nft, which represents the frozen one, on the celo network at the address specified when depositing the nft
• Burn the nft in the celo network and receive the original nft on ethereum
Im using react for frontend and will be using Goerli and Alfajores for ethereum and celo tesnets respectively.
5) zoek1 has been approved to start work.

  • deploy the corresponding contracts based on the examples of the optics monorepo
  • trigger and validate the assets' sending functionality
  • verify the reception of assets in test networks
    6) surroundingart64 has been approved to start work.

I have completed the contracts with tests. But I needed further information for which I had tagged you here.

Can you please reply there?

#941 (comment)
#941 (comment)
#941 (comment)

I also was able get the dispatch event in logs in Rinkeby: https://rinkeby.etherscan.io/tx/0xa802d5d2d80c0013416325f3e39bf60aab4da90198d3b8b8f4727c82656f884a#eventlog
7) maxx6262 has been approved to start work.

Solidity Smart Contract to

  • hold NFT sent into proxy wallet account
  • Extraction of all data and historical data from NFT
  • Mint ERC721 standard token on Celo chain
    Wrapping platform crosschain into ERC1155
    8) rowlanja has applied to start work (Funders only: approve worker | reject worker).

creating a cross chain nft dapp shouldnt take too long. sending nft from one platform where theyre locked. Then a duplicate nft is issued to the sender
9) danijel-enoch has applied to start work (Funders only: approve worker | reject worker).

I basically plan to create a NFT smart contract both ERC721/1155 in all the listed chains and then create an sdk that allows all of them to interact with each other. The Interaction involves locking or burning of the NFT in the contract on one chain and then transfer it to another.

Learn more on the Gitcoin Issue Details page.

@ericnakagawa
Copy link
Author

Hey Eric 👋 Quick question for you:

In the description it says, "The Gitcoin bounty will select multiple winners that fulfill the requirements listed above."

How many winners? What is the limit on the number of winning submissions that will receive the bounty? 3? 10? 20?

@alecj1240 It'LL be awarded to more than one and up to 3. I'm open to extending it if it makes sense, too.

What are you thinking?

@ericnakagawa
Copy link
Author

@dhruvjain1122 please ensure the steps are documented and included in the xapp example. With the bridging of an nft, what additional metadata would be included?

@amritkumarj
Copy link

@ericnakagawa I will keep that in mind, thanks for the advice

@amritkumarj
Copy link

amritkumarj commented Jan 15, 2022

@ericnakagawa How does the user pay for the NFT minting fees in another chain, in the source side if so how do we calculate the fees?

@amritkumarj
Copy link

@ericnakagawa could I get your telegram or discord id, I have some questions to ask

@amritkumarj
Copy link

@ericnakagawa Check this out!
optics nft transfer

@SurroundingArt64
Copy link

SurroundingArt64 commented Jan 16, 2022

Hi @ericnakagawa I have completed the contracts with tests. But, I had to create a separate repo as I couldn't understand how to add tests in the Monorepo.

Should I add you as a collaborator for the same?

Currently the Router supports ERC721 transfers.

@SurroundingArt64
Copy link

SurroundingArt64 commented Jan 16, 2022

I found the XAppConnectionManager for Rinkeby

Can you confirm if the above address is the latest one?

Also, please share the same for following:

Celos Alfajores TestNet
Polygon Mumbai Testnet

@ericnakagawa

I guess I should be able to fetch domain from them but they would be helpful as well.

@SurroundingArt64
Copy link

I also was able get the dispatch event in logs in Rinkeby: https://rinkeby.etherscan.io/tx/0xa802d5d2d80c0013416325f3e39bf60aab4da90198d3b8b8f4727c82656f884a#eventlog

How can I track it on Remote? Any suggestions? @ericnakagawa

@SurroundingArt64
Copy link

From what I understand no Updates have been pushed to Replicas in past 3 to 4 months on Alfajores, Kovan and Rinkeby.

How can I test my XApp @ericnakagawa

@SurroundingArt64
Copy link

SurroundingArt64 commented Jan 24, 2022

@ericnakagawa @gitcoinbot

Successfully bridged NFT from PolygonMumbai to Alfajores network. Had to deploy my own Homes and Replicas.

Relevant transactions:
Send on Mumbai (1000): Call made to the ERC721Router

Transfers token id 1 of native NFT

You can see the dispatch event from home. Decode data:

{
    messageHash: '0x05e97104a73dcbd76e8178483e6f5d209675ff9a7e254b7e334822fc245841ea',
    leafIndex: 0,
    committedRoot: '0x0000000000000000000000000000000000000000000000000000000000000000',
    message: '0x000003e80000000000000000000000009365a6d7c89da1b6f22913aad65f000bb0f55dc900000000000007d00000000000000000000000009365a6d7c89da1b6f22913aad65f000bb0f55dc9000000000000000000000000379a056cb617ede30c56afb54e2f31850580676000000000000000000000000000000000000000000000000000000000000003e800000000000000000000000000000000000000000000000000000000000007d0000000000000000000000000379a056cb617ede30c56afb54e2f318505806760000000000000000000000000fc77079c043b39a64ee9fa70863f25c9a0381d0800000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001'
}

Update on Alfajores(200): Call made to Replica.

Transaction

Prove on Alfajores(2000): Call made to Replica.

Transaction

Process on Alfajores(2000): Call made to Replica which calls to Router which mints the non-native NFT.

Transaction

@SurroundingArt64
Copy link

Setting up backend support for updates, prove and process for custom deployed Replica and Home.

@ericnakagawa

@ericnakagawa
Copy link
Author

@SurroundingArt64 @dhruvjain1122 I can be contacted on Discord at ericnakagawa#0001 and Telegram at @ericnakagawa -- let's connect to review your progress!

@SurroundingArt64
Copy link

HI @ericnakagawa Will connect on discord.

@SurroundingArt64
Copy link

Hi guys. Is this still open? I am having trouble with connecting with you guys.

@gitcoinbot
Copy link

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work for 2000.0 cUSD (1990.92 USD @ $1.0/cUSD) has been submitted by:

  1. @surroundingart64

@ericnakagawa please take a look at the submitted work:


@SurroundingArt64
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design Architecture and design discussion Input requested documentation Improvements or additions to documentation solidity ♦️ Solidity dev work required testing Unit, integrations, and e2e testing xapp
Projects
None yet
Development

No branches or pull requests

7 participants
@ericnakagawa @alecj1240 @gitcoinbot @amritkumarj @SurroundingArt64 and others