Open HRMP cross-chain communication between Kintsugi and Karura parachain

TL;DR

Similarly to the earlier Bifrost proposal, we propose to open hrmp communication between Kintsugi and Karura.

Summary

We propose to open a bi-directional channel between Kurara and Kintsugi. Initially, the main usecase will be to transfer KINT and KBTC tokens between the two chains (although note, KBTC minting is not yet enabled on Kintsugi).

Proposal

There is no on-chain proposal yet; #TBD.

Technical details:

The procedure for opening the channels is as follows:

  1. Request opening the channels
    a. Karura propose to request to open Karura to Kintsugi HRMP channel
    b. Kintsugi propose to request to open Kintsugi to Karura HRMP channel
  2. Wait until proposals on step 1 are approved & enacted
  3. Accept requests
    a. Karura propose to accept Kintsugi to Karura HRMP channel
    b. Kintsugi propose to accept Karura to Kintsugi HRMP channel
  4. Wait until proposals on step 3 are approved & enacted
  5. Wait for another session on Kusama for the change to be effective
  6. Crosschain transfer KINT and KBTC will be possible at this stage.

The extrinsics that need to be executed on the relay chain, are:

  • For step 1a: hrmp.hrmpInitOpenChannel(recipient: 2092, proposedMaxCapacity: 1000, proposedMaxMessageSize: 102400), which hex-encoded is 0x3c002c080000e803000000900100
  • For step 1b: hrmp.hrmpInitOpenChannel(recipient: 2000, proposedMaxCapacity: 1000, proposedMaxMessageSize: 102400), which hex-encoded is 0x3c00d0070000e803000000900100
  • For step 3a: hrmp.hrmpAcceptOpenChannel(sender: 2092), which hex-encoded is 0x3c012c080000
  • For step 3b: hrmp.hrmpAcceptOpenChannel(sender: 2000), which hex-encoded is 0x3c01d0070000

The proposedMaxCapacity and proposedMaxMessageSize are set to the values of Kusama’s configuration.activeConfig.hrmpChannelMaxCapacity and configuration.activeConfig.hrmpChannelMaxMessageSize values, respectively.

These extrinsics need to be called with the parachain’s sovereign account as origin. To achieve this, on the Kintsugi side we will execute the following extrinsic from the parachain, substituting relay-chain-encoded-hex-call and account-to-receive-leftover-assets appropriately. Karura should make similar calls.

ormlXcm.sendAsSovereign(
  dest: XcmVersionedMultiLocation
  {
    V1: {
      parents: 1
      interior: Here
    }
  }
  
  message: XcmVersionedXcm
  {
    V2: [
      {
        WithdrawAsset: [
          {
            id: {
              Concrete: {
                parents: 0
                interior: Here
              }
            }
            fun: {
              Fungible: 41,000,000,000
            }
          }
        ]
      }
      {
        BuyExecution: {
          fees: {
            id: {
              Concrete: {
                parents: 0
                interior: Here
              }
            }
            fun: {
              Fungible: 40,000,000,000
            }
          }
          weightLimit: Unlimited
        }
      }
      {
        Transact: {
          originType: Native
          requireWeightAtMost: 1,000,000,000
          call: {
            encoded: <relay-chain-encoded-hex-call>
          }
        }
      }
      {
        DepositAsset: {
          assets: {
            Wild: All
          }
          maxAssets: 1
          beneficiary: {
            parents: 0
            interior: {
              X1: {
                AccountId32: {
                  network: Any
                  id: <account-to-receive-leftover-assets>
                }
              }
            }
          }
        }
      }
    ]
  }
)

As a prerequisite, the parachain’s sovereign account must contain at least 10 KSM to be locked as collateral (5 for each channel direction), plus some KSM to pay for xcm execution fees.

7 Likes

Wow, exciting.
Look forward to it.

2 Likes

can’t wait to mint kusd with kbtc!

2 Likes

Vaammoosss my friends ! Can’t wait these HMRP channels to be completed… :heart_eyes:

Yes and when can we expect cross chain messaging for WASM on all these parachains such as sora?