Skip to content

pf92/x-chain-protocols

Repository files navigation

Cross-Blockchain Asset Transfer Protocols

This project contains Ethereum smart contracts enabling decentralized cross-blockchain asset transfers between EVM-based blockchains. The provided implementation allows users to transfer ERC-20 tokens from one blockchain to another in a completely decentralized way. For that, the provided smart contracts need to be deployed on each participating blockchain.

Important: This project is a research prototype demonstrating the feasibility of cross-blockchain asset transfer protocols. Use it with care in production systems.

Installation

The following guide will walk you through the deployment of the provided smart contracts on a local blockchain (Ganache).

Prerequisites

You need to have the following tools installed:

Deployment

  1. Clone the repository: git clone [email protected]:pf92/x-chain-protocols.git
  2. Change into the project directory: cd x-chain-protocols/
  3. Install all dependencies: npm install
  4. Deploy contracts: truffle migrate --reset

Testing

Run the tests with truffle test. Apart from conducting tests on a single blockchain, the directory /evaluation contains scripts for conducting asset transfers between two EVM-based blockchains, e.g., to send ERC-20 tokens from Rinkeby to Ropsten. For that, you have to provide the respective node URLs, your account addresses and the corresponding private keys in the file /evaluation/config.json. To deploy the contracts on both chains, run truffle exec ./evaluation/deploy.js. This will deploy the contracts on both blockchains and store their respective addresses in the file /evaluation/config.json. To conduct assets transfers, run truffle exec ./evaluation/evaluation.js.

Transaction Inclusion Verification

The implemented concepts rely on a mechanism to verify within some blockchain whether a transaction has been included and confirmed by enough succeeding blocks on some other blockchains. This project does not provide such a mechanism, it merely provides an interface and a mock contract implementing the interface without conducting any inclusion verification. If you wish to run the implemenantion with some other mechanisms such as relays (e.g., the Testimonium relay), please make sure that the corresponding smart contract implements the interfaces specified in contracts/TxInclusionVerifier.sol. The abi of the contract can be specified in the file /evaluation/config.json (see txVerifier.file). When calling the deploy script, this contract will be automatically deployed before the contracts implementing the transfer protocols.

How to contribute

This project is a research prototype. We welcome anyone to contribute. File a bug report or submit feature requests through the issue tracker. If you want to contribute feel free to submit a pull request.

Licence

This project is licensed under the MIT License.

About

Cross-blockchain Asset Transfer Protocols

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published