Skip to content

Latest commit

 

History

History
29 lines (17 loc) · 2.28 KB

README.md

File metadata and controls

29 lines (17 loc) · 2.28 KB

ckb-ics

ckb-ics is a validation utility set providing IBC-compatible objects and messages for CKB. objects are payloads of cross-chain commands, and their hash digests are located in the cells’ data field and the raw bytes are set in the witnesses to optimize on-chain capacity requirement. messages can be recognized as cross-chain commands, instructing the relayer on how to process them to complete the relay operations, such as establishing connection and handling packet.

In the case of ibc-ckb-contracts, the responsibility of ckb-ics is to verify whether an object in objects is valid under a specified IBC message in messages, by calling the corresponding handler in handlers. In the case of Forcerelay, ckb-ics just provides structures in objects to help complete the assembly of CKB transactions, which can modify the status of on-chain IBC cells.

In general, project ckb-ics is the core validation library for ibc-ckb-contracts and Forcerelay, which validates parameters associated with Cosmos-IBC protocol for CKB.

Integration

To integrate ckb-ics into your project, add the following line to your Cargo.toml file:

ckb-ics-axon = { git = "https://github.com/synapseweb3/ckb-ics", branch = "main" }

Object Encoding/Decoding

IBC commitments are encoded with protobuf etc., compatible with ibc-solidity or ibc-go.

IBC objects (whose hash are stored in ibc cells) are encoded with RLP due to historical implementation choices.

Commitment Verification

The primary responsibility of an IBC light client is to validate counterparty commitments. In the case of Axon → CKB, Axon’s light client on CKB network follows the following steps to complete a verification process:

  1. Verify the validity of an Axon block by referencing the metadata cells directly maintained by Axon itself.
  2. Verify the account MPT proof of the IBC handler to get its storage trie root.
  3. Verify the storage MPT proof for the commitment path and value.