Skip to main content
Version: v0.20.x

Packet Data Structure

Advanced Protocol

The data that is sent over an IBC channel is called a packet. The packet data is defined by the IBC application module that is sending the packet. In the case of cw-ica-controller, the packet data is defined by the ICS-27 specification.

src/ibc/types/packet.rs
loading...

The data field is encoded as protobuf bytes using the following function:

src/ibc/types/packet.rs
loading...

From CosmosMsg to Packet Data

Since this contract also provides an execute message to send CosmosMsgs as ICA packets, we have a helper function that converts a CosmosMsg to a packet data:

src/ibc/types/packet.rs
loading...

The specific conversion of each CosmosMsg variant into a protobuf any can be found in cosmos_msg.rs.

Acknowledgement Data

For each packet that is sent, the receiving module must respond with an acknowledgement packet. The acknowledgement packet is used to signal whether or not the ICA packet was successfully executed. The acknowledgement data is defined by the ICS-27 specification.

src/ibc/types/packet.rs
loading...

cw-ica-controller includes the acknowledgement packet in the callbacks that it makes to the external contract.