An Overview of the Inter-Blockchain Communication Protocol
An Overview of the Inter-Blockchain Communication Protocol
Packet
is the primary container for cross-chain communication in IBC v2. Each packet may wrap one or more application-specific Payload
objects.
Client (ICS-02) – Light Client
ClientState
(long-term parameters) and evolving ConsensusState
s (snapshots). If consensus assumptions are violated, misbehaviour evidence can freeze the client.Provable Store (ICS-24)
Value | Path Format |
---|---|
Packet Commitment | {sourceClientId}0x1{bigEndianUint64Sequence} |
Packet Receipt | {destClientId}0x3{bigEndianUint64Sequence} |
Acknowledgement | {destClientId}0x2{bigEndianUint64Sequence} |
Routing & Handler (ICS-25)
SendPacket
, RecvPacket
, AcknowledgePacket
, and TimeoutPacket
.It enforces exactly-once delivery, ensures valid ordering (ordered, unordered, or ordered-allow-timeout), and dispatches packets to the correct application.Port Allocation (ICS-05)
portId
values during initialization. Ports are referenced in every Payload
for routing incoming packets.OnRecvPacket(...)
– Executed on the destination chain to process incoming data. Must return an Acknowledgement, which may contain success data or an error.OnAcknowledgePacket(...)
– Executed on the source chain once an acknowledgement is verified. Provides acknowledgement data so the sending application can finalize or revert actions.OnTimeoutPacket(...)
– Executed on the source chain if a timeout occurs, enabling rollback or refunds.1. SendPacket (Source Chain)
Packet
, assigned a sequence
, and committed at the Packet Commitment path.2. RecvPacket (Destination Chain)
OnRecvPacket
.3. WriteAcknowledgement (Destination Chain)
Acknowledgement
. This is committed under the Acknowledgement path, allowing proof for the source chain.4. AcknowledgePacket (Source Chain)
OnAcknowledgePacket
on the sending application.5. TimeoutPacket (Source Chain)
timeout
elapses before a receipt exists on the destination chain, the source verifies this via proof of non-existence, deletes the commitment, and triggers OnTimeoutPacket
.