Hello, another update on the progress of Snowbridge.
Deployment
-
We are now in the process of merging our pallets and support code into the upstream Polkadot-SDK monorepo. We are doing this using
git subtreeto avoid having to keep everything in sync using companion PRs. -
Once this done, we will publish our crates, and add our pallets to the BridgeHub runtimes in the
polkadot-fellows/runtimesrepo. The pallets will disabled in production until our ongoing re-audit is finalized.
BEEFY light client
We have improved the resilience of our light client against certain kinds of attacks by implementing a dynamic signature sampling algorithm devised by W3F.
The new algorithm essentially punishes malicious relayers by forcing them to submit more and more BEEFY signatures, at a greater cost to themselves.
Token Bridge
We have improved our Solidity API for sending ERC20 tokens to an arbitrary Polkadot parachain.
A user can call IGateway.quoteSendTokenFee to determine the fee in Ether they would need to pay for the transfer.
function quoteSendTokenFee(
address token,
ParaID destinationChain,
uint128 destinationFee
) external view returns (uint256);
A user can then call IGateway.sendToken to initiate the transfer.
function sendToken(
address token,
ParaID destinationChain,
MultiAddress calldata destinationAddress,
uint128 destinationFee,
uint128 amount
) external payable;
The user needs to specify the correct destinationFee (DOT), which is the XCM fee the destination chain would charge for processing the reserve-backed transfer from AssetHub. We envision that the UX layer would keep a table of fees for each parachain.
In the opposite direction, parachains can send tokens back to Ethereum by calling the xcm.reserveTransfer extrinsic on AssetHub, after doing a reserve transfer to AssetHub itself.
Fees & Rewards
In our latest architecture, on-chain conversions between Ether and DOT are performed using static exchange rates that need to be periodically updated by Polkadot governance.
While this will end up increasing pricing for users, it does have several notable benefits:
- Ensures the decentralized nature of the bridge, which centralized oracles such as Chainlink cannot provide.
- Reduced gas fees for Ethereum->Polkadot transfers, compared to other approaches which for example could involve paying for fees using wrapped DOT obtained from some DEX like Uniswap.
We assume that once AssetHub implements a DEX, we can consume a live price feed from it, subject to various checks and balances.
For more information about fees & rewards, see our docs.
XCM SetTopic As Message ID
To improve the traceability of bridge messages across the bridge, we are making use of the new SetTopic instruction.
For example, in the Polkadot->Ethereum direction, the xcm topic will logged on the Ethereum side, in the the messageID field of the InboundMessageDispatched event. Similarly, in the other direction, a topic will be included in the message sent to Polkadot.
Protocol Versioning
We have overhauled all our protocol-level data formats with support for versioning. This is important for ensuring that the bridge can be upgraded live without any downtime or potential data loss.
Ethereum Cancun-Deneb Upgrade
The Ethereum beacon and execution chains will be upgraded sometime in Q1 2024.
We have completed the necessary modifications to our ethereum light client in https://github.com/Snowfork/snowbridge/pull/981.
Audits
-
Our BEEFY light client has completed a re-audit and is now considered production ready.
-
There is an ongoing re-audit for the rest of our codebase, covering the following issues discovered in the the initial audit, as well as subsequent improvements:
- Our usage of the FRAME
MessageQueuepallet for buffering outbound messages to Ethereum. - Ensuring governance commands are always processed with a higher priority than other commands.
- Incomplete code and outstanding TODOs, especially around the fee/rewards mechanism
- Improved API on Ethereum for sending tokens across the bridge
- Our usage of the FRAME
Next Steps
Now that we are essentially code complete (pending the ongoing re-audit), our focus is going to be on the following:
- Completing upstream merge to
Polkadot-SDKandpolkadot-fellows/runtimes. - Organising bug bounty programs on Rococo, Kusama, and Polkadot
- Creating an integration guide for third-party parachains.
- Adding support for other application-level features that users have been requesting. We already have a prototypes for these and will release them as post-launch upgrades:
- General-purpose messaging with XCM Transact
- Bridging Polkadot-native assets to Ethereum