Parachain Integration
A guide for parachain integraters.
Snowbridge V1 Protocol
Snowbridge V1 is a token bridge which supports ERC20 assets and Polkadot assets.
General Parachain Requirements
An HRMP channel must be set up between Asset Hub and your parachain.
Your parachain must use at least Polkadot-SDK version
stable2409
pallet-xcm
with at least XCMv4 (XCMv5 preferable).XCM
dryRun
runtime apis. Asset Hub ParachainXCM
feePayment
runtime apis. Asset Hub ParachainYour parachain must support a pallet which can register assets such as
orml-tokens
orpallet-xcm
. DOT must be registered with that pallet.Allow Asset Hub to be a reserve for DOT.
Accept DOT as payment for XCM execution.
Allow Asset Hub to be a reserve for bridged Assets. Hydration Parachain
ERC20 Token Bridge (ENA)
Register the ERC20 token contract with the Snowbridge Gateway. This process will automatically set the ERC20 on Asset Hub as well.
Your parachain must support a pallet which can register assets such as
orml-tokens
orpallet-xcm
. The ERC20 token must be registered with that pallet.You can reach out to the Snowbridge team on github to enable your token in our UI and SDK.
Polkadot Native Assets Token Bridge (PNA)
Your asset must first be registered on Asset Hub in the
ForeignAssets
Pallet.Your asset must be able to
Teleport
to Asset Hub.Once your asset can be sent successfully between Asset Hub and your chain you can then register the Asset on bridge hub via the
EthereumSystem
palletregisterToken
extrinsic.You can reach out to the Snowbridge team on github to enable your token in our UI and SDK.
Snowbridge V2 Protocol
Snowbridge V2 protocol improves upon V1 with better fee handling, batching of messages, unordered message delivery and the ability to execute contract/extrinsics via generalized message passing. It builds on the requirements for Snowbridge V1.
General
In order to pass messages arbitrary message calls between Ethereum you require the following to be set up.
Must use atleast Polkadot-SDK
stable2506
Support XCMv5 and have
pallet-xcm
set up.Support Ether as an asset. Your parachain must have a pallet that can store assets such as
orml-tokens
orpallet-assets
.Allow paying for execution with Ether.
Generalised Message Passing
Polkadot to Ethereum
The origin that sends messages will need to an Agent created on Ethereum to act on that origins behalf on Ethereum. An agent is simply a contract on Ethereum that is associated with an origin on the Polkadot side. Only messages from that origin can dispatch messages to the Agent. See more on agents.
Design your pallet or extrinsic carefully and choose the origin that will be used to dispatch to Ethereum.
Create an Agent with that origin on Bridge Hub.
Ethereum to Polkadot
All messages are routed through Asset Hub and your parachain will need to allow Asset Hub to alias origins from Ethereum.
Allow Asset Hub to alias origins. Example configuration: People System Chain
Allow system chains to alias accounts. Example configuration: People System Chain
Using assets other than ETH or DOT for fees
Asset Hub contains a builtin DEX and since all Snowbridge messages are router through Asset Hub, there is a chance to swap DOT or ETH for any other fee asset.
The Asset must be registered on Asset Hub.
There must be a pool created with enough liquidity to make fee prices stable.
There must be monitoring of the pool in place to make sure its not drained of liquidity.
Last updated