project screenshot 1
project screenshot 2
project screenshot 3
project screenshot 4

BCH-EVM cross-chain swap

BCH - EVM cross chain swaps via escrow contracts on both chains

BCH-EVM cross-chain swap

Created At

ETHGlobal Waterloo

Project Description

This project attempts to execute a swap between Bitcoin Cash and an EVM-based chain (Polygon in the case of the demo). Using CashScript, a compiling language (similar to Solidity) for Bitcoin Cash opcodes, to provide the escrow contract locking mechanism on the BCH network, an attestation format (similar to EAS where both parties sign the data) is published on BCH via the OP_RETURN opcode. Both parties of the swap deposit the relevant coins into their respective escrow contracts. Both escrow contract will unlock funds upon a successful swap coordination - a time expiry is provided on both escrow contracts to withdraw from the swap.

CashToken demo of on-chain tokens as cliffhanger

How it's Made

This project uses CashScript to generate P2SH (or) P2SH32 addresses with the relevant escrow mechanisms. An attestment is generated based on the swap conditions and signed by both parties, which is subsequently published onto the BCH network via OP_RETURN. The final swap occurs when both parties coordinate in calling the exchange function - both parties are required to execute the swap exchange.

It would be easier to coordinate the various keypairs on the different chains once the Lit protocol implements BCH (and UTXO) support.

background image mobile

Join the mailing list

Get the latest news and updates