[Referendum: 98] HydraDX Proposal Open/Accept HRMP channel and Register Asset xcHDX

TL:DR

This batched proposal is to Accept/Open an HRMP channel with HydraDX and Register Asset xcHDX

Summary

We propose to open a bi-directional channel between Moonbeam and HydraDX. Initially, the main use case will be to transfer GLMR between the two chains, but it can be further expanded to other use cases. The proposal also includes the HDX asset registration as xcHDX, with the following details:

  • Multilocation: { parents: 1, interior: { X2: [ {Parachain: 2034}, {GeneralIndex: 0 } ] }}
  • Decimals: 12
  • Name: HydraDX
  • Symbol: xcHDX

xcHDX will have the following asset ID and XC-20 address:

  • Asset ID: 69606720909260275826784788104880799692
  • XC-20 address: 0xffffffff345dc44ddae98df024eb494321e73fcc

On-Chain Proposal Reference

On-Chain Referendum 98 with the associated hash: 0x8847b851b0931b1c99b315875b61d4665562049d0771288ca59267dd38890a52

Technical details:

The procedure for opening the channels is as follows:

  • HydraDX: already proposed to open an HRMP channel to Moonbeam
  • Moonbeam: democracy batched proposal:
    • Accept HRMP channel from HydraDX to Moonbeam
    • Open Moonbeam to HydraDX HRMP channel
    • Register HDX asset as an XC-20
  • HydraDX: democracy proposal to accept Moonbeam to HydraDX HRMP channel

Once the HRMP channels are ready, XCM based cross-chain transfer will be possible. The extrinsics that need to be executed on the relay chain, are:

  • To accept the HRMP channel to Moonbeam: hrmp.hrmpAcceptOpenChannel(sender: 2034) , which hex-encoded call data is 0x3c01f2070000
  • To open the HRMP channel from Moonbeam: hrmp.hrmpInitOpenChannel(recipient: 2034), proposedMaxCapacity: 1000, proposedMaxMessageSize: 102400), which its hex-encoded call data is 0x3c00f2070000e803000000900100

The *proposedMaxCapacity *and proposedMaxMessageSize are set to the values of Polkadot configuration.activeConfig.hrmpChannelMaxCapacity and configuration.activeConfig.hrmpChannelMaxMessageSize values, respectively.

These extrinsics need to be called from the parachain’s sovereign account as origin, via a democracy proposal. The proposal will use polkadotXcm pallet to send XCM message to the Relay Chain with the following items:

  • Withdraw asset: take funds out of the Sovereign Account of the origin parachain (in the relay chain) to a holding state
  • Buy execution: buys execution time from the relay chain, to execute the XCM message
  • Transact: provides the call data to be executed
  • Deposit asset (optional): refunds the leftover funds after the execution. If this is not provided, no refunds will be carried out

The asset will be registered with the metadata described in the summary. The setAssetUnitsPerSecond was calculated using the value for HDX value on 2023-04-18, targeting a XCM transaction cost of 0.02$.

If you are interested, the hex-encoded call data for this proposal on Moonbeam is:

0x1e020c670003010003100004000000000700e40b540213000000000700e40b540200060002286bee02000400183c01f20700000d0102040001010070617261d4070000000000000000000000000000000000000000000000000000670003010003100004000000000700e40b540213000000000700e40b540200060002286bee02000400383c00f2070000e8030000009001000d0102040001010070617261d40700000000000000000000000000000000000000000000000000001e0208690000010200c91f05001c487964726144581478634844580c000100000000000000000000000000000001690100010200c91f0500d4d6c05a887d0300000000000000000016000000

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

3 Likes

@AlbertoV19 can you check all the tech details?

1 Like

Hey @jgreen thanks for putting this together.

I think your UnitsPerSecond value is a bit low. According to the script which uses CoinGecko’s price feed it should be:

yarn calculate-units-per-second --a hydradx --d 12 --xwc 4000000000

Token Price is $0.00477595
The UnitsPerSecond needs to be set 1046912132664705

Also, please provide the [hexEncodedCallData]:

  • For HRMP accept is 0x3c01f2070000
  • For HRMP propose is 0x3c00f2070000e803000000900100

And put the [parachainId] to 2034.

Lastly, I calculated the Asset info and got the following:

yarn calculate-external-asset-info --a '{"parents": 1, "interior": { "X2": [{ "Parachain": 2034},{"GeneralIndex": "0"}]}}'

Storage Key 0x1da53b775b270400e7e61ed5cbc5a146ea70f53d5a3306ce02aaf97049cf181ad7dad8b621e0004db45ea5a8d26f84a4ffffffff345dc44ddae98df024eb494321e73fcc
Asset Address Precompile: 0xffffffff345dc44ddae98df024eb494321e73fcc
Asset ID is 69606720909260275826784788104880799692

Thank you @AlbertoV19, amended.

1 Like

Brought the proposal on chain and edited the polkassembly:

3 Likes

Link to the on-chain voting:
https://moonbeam.polkassembly.network/referendum/93

FYI - This proposal was going to fail with RT2302 being expedited.

Therefore @dev0_sik is pushing another proposal but with the same end result.

The new proposal has the following encoded call data:

0x1e020c6b0901f2070000010301000100e40b5402000000000000000000000002286bee02000400010700f2052a01020008006b0900f2070000e803000000900100010301000100e40b5402000000000000000000000002286bee02000400010700f2052a01020008001e020c690000010200c91f05001c487964726144581478634844580c000100000000000000000000000000000001690100010200c91f0500d4d6c05a887d030000000000000000001600000000040411011da53b775b270400e7e61ed5cbc5a146ea70f53d5a3306ce02aaf97049cf181ad7dad8b621e0004db45ea5a8d26f84a4ffffffff345dc44ddae98df024eb494321e73fcc181460006000fd

And the following hash:

0x2a24d475c43e773bb0bd84efdf08d7406cab4bf5589bd5cc45ce32bc793b6555

1 Like

Exactly what she said :point_up_2:

2 Likes

Just FYI - The Council and Technical Committee has decided to fast track this proposal as Referendum 95 will fail on enactment due to an error in XCM Transactor when translating from XCM V3 to XCM V2 (as Polkadot is in XCM V2).

The new fast-tracked proposal is Proposal 98. Voting period was set for 3 days and instant enacment.

I’ve changed the Title and Text of the mentioned proposal to reflect the new changes

3 Likes

Jaja thanks, hopefully the 3rd is the winner

1 Like

Definitely support this channel opening / asset registration and hopefully enables growth for both Moonbeam and OG project HydraDX.