cosmos/ibc

Add packet data encoding format for each IBC app

Opened this issue · 0 comments

In the same vain as #918, determining the exact encoding format for an IBC app's packet data could be made easier.

I expect to see a document for each app, packet_data_encoding_format.md which should explain which encoding protocol is used and what value each field is marshalled as.

If we look at ICS-20 as an example, I see:

interface FungibleTokenPacketData {
  denom: string
  amount: uint256
  sender: string
  receiver: string
  memo: string
}

However, much farther down, underneath discussion of the acknowledgement type, I read:

Note that both the FungibleTokenPacketData as well as FungibleTokenPacketAcknowledgement must be JSON-encoded (not Protobuf encoded) when they serialized into packet data. Also note that uint256 is string encoded when converted to JSON, but must be a valid decimal number of the form [0-9]+.

It seems possible to me, the amount could have been encoded as a JSON number, so it would be nice to have a single document for each app which explains exactly how the encoding should be constructed