Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Packet Spec: Hash App data rather than standardizing encoding #1152

Merged
merged 9 commits into from
Nov 11, 2024
Prev Previous commit
Next Next commit
change id to channel
  • Loading branch information
AdityaSripal committed Oct 9, 2024
commit 0c2f344bbe5f9cd7225ceed9d278196dd5388273
29 changes: 12 additions & 17 deletions spec/core/v2/ics-004-packet-semantics/PACKET.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@ The IBC packet sends application data from a source chain to a destination chain

```typescript
interface Packet {
// identifier on the source chain
// that source chain uses to address dest chain
// this functions as the sending address
sourceIdentifier: bytes,
// identifier on the dest chain
// that dest chain uses to address source chain
// this functions as the return address
destIdentifier: bytes,
// identifier for the channel on source chain
// channel must contain identifier of counterparty channel
// and the client identifier for the client on source chain
// that tracks dest chain
sourceChannel: bytes,
// identifier for the channel on dest chain
// channel must contain identifier of counterparty channel
// and the client identifier for the client on dest chain
// that tracks source chain
destChannel: bytes,
// the sequence uniquely identifies this packet
// in the stream of packets from source to dest chain
sequence: uint64,
Expand Down Expand Up @@ -47,20 +49,13 @@ interface Payload {
// the strucure expected given the version provided
// if the encoding is not supported, receiving application
// must be rejected with an error acknowledgement.
encoding: Encoding,
// the encoding string MUST be in MIME format
encoding: string,
// appData is the opaque content sent from the source application
// to the dest application. It will be decoded and interpreted
// as specified by the version and encoding fields
appData: bytes,
}

enum Encoding {
NO_ENCODING_SPECIFIED,
PROTO_3,
JSON,
RLP,
BCS,
}
```

The source and destination identifiers at the top-level of the packet identifiers the chains communicating. The source identifier **must** be unique on the source chain and is a pointer to the destination chain. The destination identifier **must** be a unique identifier on the destination chain and is a pointer to the source chain. The sequence is a monotonically incrementing nonce to uniquely identify packets sent between the source and destination chain.
Expand Down