Snowbridge: Sepolia <> Rococo Walkthrough

We (Parity Success) tested the bridge to transfer wrapped Eth from Sepolia to Rococo and are sharing our experience / the steps we took in order for others to follow and try out the bridge ahead of mainnet.

Note that this is not the intended journey for the typical consumer user, but may help developers in terms of quickly ramping up on the bridge’s functionality.

For a regular user, you can try out the demo frontend here: https://snowbridge-ui.netlify.app/

Snowbridge docs: Rococo-Sepolia Token Transfers | Snowbridge

The process:

Step 1: Setup a test Ethereum wallet with Metamask


Step 2: Get some Sepolia-Eth.
There are many faucets that you can use in order to do so, however many of them require a small Eth balance, social verification, or device attestation in order to acquire Sepolia-Eth. Examples:

However, if you like me would like to acquire Sepolia-Eth without taking these steps there is another option, this is a POW faucet, I left it running for a while and got some Sepolia-Eth without needing to take these steps:

Just add your test Ethereum address setup in step 1 and start mining. In 2 hours you will have ~2 Sepolia-Eth. You won’t need that much and 30 min would likely be enough mining.

Once you are done mining, claim your Sepolia-Eth and you can move to the next step.


Step 3: Deposit ETH:
You will need WETH (ERC-20 Wrapped Ether) to be able to send it over the bridge.

UX:

  1. You should see the screen below.
    Parameters:
    a) Deposit:0.000000005
    (i.e. 0.000000005 Ether)

  2. Metamask will open once you click the write button:

  3. Click confirm

Congratulations, once the transaction finalises you now have 0.000000005 WETH.


Step 4: Approve Snowbridge as a spender for your WETH:
Next you are going to approve Snowbridge as the spender for the amount of WETH you want to send across the bridge. In this example: 0.000000005 Ether

  • Go to the WETH contract (you should still have it open): 0xfFf9976782d46CC05630D1f6eBAb18b2324d6B14
  • On the Contracts tab click on the Write Contract (shortcut to this step)
  • Wallet should still be connected, if not connect it.
  • Click approve dropdown.
  • Enter parameters.

UX:

  1. You should see the screen below.
    Parameters:
    a) guy (address):0x5b4909ce6ca82d2ce23bd46738953c7959e710cd
    (i.e. Snowbridge’s Gateway contract on Sepolia)
    b) wad (uint256): 5000000000
    (i.e. 0.000000005 Ether in this example)

If custom spending cap is correct click Next:

Approve the spend of 0.000000005 Ether:

Congratulations, have approved Snowbridge to send 0.000000005 WETH across the bridge.


Step 5: Create a test Polkadot account on Rococo (to recieve your WETH in future steps):

  • Ensure you have the Polkadot JS extension installed.
  • Go to dotapps: Polkadot/Substrate Portal
  • Create a new test account in the Polkadot JS extension.
  • Check the accounts tab to see it connected: Polkadot/Substrate Portal
  • You will need ROC tokens so go to the faucet and get some: https://faucet.polkadot.io/
  • Paste your new Polkadot account address in the faucet and confirm.
  • When you go back to the dotapps account tab you will see your account has 100 ROC.

UX:
Create an account with the extension, save youre mnemonic if you plan to use the account in the future.

Your account should appear here on the accounts tab of dotapps:

On the faucet paste your address as below and get some ROCs!

Your account should now be credited with 100ROCs thanks to the previous step.


Step 6: Creation of an Account on Asset Hub:

While you now have a Polkadot address, you need to activate it so to speak on AssetHub.

This is done by sending (teleporting) some of you the ROCs you just acquired to the same address on AssetHub.

This needs to be done before you can send your WETH to your Polkadot address!
Your account on assethub will need a minimum of 0.000033333333 ROCs for you to be able to recieve WETH, we will send a bit extra to conver fees.

  • Go to the dotapps extrinsic screen, and click on decode (shortcut)
  • Paste in the encoded call to send 0.0001 ROC to parachain 1000 (Asset Hub) which will cover the existential deposit and fees for the transfer.
  • Click on the Submission tab
  • Scroll down to: X1: XcmMV3Junction parameter and add the test Polakdot address you created.
  • Sign and submit to send the ROCs to this address on AssetHub.

