These basic structures form the foundation of the IBC 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
createClient
updateClient
verifyMembership
verifyNonMembership
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.Application Callbacks (ICS‑26)
OnRecvPacket(payload)
– Executed on the destination chain to process incoming data. Must return an Acknowledgement (success or error).OnAcknowledgePacket(payload, acknowledgement)
– Executed on the source chain once an acknowledgement is verified, finalizing or compensating the originating action.OnTimeoutPacket(payload)
– Executed on the source chain if no acknowledgement is received before timeout
, allowing rollback or refunds.1. SendPacket (Source Chain)
Payload
objects. The IBC handler wraps them in a Packet
, assigns a new sequence number, and stores a cryptographic commitment at the Packet Commitment path.2. RecvPacket (Destination Chain)
Packet
together with a proof of its commitment. The destination chain’s IBC handler:destClientId
.OnRecvPacket
callback.3. WriteAcknowledgement (Destination Chain)
OnRecvPacket
. The IBC handler commits this acknowledgement at the Acknowledgement path, making it available for relayers.4. AcknowledgePacket (Source Chain)
OnAcknowledgePacket
on the sending application to finalize the cross‑chain operation.5. TimeoutPacket (Source Chain)
timeout
, a relayer submits a non‑existence proof for the Packet Receipt. The source chain deletes the packet commitment and triggers OnTimeoutPacket
, allowing the application to revert or refund the original transaction.