Grant proposal for Harmony<>Cosmos Bridge
Project Overview
This project is developing a bridge between Harmony and Tendermint based ledgers using the IBC. This bridge will be deployed on the private testnet for each of them.
As a sample application of the IBC, we will develop token transfer using ICS-20. The token on Harmony is assumed to be HRC-20 which will be handled as ICS-20 on Tendermint based ledgers.
Requests from the Datachain team
・The relayer will be implemented based on the YUI-relayer which is in Golang
・Harmony Light Client will be written in Golang
・We will use end to end test to confirm that token transfer can be done based on CLI without Web Frontend implementation
Goals
-
Developing Harmony Light Client as a Cosmos module in Golang for Tendermint based ledgers like Gaiad.
-
Developing Tendermint Light Client on Harmony
*1 Need to fix how to support the ed25519
*2 We would like Harmony to consider supporting EIP-665
*3 Our schedule is estimated with the *2 condition (Other ways may affect the schedule) -
Developing the relayer in Golang
-
Developing the token transfer sample application which can be executed based on CLI.
Examples of OSS libraries that we will utilize
・ geth (LGPL3.0): Merkle Patricia Tree verification, and some other details
・ harmony (LGPL3.0): various definitions, encoding/decoding processing
・ harmony-bls (modified new BSD License): header validation
Team
Jun Kimura(CTO)
Masanori Yoshida(Senior Blockchain Engineer)
Ryo Sato (Senior Blockchain Solution Architect)
Project Manager(TBD)
Estimation
-
Duration:3 - 4 months
-
Grant Amount : 70K to 95K USD in USDC
Depends on the situation of the assumption No4 below. If we could minimize Tendermint Client implementation using other works, the duration and the grant amount will be also minimized.
We could start with 3 months and $70K. We may ask you for additional duration and budget depending on other work progress (see Idx1 in the diagram below).
- The work for each iteration will be submitted after details are finalized.
Idx | IBC Layer | Item | Description | |
---|---|---|---|---|
0 | Harmony | TAO | Tendermint Client on Solidity | Check the assumption No2, No3 and No4 |
1 | Harmony | App | ICS-20 on Solidity | Plan to implement using the new HRC-20. |
2 | Relayer | TAO | Harmony Support | Supported as a corresponding ledger for yui-relayer |
3 | Relayer | TAO | Gaiad Support | |
4 | Gaiad | TAO | Harmony Light Client | Check the assumption No5 |
5 | Gaiad | TAO | App using ICS-20 | The basic implementation will be based on the ICS-20 implementation of cosmos/ibc-go. |
6 | Other | Private Testnet E2E Environment | E2E environment using docker-compose |
Assumptions
- Since the introduction of Harmony Light Client on a public testnet of Tendermint-based ledgers would require additional work such as an approval by the governance of the ledgers, we would recommend that deployment on a public testnet is out of scope.
We will give you technical support for the completion of the public testnet deployment in the next contract.
-
The Harmony Light Client which is developing in this project will not support the ICS-008 WasmClient specification, since its specification design is in progress and no one will be sure when it will be completed. Furthermore deploying the Harmony light client to their public testnets is even more uncertain under this condition.
-
Regarding support for ed25519 on Harmony, here is a prior example. Celo has implemented ed25519 signature verification as a pre-compiled contract as CIP-0025(based on EIP-665).
If the assumption of implementing a pre-compiled contract is problematic for Harmony, we would like to explore alternatives together. For example, the NEAR Protocol has an ed25519 signature verification implementation in solidity.
However, the security of this implementation is not known. Also, the upper limit of the gas costs may be an issue when validating a block header of Tendermint.
- We will avoid overlapping with the works like below, but it is unclear when they will complete. Therefore we estimated the work we will do for light client implementation as an additional option, in case we do not wait for the implementations below.
-
GitHub - ChorusOne/tendermint-sol: Tendermint in Solidity
- Assumes a pre-compiled ed25519 signature verification contract
- Membership Proof required for State Verification is not yet implemented.
- Internally uses yui-ibc-solidity, an OSS to which Datachain is the main contributor
-
WIP: Solidity Implementation by mossid · Pull Request #12 · confio/ics23 · GitHub
- ICS-23 implemented, but appears to be incomplete
We assume that the contract size and the runtime gas costs are issues. Those may cause schedule delays in this work due to the difficulty of the task.
- We will develop a Harmony Light Client based on the light client specification that the Harmony team will design and give us. If it is not suitable for implementation as the IBC Client, we will propose another specification and develop it after the Harmony team’s review.