You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implementation of the Snowbridge V2
[specification](https://github.com/paritytech/polkadot-sdk/blob/master/bridges/snowbridge/docs/v2.md).
Companion PR for changes on the Ethereum side:
Snowfork/snowbridge#1371
# High-level overview
The implementation of V2 is additive and does not affect the V1 protocol
in any manner.
## BridgeHub
* Adds pallet `snowbridge-pallet-inbound-queue-v2` which is responsible
for:
* Receiving and verifying messages from Ethereum
* Converting those messages to XCM
* Forwarding the XCMs to AssetHub
* Adds pallet `snowbridge-pallet-outbound-queue-v2` which is responsible
for:
* Receiving XCMs from AH or governance messages from
`snowbridge-pallet-system-v2`
* Converting those XCMs to messages that can be interpreted on Ethereum
(our Gateway contract specifically)
* Adds pallet `snowbridge-pallet-system-v2` which is the governance
controlplane for V2
* The primitives crates for V1 and V2 have been refactored and
consolidated:
* Added pallet `snowbridge-inbound-queue-primitives` with all primitives
for the inbound path for V1 and V2.
* Added pallet `snowbridge-outbound-queue-primitives` with all
primitives for the outbound path for V1 and V2.
Note that much of the code for the inbound-queue and outbound-queue
pallets is derived from the original V1 pallets.
## AssetHub
* Adds pallet `snowbridge-pallet-system-frontend`. This pallet acts as a
proxy for `snowbridge-pallet-system-v2` on BH, and allows any AH account
to interface with the V2 controlplane without having to interact with BH
in any manner.
## Supported messaging functionality
### Ethereum->Polkadot
* Users can transfer up to 8 ERC20 tokens, as well as native ether
* Users can provide an arbitrary xcm message
The assets will placed into holding on AH, and the user-supplied XCM is
responsible
for handling those assets in holding.
For reference, see the inbound message [format](
https://github.com/vgeddes/polkadot-sdk/blob/387c72546be38763a2d3c9b52c0f6cc1d8ac707e/bridges/snowbridge/primitives/inbound-queue/src/v2/message.rs#L101).
### Polkadot->Ethereum
Users can provide an XCM that includes:
* Transfers for up to 7 Polkadot-native or Ethereum-native assets
registered on AH.
* A single `Transact` instruction to call an Ethereum mainnet contract
These XCM instructions are converted to a batch of commands that are
executed on the Ethereum side. For reference, see the outbound message
[format](https://github.com/vgeddes/polkadot-sdk/blob/387c72546be38763a2d3c9b52c0f6cc1d8ac707e/bridges/snowbridge/primitives/outbound-queue/src/v2/message.rs#L122)
## Relayer Incentivization
BH holds wrapped ether that will be used to reward relayers for both the
inbound and outbound directions. When a reward is marked as claimable,
it can be minted on AH when the beneficiary desires to do so.
### Ethereum->Polkadot
Users supply an an arbitrary reward in ether on Ethereum. This is
included in the message sent to BH, where it added as a reward for the
relayer. The relayer can claim these rewards on AH at a later point
using the `pallet-bridge-relayers` API.
### Polkadot->Ethereum
Users supply an an arbitrary reward in wrapped ether using their funds
on AH. When the message is committed for delivery on BH, this reward is
tracked in `outbound_queue_v2::PendingOrders[MessageNonce]`
After a relayer has delivered the message to Ethereum and forwarded the
delivery receipt back to `outbound-queue-v2`, the reward will be
rendered claimable, and the relayer can claim these rewards on AH at a
later point using the `pallet-bridge-relayers` API.
---------
Signed-off-by: Adrian Catangiu <[email protected]>
Co-authored-by: claravanstaden <[email protected]>
Co-authored-by: ron <[email protected]>
Co-authored-by: Adrian Catangiu <[email protected]>
0 commit comments