Recently, I did some researches on some existing popular cross chain bridges, here to dump them on the blog with three pages, for Celer Bridge, Connext, MultiChain respectively.
Last time when checking around celer bridge contracts, found it’s usinng HTLC(hash time lock contracts), so the cross chain flow would be user submit a cross chain request on the source chain, the bridge’s LP prepare on the destination chain, when users expose the preimage to unlock assets from either side, the bridge will be able to claim the locked assets on the source chain.
However, it’s changed now with its version 2. Firstly, it established a layer 2 sidechain to serve as its SGN, and base it on a PoS mechnism with staking on layer 1. As said, “State guardian network (SGN) is an efficient and scalable sidechain that offers highly reliable and decentralized services to eliminate the state channel security risks and usability hassles caused by the off-chain availability problem”.
Maybe I should just embed the research doc here, no more writing.
cBridge v2 Research
April, .2022 / stefan liu
─
https://cbridge-docs.celer.network/reference/contract-addresses
A: Pool Based Bridge
B: TokenVault Canonical Token Bridge
Bridge TVL
https://cbridge-analytics.celer.network/
Bridge/Chain | ETH | BSC | Polygon | Arb | |
Pool Based | 28milli | 32milli | 24milli | 45milli | |
TokenVault | 320milli | 42milli | 0.17milli | 0 |
Pool Based Bridge
This model is intended for canonical tokens that have already been generated on different chains (e.g., USDT, USDC, ETH). The bridge rate is dynamically adjusted according to the balances of the two liquidity pools, using the StableSwap pricing curve.
In cBridge 2.0, we are introducing an entirely new model of operation where the SGN manages shared liquidity pool contracts on multiple chains. This effectively treats the SGN and its managed liquidity pool as a single “node” along with all the other non-custodial LP-managed nodes and gives an option to the LPs to delegate liquidity easily without the hassle of running a node
TokenVault Canonical Token Bridge
This model is intended for the use case where a token has already been generated on chain A (e.g., Ethereum) but not yet on chain B (e.g., BSC) and bridging is needed between chain A and chain B as business grows (e.g., the dApp is launched on chain B)
Contracts
WithLP
https://etherscan.io/address/0x5427FEFA711Eff984124bFBB1AB6fbf5E3DA1820?__cf_chl_tk=k7Ha4cDzdeoqboJDVazm07cXuygHTiILEdVSWIP.4EQ-1649691604-0-gaNycGzNCFE#code#F10#L55
addLiquidity
addNativeLiquidity
withdraw
send
relay
Mint/Burn
OriginalTokenVaultBridge
https://bscscan.com/address/0x78bc5Ee9F11d133A08b331C2e18fE81BE0Ed02DC#code
deposit
deposityNative
withdraw
PeggedTokenBridge
mint
burn
SGN
State guardian network (SGN) is an efficient and scalable sidechain that offers highly reliable and decentralized services to eliminate the state channel security risks and usability hassles caused by the off-chain availability problem.
https://www.celer.network/celercore/sgn/guardian.html
https://sgn.celer.network/#/staking
Layer 2 SideChain
https://etherscan.io/address/0x8a4b4c2acadeaa7206df96f00052e41d74a015ce#code
Bridge Fees & Fee Rebates
Base Fee(gas fee) + Percentage Fee
Pool based:
For transfers from L2 roll-up chains (Arbitrum/Optimism/Boba/Metis), the liquidity fee percentage is 0.1%-0.5%
For all other transfers, the liquidity fee percentage is 0.04%
Canonical Token Bridge:
The fee percentage is governed by the Celer SGN (usually, the fee percentage is 0%-0.04%).
Fee Rebates: https://cbridge-docs.celer.network/rewards/fee-rebate
AMM StableSwap Curve
https://curve.fi/files/stableswap-paper.pdf
cBridge v1
In 1.0, we chose to use a centralized gateway to quickly learn operation experiences on various scheduling policies. Although cBridge 1.0 is built with non-custodial architecture and users NEVER need to put trust in nodes for their fund’s security, there is indeed a user experience issue related to node availability. As an example, if after a user sends a conditional transfer to a node but the node goes offline before the two-step HTLC transfer is complete, they will have to wait until the conditional transfer times out, without any penalty to or compensation from this offline cBridge node.
Bridge Node Selection
Node Quality Score formula to incorporate multiple factors such as the parameters in a node’s SLA (fee, response time) as well as historical performance. (e.g. success rate, average response time)
V2 Benefits
https://cbridge-docs.celer.network/introduction/architectural-benefits
- Reduce to one operation
- SGN(Decentralized) POS
- No more HTLC
- Deep LP
- LP Balancing with AMM
- Mint/Burn
- CELR token