Introducing a new way to review your PRs.

Read the announcement

lfdt-ibc / ibc

The Inter-Blockchain Communication Protocol (IBC) is a neutral, open standard for secure cross-ledger interoperability

View on GitHub

18 documents · Updated Nov 23, 2026

docs / ibc-core-protocol-semantics

Core protocol semantics

Core IBC lets modules on independent state machines exchange messages with proof-based trust. Clients track trusted views of remote state. Connections join those views. Channels then provide permissioned delivery, ordering, replay protection, acknowledgements, and timeouts for application packets. This page gives the shared model across IBC protocol specifications, with application rules in IBC application standards, client and relayer rules in IBC client and relayer standards, and newer protocol work in IBC v2 specifications.

System model

Protocol roles

IBC separates local application work from cross-chain proof work. A host state machine runs application modules, an IBC handler, and may run a routing module. A relayer moves messages and proofs between chains, but the receiving chain decides whether each proof is valid.

The core roles are:

RolePurpose
Host state machineSupplies state, time, height, module isolation, transaction rollback, and data access for IBC.
ClientVerifies updates from a remote state machine and exposes trusted roots for proof checks.
ConnectionBinds clients for two chains and records the counterparty data and delay rules used for verification.
ChannelBinds two module-owned ports and applies packet delivery and ordering rules.
HandlerApplies IBC state changes and checks permissions and proofs.
Routing moduleAccepts external datagrams and sends them to the handler or the module that owns a port.
RelayerReads events and proofs from one chain and submits data to the other chain.

These roles create a trust boundary. A relayer can be delayed or dishonest without gaining authority to change remote state because the handler accepts only messages that pass local state and proof checks.

References: spec/…/README.md• L31-35 spec/…/README.md• L14-20 spec/…/README.md• L13-23

Proof-based trust

IBC does not require one chain to run the consensus process of another chain. A client stores a trusted view of the remote chain and checks later updates with a client-specific validity rule. It can also detect misbehavior. A valid misbehavior proof freezes the client so later packet proofs cannot use a state that the client has marked unsafe.

The handler uses commitment proofs to check values in a remote state snapshot. A proof can show that a key has a value or that a key has no value. This lets IBC authenticate clients, connections, channels, packet commitments, packet receipts, acknowledgements, and sequence counters without copying the full remote state.

References: spec/…/README.md• L15-33 spec/…/README.md• L275-345 spec/…/README.md• L14-30 spec/…/README.md• L206-256

State relationships

Client state

A client is the root of cross-chain verification. It stores client state and one or more consensus states for a remote chain. Each consensus state identifies a remote height and its commitment root. Higher layers ask the client to verify a remote value at a chosen height.

Client updates are separate from packet relay. A relayer may update a client before it submits a handshake or packet proof. If the client freezes or cannot advance past its validity window, dependent connections and channels cannot safely authenticate new packets or timeouts until an authorized recovery process resolves the client state.

References: spec/…/README.md• L104-144 spec/…/README.md• L213-255 spec/…/README.md• L569-584

Connection state

A connection is a pair of persistent connection ends on two chains. Each end points to a client for the counterparty and records the counterparty connection identifier, proof prefix, negotiated version, and delay periods. The connection is the authorization layer for later channel and packet proofs.

Connection opening uses four handshake steps. The handshake proves the connection end stored by the other chain and binds both identifier pairs to the expected clients. The latest handshake no longer carries a separate proof that re-validates the counterparty client and consensus state. Once both ends are OPEN, the connection cannot be closed or reused. This prevents old packets or authorization data from becoming valid under a new connection identity.

sequenceDiagram
    participant A as Chain A
    participant R as Relayer
    participant B as Chain B
    A->>A: ConnOpenInit
    R->>B: ConnOpenTry + proof
    R->>A: ConnOpenAck + proof
    R->>B: ConnOpenConfirm + proof
    Note over A,B: Both connection ends are OPEN

References: spec/…/README.md• L15-21 spec/…/README.md• L68-103 spec/…/README.md• L398-418 spec/…/README.md• L569-582

Channel state

A channel is a module-to-module path that uses an open connection. Its two channel ends record the ports, counterparty channel, ordering mode, connection path, and application-facing version. The channel fixes which module may use the path and prevents another module from taking over the channel end.

Channel opening follows the INIT, TRYOPEN, and OPEN handshake pattern used by connections. A channel can later close permanently. Core IBC also defines an upgrade path that pauses new sends, flushes in-flight packets, and applies new channel parameters only after both ends agree. The upgrade keeps channel identifiers and restores the old parameters if it fails or times out. Application state migration, when needed, runs only after the channel is open with the new parameters.

References: spec/…/README.md• L14-18 spec/…/README.md• L44-68 spec/…/README.md• L276-322 spec/…/UPGRADES.md• L5-20 spec/…/UPGRADES.md• L423-459 spec/…/UPGRADES.md• L1093-1099

Port ownership