UX:

Navigate to the Extrinsics:

Go to the Decode tab on the Extrinsics page:

Paste the encoded call. This one:
0x630b03000100a10f030001010000000000000000000000000000000000000000000000000000000000000000000304000000000284d7170000000000

Navigate to the Submission tab.

Ensure your account is selected or you wont be able to sign and submit:

Scroll down:

Add YOUR OWN address as the X1: XcmMV3Junction beneficiary parameter, in this case mine was: 5DSgBJUyMoKeSHABxTsAdmSopCe8Xx1GxhKyjfb5d66ozrTe:

Scroll down and submit the transaction:

Navigate to chain state page:

Select ‘system’ as selected state query and the account you want to query (the one you just sent ROCs to!), then click the Plus (+) button on the right hand side.

Notice tha providers = 1. This means you were successful.

If you see the following, providers = 0, go back and try again as something went wrong.

Assuming you successfully teleported your ROCs to AssetHub, you are now ready to send WETH over the Bridge!


Step 7: Checking the required fee to send WETH over the Bridge:

UX:

  1. You should see the quoteSendTokenFee screen below.
    Parameters:
    a) token (address) 0xfFf9976782d46CC05630D1f6eBAb18b2324d6B14
    (i.e. WETH contract address)
    b) destinationChain (uint32): 1000
    (i.e. AssetHub’s ParaID)
    c) destinationFee (uint128): 0
    (i.e. destinationFee is always 0 for transfers to Asset Hub.)

Click Query and uint256 : 500000000000 should be returned.
i.e. the fee unit Wei.

Congrats, youre ready to send WETH to AssetHub!


Step 8: Send WETH to Polkadot

UX:

  1. You should see the expanded SendToken dropdown on Contract Write as Proxy screen below.
    Parameters:
    a) Send token: 0.0000005
    (i.e. the bridge fee)
    b)token (address) 0xfFf9976782d46CC05630D1f6eBAb18b2324d6B14
    (i.e. WETH contract address)
    c) destinationChain (uint32): 1000
    (i.e. AssetHub’s ParaID)
    d) kind: 1
    (i.e. the type of address the destination chain accepts, AssetHub accepts kind AddressId32 (value = 1).)
    e) data: [your Polkadot address in HEX format]
    Either use subkey command subkey inspect [address] (installation guide) or convert your polakdot address to HEX format here: Substrate JS Utilities
    e.g. 5DSgBJUyMoKeSHABxTsAdmSopCe8Xx1GxhKyjfb5d66ozrTe (converts to) 0x3cfdfb31dfaf49d37a4af0b44c36cefcbef5c66d6a478766697d2f88674e826a

    f) destinationFee (uint128): 0
    (i.e. 0 for transfers to Asset Hub.)
    g) amount (uint128): 500000000000
    (i.e. amount you approved and want to send in Wei.)

Click Write & Confirm Transaction in Metamask

You can then see your transaction on Etherscan, but you will need to wait ~25-30 min for your WETH to be relayed to AssetHub.


Step 9: Check you received your WETH:

  • Go to the chainstate on dotapps
  • Select ‘foreign assets’


    UX:
    Parameters:
    • parents: u8: 2
    • interior: XcmV3Junctions: GlobalConsensus
    • XcmV3Junction: Ethereum
    • chainId: Compact: 11155111
      (i.e. Sepolia)
    • XcmV3Junction: AccounKey20
    • key: [u8;20]: 0xfFf9976782d46CC05630D1f6eBAb18b2324d6B14
      (i.e. WETH contract address)

Click Plus (+) button on top right corner, and you shoud see the following:

If you see a balance, the same as above, you have successfully depostied WETH on AssetHub!

13 Likes

Thanks for the resourceful post! Going forward, please consider adding such tutorials to the Polkadot Wiki GitHub - w3f/polkadot-wiki: The source of truth for Polkadot. and then linking them to the Polkadot forum posts.

This would help avoid duplication of work and also ensures the docs are maintained/updated later on. cheers!

For now, we will add this tutorial to the Bridge Hub Guides · Polkadot Wiki page

2 Likes

Cheers Radha, will do

1 Like