An Overview of the Inter-Blockchain Communication Protocol
Packet
is the primary container for cross-chain communication. Each packet wraps one or more application-specific Payload
objects.
Client (ICS-02) – Light Client
Provable Store (ICS-24)
Value | Path Format |
---|---|
Packet Commitment | {sourceClientId}0x1{bigEndianUint64Sequence} |
Packet Receipt | {destClientId}0x2{bigEndianUint64Sequence} |
Acknowledgement | {destClientId}0x3{bigEndianUint64Sequence} |
Port Allocation (ICS-05)
portId
values during initialization. The port is referenced in every Payload
to route incoming packets.OnRecvPacket(...)
– Executed on the destination chain to process incoming data. It must return an Acknowledgement, which can contain application-specific success data or an error.OnAcknowledgePacket(...)
– Executed on the source chain once an acknowledgement is verified. The acknowledgement
data is passed to this callback, allowing the sending application to finalize or compensate the originating action.OnTimeoutPacket(...)
– Executed on the source chain if a timeout occurs, allowing for a clean rollback or refund.OnRecvPacket
callback fails for even one payload, the entire packet operation is considered a failure. Any state changes from other successful callbacks in the same packet must be reverted.1. SendPacket (Source Chain)
Payload
data from a sending application, wraps it in a Packet
, assigns a sequence
, and commits the packet hash to the state at the Packet Commitment
path.2. RecvPacket (Destination Chain)
Packet
and a proof of its commitment. It verifies the proof against the light client state and, on success, stores a Receipt
at the Packet Receipt
path before invoking the destination application’s OnRecvPacket
callback.3. WriteAcknowledgement (Destination Chain)
OnRecvPacket
callback returns an Acknowledgement
. The IBC module commits this data to the state at the Acknowledgement
path, making it available to be proven via a subsequent attestation. For applications with long-running logic, this can be an asynchronous call to a separate WriteAcknowledgement
function.4. AcknowledgePacket (Source Chain)
Acknowledgement
and its proof. After verification, it deletes the original packet commitment and calls the OnAcknowledgePacket
callback on the sending application, passing the acknowledgement
data.5. TimeoutPacket (Source Chain)
timeoutTimestamp
is reached before a receipt is written on the destination chain, the IBC module processes an attestation proving the receipt’s non-existence. It then deletes the original packet commitment and triggers the OnTimeoutPacket
callback.