Open HRMP channel between Basilisk and Karura

TL;DR

We propose to open HRMP communication between Basilisk and Karura. As Basilisk is still a PoA chain and has no governance in place yet, the request will have slightly different order than similar previous requests to simplify the process and will require only 1 action from Karura governance.

Summary

We propose to open a bi-directional channel between Karura and Basilisk. Initially, the main usecase will be to transfer BSX and aUSD between the two chains and bring some Karura assets to the coming Basilisk products such as LBP, XYK AMM or Liquidity Mining.

Proposal

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

Technical details:

The procedure for opening the channels is as follows:

  1. Basilisk initializes a request to open Basilisk to Karura HRMP channel [sudo]
  2. Karura proposes to accept Basilisk to Karura HRMP channel and open Karura to Basilisk HRMP channel [Batch call]
  3. Wait until proposal on step 2 get approved & enacted [Karura governance]
  4. Basilisk will accept Karura to Basilisk HRMP channel [sudo]
  5. Wait for another session on Kusama for the change to be effective
  6. XCM based crosschain transfer will be possible at this stage.

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

  • For step 1: hrmp.hrmpInitOpenChannel(recipient: 2000, proposedMaxCapacity: 1000, proposedMaxMessageSize: 102400) , which hex-encoded is 0x3c00d0070000e803000000900100
  • For step 2: first call is hrmp.hrmpAcceptOpenChannel(sender: 2090) , second call is hrmp.hrmpInitOpenChannel(recipient: 2090, proposedMaxCapacity: 1000, proposedMaxMessageSize: 102400) , the batch call hex-encoded is 0x1802083c012a0800003c002a080000e803000000900100
  • For step 4: 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 Basilisk side we will use polkadotXcm pallet to send xcm message to the relaychain, by executing the following extrinsic from the parachain. Karura should make a open request call and a accept request call with its pallet of choice.

polkadotXcm.send(
  dest: XcmVersionedMultiLocation
  {
    V1: {
      parents: 1
      interior: Here
    }
  }
  
  message: XcmVersionedXcm
  {
    V2: [
      {
        WithdrawAsset: [
          {
            id: {
              Concrete: {
                parents: 0
                interior: Here
              }
            }
            fun: {
              Fungible: 100000000000
            }
          }
        ]
      }
      {
        BuyExecution: {
          fees: {
            id: {
              Concrete: {
                parents: 0
                interior: Here
              }
            }
            fun: {
              Fungible: 100000000000
            }
          }
          weightLimit: Unlimited
        }
      }
      {
        Transact: {
          originType: Native
          requireWeightAtMost: 1000000000
          call: {
            encoded: 0x3c00d0070000e803000000900100
          }
        }
      }
      {
        RefundSurplus
      }
      {
        DepositAsset: {
          assets: {
            Wild: All
          }
          maxAssets: 1
          beneficiary: {
            parents: 0
            interior: {
              X1: {
                AccountId32: {
                  network: Any
                  id: 0x706172612a080000000000000000000000000000000000000000000000000000
                }
              }
            }
          }
        }
      }
    ]
  }
)

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.

2 Likes

Please note that this is the actual encoded batch call that should be called by Karura governance