A port is a named permission boundary between the IBC handler and a local module. A module binds a port before it opens channels. The port owner receives control of every channel opened through that port and must prove ownership when it sends, receives, closes, or handles packet results.

Port names are local identifiers. A name may have a common convention such as a token or staking service, but core IBC does not prove that the bound module implements that convention. A host may let modules bind ports directly or use a module manager, such as the routing module, to control reserved and new names.

References: spec/…/README.md• L15-36 spec/…/README.md• L42-52 spec/…/README.md• L189-225

Packet lifecycle

Packet commitments

A packet carries application bytes plus source and destination port and channel identifiers, a sequence number, and a height or time timeout. The sender does not need to store the full packet in provable state. It stores a commitment to the packet data and timeout. Events or other queries make the packet available to relayers.

The commitment gives the destination a precise claim to verify. The destination checks that the packet data and timeout match the sender's committed value. A packet commitment remains until the packet is acknowledged or timed out. Deleting it completes the sender-side lifecycle and prevents the same packet from being completed twice.

References: spec/…/README.md• L116-155 spec/…/README.md• L225-250 spec/…/README.md• L737-752 spec/…/README.md• L1467-1469

Delivery and acknowledgement

Packet delivery has two separate results. recvPacket proves and records delivery on the destination. The application module then processes the packet and may write a non-empty acknowledgement. A later relay proves that acknowledgement to the sender. acknowledgePacket then lets the source module finish its local response and removes the packet commitment.

The handler checks the channel, port ownership, packet addresses, timeout, sequence rules, and remote commitment before it changes delivery state. The module callback performs the application action in the same transaction or queues it for later execution. In the routing path, the handler state change occurs before the application callback. This separation lets core IBC guarantee delivery properties without knowing the meaning of packet data or acknowledgement bytes.

sequenceDiagram
    participant S as Source module
    participant A as Source chain
    participant R as Relayer
    participant B as Destination chain
    participant D as Destination module
    S->>A: sendPacket
    A-->>R: packet event + commitment
    R->>B: recvPacket + proof
    B->>D: deliver packet
    D->>B: write acknowledgement
    B-->>R: acknowledgement event
    R->>A: acknowledgePacket + proof
    A->>S: acknowledgement result

References: spec/…/README.md• L802-820 spec/…/README.md• L976-1020 spec/…/README.md• L1023-1110 spec/…/README.md• L680-728

Ordering and replay protection

All channel types provide exactly-once delivery while using different order and receipt rules:

Channel orderDelivery ruleEffect of a timeout
ORDEREDReceive and acknowledge packets in sequence.The timed-out packet and later packets cannot be received, and the channel closes.
ORDERED_ALLOW_TIMEOUTProcess each sequence in order.Record a timeout receipt and continue with later sequences.
UNORDEREDReceive packets in any order.Prove that the packet receipt is absent, then continue with other packets.

The destination records a receipt for an unordered packet. Ordered channels advance a receive sequence instead. These records are the evidence used to reject a replay or to prove that a packet was not received before timeout. If an upgrade prunes old receipts or acknowledgements, the implementation must retain a separate guard for sequences already used before the upgrade.

References: spec/…/README.md• L44-66 spec/…/README.md• L148-155 spec/…/README.md• L802-819 spec/…/README.md• L913-918 spec/…/README.md• L1137-1155

Timeout handling

A timeout is a proof about the destination chain. The source cannot treat silence as failure because the chains may be partitioned or the relayer may be delayed. A relayer instead submits proof that the destination height or timestamp passed without a valid receive, or that the destination channel closed.

The timeout result depends on channel order. An unordered channel checks receipt absence. An ordered channel checks the next receive sequence and closes when the expected packet expires. An ORDERED_ALLOW_TIMEOUT channel first records a timeout receipt at the destination so the source can verify that ordered outcome.

References: spec/…/README.md• L1137-1155 spec/…/README.md• L1197-1271 spec/…/README.md• L1325-1464

Host and handler boundaries

Host requirements

The host supplies the stable environment in which core IBC can make cross-chain claims. It must expose a module system, key/value state, a provable store for remote verification, a private store for local data, current height and time, event logs, bounded transaction progress, and transaction rollback.

The host also defines the commitment prefix and canonical encodings that let a remote client interpret proofs. It must keep timestamps non-decreasing and make packet data and related events available to relayers. These requirements support safety and liveness without requiring a particular chain engine or storage backend.

References: spec/…/README.md• L15-35 spec/…/README.md• L65-104 spec/…/README.md• L161-187 spec/…/README.md• L290-354

Handler interface

The IBC handler is the core state transition boundary used by local modules and external relayers. It exposes lifecycle actions for clients, connections, and channels. It also exposes packet send, receive, acknowledgement, and timeout actions. The interface carries the semantics defined by the client, connection, channel, port, and proof standards.

The handler does not decide application meaning. It checks the cross-chain claim and channel permission. It then calls the local module at the point where application state must change. This allows many application protocols to share the same authenticated transport.

