# Bridge Hub questions

**URL:** <https://forum.polkadot.network/t/bridge-hub-questions/2693>\
**Category:** Tech Talk\
**Tags:** xcm\
**Created:** [April 24, 2023, 12:47am UTC](https://forum.polkadot.network/t/bridge-hub-questions/2693 "2023-04-24T00:47:38Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![bkontur](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.polkadot.network/bkontur/32/1112_2.png) [@bkontur](https://forum.polkadot.network/u/bkontur)\
**Post date:** [April 25, 2023, 10:34am UTC](https://forum.polkadot.network/t/bridge-hub-questions/2693/5 "2023-04-25T10:34:37Z")

</div>

> [@xlc](#):
>
> What are the exact steps to bridge DOT from Statemint to Statemine?

We are running the whole setup on Rococo/Wococo, where we move (periodically) ROC from Rococo:Rockmine2 (statemine runtime) to Wococo:Wockmint (westmint runtime), so it is more close to the “bridge KSM from Statemine to Statemint”.

Initialize bridge itself (allow tracking Rococo/Wococo finality):

1. (BridgeHubRococo) initialize bridge - Rococo governance call `xcm::Transact` with [initialize](https://github.com/paritytech/cumulus/blob/6ffe4f31c5cadfec490be7f64f3faf6b2c40cea8/bridges/modules/grandpa/src/lib.rs#L256) call
2. (BridgeHubWococo) initialize bridge - Wococo governance call `xcm::Transact` with [initialize](https://github.com/paritytech/cumulus/blob/6ffe4f31c5cadfec490be7f64f3faf6b2c40cea8/bridges/modules/grandpa/src/lib.rs#L256) call

Steps to allow bridge transfer were:

1. (Rococo) `force_open_hrmp_channel(rockmine2_para_id, bridge_hub_rococo_para_id)` and back as governance call
2. (Statemine) add configuration to allow send assets to Wococo:Wockmint - Rococo governance call `xcm::Transact` with [add\_exporter\_config](https://github.com/paritytech/cumulus/blob/43ee62707d80b46a954a5742117b258b6996f3a2/parachains/pallets/bridge-transfer/src/lib.rs#L372) call
3. (Wococo) `force_open_hrmp_channel(wockmint_para_id, bridge_hub_wococo_para_id)` and back as governance call
4. (Wockmint) add configuration for trusted `UniversalOrigin/Alias` mapping - Wococo governance call `xcm::Transact` with [add\_universal\_alias](https://github.com/paritytech/cumulus/blob/43ee62707d80b46a954a5742117b258b6996f3a2/parachains/pallets/bridge-transfer/src/lib.rs#L464) call
5. (Wockmint) add configuration for trusted `reserve location` - Wococo governance call `xcm::Transact` with [add\_reserve\_location](https://github.com/paritytech/cumulus/blob/43ee62707d80b46a954a5742117b258b6996f3a2/parachains/pallets/bridge-transfer/src/lib.rs#L523) call
6. (Wockmint) create asset for `ROC` in `pallet_assets::ForeignAssets` instance - Wococo governance call `xcm::Transact` with `pallet_assets::force_create` call

(looks like too much configuration, but adding new stuff does not require runtime upgrade and governance can decide about everything )

> [@xlc](#):
>
> What’s the XCM going to look like?  
> What is the reserve chain for DOT on Statemine?

I am not sure what exactly “reserve chain for DOT on Statemine” means, but as it works now:

- user sends some of his ROCs from Rococo:Rockmine2 to Wococo:Wockmint account with new extrinsic [transfer\_asset\_via\_bridge](https://github.com/paritytech/cumulus/blob/43ee62707d80b46a954a5742117b258b6996f3a2/parachains/pallets/bridge-transfer/src/lib.rs#L304)
  - first, ROCs are moved to reserve account on Rococo:Rockmine2
    - it is still [open question](https://github.com/paritytech/cumulus/pull/2013#discussion_r1166707994) if reserve account will be sovereign account of local bridge hub parachain (in this case BridgeHubRococo) or sovereign account of target remote parachain (in this case Wococo:Wockmint), but probably it will be SA of target remote parachain and for that we need to finish this PR: [https://github.com/paritytech/polkadot/pull/7016](https://github.com/paritytech/polkadot/pull/7016)

  - second, reserved ROCs are sent with xcm over bridge as `ReserveAssetDeposited` instruction [here](https://github.com/paritytech/cumulus/blob/43ee62707d80b46a954a5742117b258b6996f3a2/parachains/pallets/bridge-transfer/src/lib.rs#L687-L693)
    - it is still [open for case](https://github.com/paritytech/cumulus/pull/2013#discussion_r1171077178) when we want to send back foreign assets (we should not do reserve but burn instead from reserve account)

- so, here is XCM with `ReserveAssetDeposited` which will come to the local bridge hub (BridgeHubRococo) (captured from logs):

```rust
Xcm([
   "UnpaidExecution"{
      "weight_limit":"Unlimited",
      "check_origin":"None"
   },
   "ExportMessage"{
      "network":"Wococo",
      "destination":X1(Parachain(1000)),
      "xcm":"Xcm("[
         "WithdrawAsset(MultiAssets("[
            "MultiAsset"{
               "id":"Concrete(MultiLocation"{
                  "parents":1,
                  "interior":"Here"
               }")",
               "fun":Fungible(50000000000)
            }
         ]"))",
         "BuyExecution"{
            "fees":"MultiAsset"{
               "id":"Concrete(MultiLocation"{
                  "parents":1,
                  "interior":"Here"
               }")",
               "fun":Fungible(50000000000)
            },
            "weight_limit":"Unlimited"
         },
         "ReserveAssetDeposited(MultiAssets("[
            "MultiAsset"{
               "id":"Concrete(MultiLocation"{
                  "parents":2,
                  "interior":X1(GlobalConsensus(Kusama))
               }")",
               "fun":Fungible(100000000)
            }
         ]"))",
         "ClearOrigin",
         "DepositAsset"{
            "assets":"Definite(MultiAssets("[
               "MultiAsset"{
                  "id":"Concrete(MultiLocation"{
                     "parents":2,
                     "interior":X1(GlobalConsensus(Kusama))
                  }")",
                  "fun":Fungible(100000000)
               }
            ]"))",
            "beneficiary":"MultiLocation"{
               "parents":0,
               "interior":X1(AccountId32{
                  "network":"None",
                  "id":[212,53,147,199,21,253,211,28,97,20,26,189,4,169,159,214,130,44,133,88,133,76,205,227,154,86,132,231,165,109,162,125]
               }")"
            }
         }
      ]")"
   }
])

```

- realyer relays xcm from BridgeHubRococo to BridgeHubWococo
- BridgeHubWococo routes xcm over hrmp to the Wococo:Wockmint
- Wococo:Wockmint’s XcmExecutor is configured (by governance) with trusted `UniversalOrigin/Alias` and `reserve location`
  - so it executes/dispatches xcm bellow
  - buy execution is paid from SA of source parachain (in this case Rococo:Rockmine2) and SA is calculated with [https://github.com/paritytech/polkadot/pull/7016](https://github.com/paritytech/polkadot/pull/7016)

```rust
Xcm([
   UniversalOrigin("GlobalConsensus(Rococo))",
   DescendOrigin(X1(Parachain(1000))),
   "WithdrawAsset(MultiAssets("[
      "MultiAsset"{
         "id":"Concrete(MultiLocation"{
            "parents":1,
            "interior":"Here"
         }")",
         "fun":Fungible(50000000000)
      }
   ]"))",
   "BuyExecution"{
      "fees":"MultiAsset"{
         "id":"Concrete(MultiLocation"{
            "parents":1,
            "interior":"Here"
         }")",
         "fun":Fungible(50000000000)
      },
      "weight_limit":"Unlimited"
   },
   "ReserveAssetDeposited(MultiAssets("[
      "MultiAsset"{
         "id":"Concrete(MultiLocation"{
            "parents":2,
            "interior":X1(GlobalConsensus(Kusama))
         }")",
         "fun":Fungible(100000000)
      }
   ]"))",
   "ClearOrigin",
   "DepositAsset"{
      "assets":"Definite(MultiAssets("[
         "MultiAsset"{
            "id":"Concrete(MultiLocation"{
               "parents":2,
               "interior":X1(GlobalConsensus(Kusama))
            }")",
            "fun":Fungible(100000000)
         }
      ]"))",
      "beneficiary":"MultiLocation"{
         "parents":0,
         "interior":X1(AccountId32{
            "network":"None",
            "id":[212,53,147,199,21,253,211,28,97,20,26,189,4,169,159,214,130,44,133,88,133,76,205,227,154,86,132,231,165,109,162,125]
         }")"
      }
   }
])

```

- result is that user received ROCs on Wococo:Wockmint in `pallet_assets::ForeignAssets` instance with assetId: `MultiLocation { parents: 2, X1(GlobalConsensus(Kusama)) }` _Note: Kusama is here because statemine runtime has hard-coded NetworkId as Kusama and we dont have rockmine copy of statemine with Rococo NetworkId_

@xlc hope, this answers also to your [comment](https://github.com/paritytech/cumulus/pull/2013#issuecomment-1516037941), we actually dont have any high level spec, we have several (now not up-to-date) hackmds based on which this [PR](https://github.com/paritytech/cumulus/pull/2013) is done, so we could consider this post as a latest up-to-date high level spec

---

_[View the full topic](https://forum.polkadot.network/t/bridge-hub-questions/2693)._
