cosmos / ibc-rs

Rust implementation of the Inter-Blockchain Communication (IBC) protocol.
Apache License 2.0
180 stars 73 forks source link

Enhance light client verification functions for standalone use #1266

Open srdtrk opened 1 week ago

srdtrk commented 1 week ago

Description

Currently, the verification functions in ibc-rs such as verify_header and verify_misbehaviour require a validation context interface to be provided. However, many of the interface functions within the context are not actually used in these verification functions.

For example, in the verify_header function, it would create a better user experience to allow the user to provide host_timestamp and trusted_consensus_state directly rather than the entire context.

Use case

I am trying to use ibc-rs's 07-tendermint with Succinct's sp1 to create a POC ZK IBC light client for use in Solidity. In this context, it makes sense to avoid maintaining a full light client context and state. This issue is not a blocker but could significantly improve the UX.

Note

I acknowledge that I might not have the full context of the current implementation and usage patterns. If this functionality is already possible or if there are reasons for the current design that I might have missed, I would appreciate any guidance or feedback on this suggestion.

rnbguy commented 1 week ago

I hear you. We will consider upstreaming your suggestions.

But I am curious how you are using them. It sounds like we can benefit in the long run by maintaining a consistent light client trait for ICS02 between sp1 usecase and ibc-rs. (We did something similar for wasm light clients.)

Can you please share your work - here or over slack?

srdtrk commented 1 week ago

https://github.com/srdtrk/sp1-ics07-tendermint Here is my work. It can already verify the ZK proofs for ibc-rs's 07-tendermint in Solidity.