Three steps are needed to implement the bitcoin contract:
- ChainX takes bitcoins onboard through its inter-chain gateway;
- Integrate smart contracts on ChainX
- Convert the inter-chain bitcoins to the contract platform.
Specific Information About Each Step:
1. due to the lack of contract functionality, Bitcoin has no way to implement a ChainX SPV. So we can only implement the Bitcoin SPV in ChainX and use a MultiSig address in Bitcoin to interact with each other. The Bitcoin MultiSig address is under control of serveral ChainX trustees, who are normally the top ChainX validators, endored by their reputations. This approach is a compromise when we can only implement one-way relay. Inter-chain bitcoins are daubed as X-BTC in ChainX.

2. ChainX is based on Substrate, so it uses the Substrate Contracts: https:// substrate.dev/docs/en/ecosystem/contracts/ink#contracts-module, which is similar to the contract model of Ethereum, using WASM Platform. But it’s worth pointing out that ChainX has partially modified the Contracts to make them compatible with ChainX.
3. ChainX uses the ERC20 token contract in Substrate Contracts to represent X-BTC by designing an interface that allows X-BTC and ERC20 tokens to be converted to each other, enabling bitcoins in ChainX to be converted to ERC20, which means the implementation of the bitcoin smart contract.
About ChainX
- Official website: https://chainx.org
- Wiki: https://github.com/chainx-org/ChainX/wiki
- Twitter: https://twitter.com/chainx_org
- Medium: https://medium.com
- Telegram: https://t.me/chainx_org
- White paper: https://chainx-static.oss-cn-hangzhou.aliyuncs.com/chainx_en.pdf
- Desktop wallet: https://github.com/chainx-org/chainx-wallet/releases/tag/v1.0.3
- Official Wechat: interchain