Skip to main content

Canonical Package Format

Canonical package bytes are protocol truth.

Envelope

CanonicalPackageEnvelope fields are encoded in deterministic order:

  1. version
  2. package_root
  3. payload_root
  4. replay_root

Versioning

Version is explicit and decoded through PackageVersion { major, minor }. Unsupported versions are rejected.

Canonical encoding

All fixture and package bytes are generated by the canonical encoder in execution-core/src/codec/package_encode.rs.

Decode semantics

Decoding requires full byte consumption (decode_fully). Any trailing bytes, truncation, root mismatches, or malformed payload fails.

Replay and root preservation

replay_root, payload_root, and package_root in the envelope must match recomputed package values.

Round-trip guarantees

encode -> decode -> encode must produce identical bytes.