Contracts for cBridge, cross-chain liquidity solution powered by Hashed-Timelock Transfers.
The lifecycle of a cross-chain transfer is as simple as follow:
- Sender sends transferOut tx on the source chain.
- Bridge node sends transferIn tx on the destination chain, using the same
hashlock
set by the sender. - Sender confirms the transfer on the source chain.
- Bridge node confirms the transfer on the destination chain.
If any party is not cooperative during the process, others can use the confirm and refund methods to finish or cancel the transfer forcefully.
This version of cBridge contract is tailored for users who want to efficiently transfer funds across different blockchains without any upfront liquidity locking or additional withdrawal operations. Alternatively, Celer state channel network (L1 contract, L2 node) supports cross-chain token transfer with higher throughput and lower amortized cost for repeated transfers. The trade-off is that users need to lock their funds in the state channel network upfront and perform additional withdrawal operations to move their funds out of the network.