Documentation Index
Fetch the complete documentation index at: https://cosmos-docs-evm-upgrade-7.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Synopsis
This document describes a standard for multi-hop IBC channels. Multi-hop channels specify a way to route messages across a path of IBC enabled blockchains utilizing multiple pre-existing IBC connections.Motivation
The current IBC protocol defines messaging in a point-to-point paradigm which allows message passing between two directly connected IBC chains, but as more IBC enabled chains come into existence there becomes a need to relay IBC packets across chains because IBC connections may not exist between the two chains wishing to exchange messages. IBC connections may not exist for a variety of reasons which could include economic inviability since connections require client state to be continuously exchanged between connection ends which carries a cost.Definitions
Associated definitions are as defined in referenced prior standards (where the functions are defined), where appropriate.Connection is as defined in ICS 3.
Channel is as defined in ICS 4.
Channel Path is defined as the path of connection IDs along which a channel is defined.
Connection Hop is defined as the connection ID of the connection between two chains along a channel path.
Desired Properties
- IBC channel handshake and message packets should be able to utilize pre-existing connections to form a logical proof chain to relay messages between unconnected chains.
- Relaying for a multi-hop IBC channel should NOT require writing additional channel, packet, or timeout state to intermediate hops.
- The design should strive to minimize the number of required client updates to generate and query multi-hop proofs.
- Minimal additional required state and changes to core and app IBC specs.
- Retain desired properties of connection, channel and packet definitions.
- Retain backwards compatibility for messaging over a single connection hop.
Technical Specification
The bulk of the spec describes multi-hop proof generation and verification. IBC connections remain unchanged. Additionally, channel handshake and packet message types as well as general round trip messaging semantics and flow will remain the same. There is additional work on the verifier side on the receiving chain as well as the relayers who need to query for proofs. Messages passed over multiple hops require proof of the connection path from source chain to receiving chain as well as the packet commitment on the source chain. The connection path is proven by verifying the connection state and consensus state of each connection in the path to the receiving chain. On a high level, this can be thought of as a chained proof over a channel path which enables the receiving chain to prove a key/value on the source chain by iteratively proving each connection and consensus state in the channel path starting with the consensus state associated with the final client on the receiving chain. Each subsequent consensus state and connection is proven until the source chain’s consensus state is proven which can then be used to prove the desired key/value on the source chain.Assumptions
This multi-hop spec assumes that all proof specs for membership verification for each chain are equal.Channel Handshake and Packet Messages
For both channel handshake and packet messages, additional connection hops are defined in the pre-existingconnectionHops field. The connections along the channel path must exist in the OPEN state to guarantee delivery to the correct recipient. See Path Forgery Protection for more information.
See ICS 4 for multi-hop related spec changes. Multi-hop does not change existing spec behavior for channel handshakes, packet delivery, and timeout handling. However, multi-hop channels require special handling for frozen clients (see chanCloseFrozen).
In terms of connection topology, a user would be able to determine a viable channel path from sender -> receiver using information from the chain registry. They can also independently verify this information via network queries.
Multihop Relaying
Relayers deliver channel handshake and IBC packets as they currently do except that they are required to provide proof of the channel path. Relayers scan packet events for theconnectionHops field and determine if the packet is multi-hop by checking the number of hops in the field. If the number of hops is greater than one then the packet is a multi-hop packet and will need extra proof data.
For each multi-hop channel (detailed proof logic below):
- Scan source chain for IBC messages to relay.
- Read the
connectionHopsfield in from the scanned message to determine the channel path. - Using connection endpoints via chain registry configuration, query for required multi-hop proof heights and update client states along the channel path as necessary (see pseudocode implementation).
- Query proof of packet or handshake message commitments on source chain at the proof height used in step 3.
- Query for proof of connection, and consensus state for each intermediate connection in the channel path using proof heights determined in step 3.
- Submit proofs and data to RPC endpoint on receiving chain.
Proof Generation & Verification





N chains: C[0] --> C[i] --> C[N]
Multi-hop Proof Verification Steps
The following outlines the general proof verification steps specific to a multi-hop IBC message.- Unpack the multihop proof bytes into consensus states, connection states and channel/commitment proof data.
- Check the counterparty client on the receiving end is active and the client height is greater than or equal to the proof height.
- Iterate through the connections states to determine the maximum
delayPeriodfor the channel path and verify that the counterparty consensus state on the receiving chain satisfies the delay requirement. - Iterate through connection state proofs and verify each connectionEnd is in the OPEN state and check that the connection ids match the channel connectionHops.
- Verify the intermediate state proofs. Starting with known
ConsensusState[0]at the givenproofHeightonChain[1]prove the prior chain’s consensus and connection state. - Verify that the client id in each consensus state proof key matches the client id in the ConnectionEnd in the previous connection state proof.
- Repeat step 5, proving
ConsensusState[i], andConn[i,i-1]whereiis the proof index starting with the consensus state onChain[2].ConsensusState[1]is already known onChain[0]. Note that chains are indexed from executing (verifying) chain to and proofs are indexed in the opposite direction to match the connectionHops ordering.- Verify ParseClientID(ConsensusProofs[i].Key) == ConnectionEnd.ClientID
- ConsensusProofs[i].Proof.VerifyMembership(ConsensusState.GetRoot(), ConsensusProofs[i].Key, ConsensusProofs[i].Value)
- ConnectionProofs[i].Proof.VerifyMembership(ConsensusState.GetRoot(), ConnectionProofs[i].Key, ConnectionProofs[i].Value)
- ConsensusState = ConsensusProofs[i].Value
- i++
- Finally, prove the expected channel or packet commitment in
ConsensusState[N-2](sending chain consensus state) onChain[1]
Multi-hop Proof Verification Pseudo Code
Pseudocode proof generation for a channel betweenN chains C[N] --> C[i] --> C[0]