References: spec/…/README.md• L14-30 spec/…/README.md• L36-62 spec/…/README.md• L737-752 spec/…/README.md• L802-820

Routing boundary

The routing module is an optional front door for external datagrams. It maps a port to a module callback set. It sends handshake and packet actions to the handler. It routes received packets back to the module that owns the destination port. Relayers can therefore submit to one stable entry point instead of tracking every module call surface.

Routing does not replace proof checks or port ownership. It adds a call path and a lookup rule. The handler remains the authority for state transitions. Module callbacks validate application parameters and perform application actions after the relevant handler operation.

References: spec/…/README.md• L13-23 spec/…/README.md• L43-45 spec/…/README.md• L191-249 spec/…/README.md• L252-259 spec/…/README.md• L680-728

Multi-hop communication

Connection paths

A multi-hop channel uses a list of existing open connections to link a sender and receiver that do not have a direct connection. Intermediate chains do not store a second copy of the packet or run a second channel. They contribute proof links that allow the receiving chain to verify state on the sending chain.

The channel's connection path is ordered from the receiving side toward the sender. Every hop must match the proven connection identifier and be OPEN. The proof also links each connection to the client and consensus state that authenticates the next hop. This prevents a caller from replacing a path with unrelated connection records.

References: spec/…/README.md• L13-19 spec/…/README.md• L29-40 spec/…/README.md• L42-46 spec/…/README.md• L547-551

Multi-hop proofs

A multi-hop proof is a chained proof. It starts with a consensus state already known by the receiving chain. It proves the next connection and consensus state. It repeats this step until it reaches the source chain. The final proof checks the requested channel, packet, receipt, acknowledgement, or sequence value in the source state.

The relayer must discover the path, update clients when a needed consensus state is not available, choose compatible proof heights, and gather the intermediate proofs. Core packet and handshake meaning stays the same. Only the verification path becomes longer. The delay check covers the greatest delay period across the path.

flowchart LR
    R[Receiving chain client] --> C1[Connection and consensus proof]
    C1 --> C2[Next connection and consensus proof]
    C2 --> S[Sending chain state proof]
    S --> V[Verified channel or packet claim]

References: spec/…/README.md• L44-46 spec/…/README.md• L60-73 spec/…/README.md• L323-341 spec/…/README.md• L261-309

Change checklist

When these files or sections are changed, remember to consider these:

  • Changes to client validity or consensus-state storage must preserve every connection and channel proof that depends on the client.
  • Changes to connection prefixes, delay periods, handshake validation, or connection-hop order must update single-hop and multi-hop proof interpretation together.
  • Changes to packet commitments, receipts, acknowledgements, or sequence counters must preserve the exact-once and timeout evidence used by the opposite chain.
  • Changes to port ownership, callback order, or routing callbacks must keep handler authorization aligned with the module that receives the packet.
  • Changes to host encodings, commitment paths, or event data must preserve the data that relayers need to build proofs and packet messages.
  • Changes to channel upgrades must keep old in-flight packets on old parameters, require compatibility on both ends, and run application migration only after the channel is open with new parameters.

Important failure modes

TriggerConsequenceGuard
A client is frozen or cannot validate a new remote stateDependent packets and timeouts cannot be proven safely.Submit valid client updates or misbehavior evidence, then use an authorized recovery path.
A packet differs from the sender commitment or channel endpointsThe destination rejects the packet.Verify the commitment and source and destination port and channel fields before state change.
A receipt or acknowledgement is removed without protecting old sequence useA prior packet may be replayed after a channel upgrade.Keep lifecycle evidence or apply the upgrade-era replay guard before accepting a used sequence.
A relayer proves a connection path with an incorrect identifier, order, or closed hopThe receiver could authenticate state from the wrong route.Check every hop against the channel path and require each proven connection to be open.
A module releases a port while old channel traffic can still arriveA new module may receive traffic for the old port.Release a port only when old channels and incoming handshakes cannot cause unsafe interception.
A channel upgrade proceeds while one side still uses old parametersThe two modules can interpret the same packet differently.Block new sends, flush old packets, check compatibility, and open with new parameters only after both sides agree.

Key files

FileWhy to read it
spec/…/README.mdDefines the trusted remote-state view that later proof checks use.
spec/…/README.mdExplains how two clients become an authenticated connection and how delay rules apply.
spec/…/README.mdDefines channel ownership, packet delivery, ordering, acknowledgements, and timeouts.
spec/…/UPGRADES.mdDescribes safe channel parameter changes without abandoning packet history.
spec/…/README.mdDefines the module permission boundary for ports and channels.
spec/…/README.mdDefines the inclusion and absence proofs used to authenticate remote state.
spec/…/README.mdStates the host services needed to make IBC proofs, timeouts, and relaying work.
spec/…/README.mdShows the local interface that modules and relayers use to invoke core IBC actions.
spec/…/README.mdExplains the optional datagram and callback path between relayers, the handler, and modules.
spec/…/README.mdExplains how existing connections form a proof chain for indirect communication.