Skip to content

ChorusOne/celo-cosmos-bridge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

An IBC Celo-Cosmos bridge

Overview

This is a bridge connecting a Celo blockchain to a Cosmos-SDK based blockchain. Specifically it connects celo light client running inside cosmos chain to celo chain and cosmos light client running inside celo chain to cosmos chain (the latter is still under construction).

Architecture

The cosmos-celo bridge, comprises three major components, with two light clients as subcomponents:

  • A fork of cosmos-sdk, with an additional module to allow execution of wasm-based light clients.
  • Celo geth, an Ethereum based blockchain with Istanbul BFT consensus
  • Quantum-tunnel, a simple relayer, written in rust.
  • Tendermint light client, written in solidity and deployed on the Celo blockchain
  • Celo light client, written in rust as CosmWasm contract. Its wasm bytecode need to be uploaded to cosmos node as part of bridge setup.

Integration tests

A single Makefile orchiestrates setup of all compontents. You should run the following commands in to execute selected integration test:

# Setup Celo geth node
$ make build-geth
$ make start-geth

# Setup cosmos node with the ChorusOne fork of cosmos-sdk (adds wasm-manager functionality)
$ make build-simd
$ make start-simd

# Build and upload Celo Light Client to cosmos node (via wasm-manager interface)
$ make build-clc
$ make start-clc

# Build and upload Tendermint Light Client to celo node (via truffle)
$ make build-tlc
$ make start-tlc

# Setup Quantum Tunnel relayer (pick your integration test at this step)
$ make build-qt
$ TEST_MODE=... make start-qt

Why don't you use docker-compose?

While docker is great for setting up reproducable work envirionment, it's not the fastest solution ever. In practice it's much easier to use a single Makefile for development work, without the need to care about isolated volumes or lengthly build times.

Live

Both chains are live. To run this variant you need to execute TEST_MODE=live_config_celo_cosmos make start-qt in project directory.

Simulated celo

Celo chain is simulated with a text file and headers are fed into celo light client running in cosmos chain. To run this variant you need to execute TEST_MODE=simulated_celo_chain_config make start-qt. If the test is successful, make will exit with zero exit code.

Faulty simulated celo

Same as simulated celo but with faulty data to test failure scenario. To run this variant you need to execute TEST_MODE=faulty_simulated_celo_chain_config make start-qt. If the test is successful, make will exit with zero exit code.

Credit and Attribution

  • Celo - Celo foundation
  • Cosmos-SDK - All in Bits, Tendermint Inc., Interchain.io, Interchain Foundation
  • Cosmwasm - Confio, Ethan Frey and Simon Warta
  • Tendermint-rs / ibc-rs - Informal Systems
  • Concept of Wasm-based light client - Zaki Manian, Iqclusion

Demo

asciicast