Visual RFC.
ALL RFCs / RFC 8949
Read the RFC ↗
RFC 8949 / MECHANISM GUIDE

Deterministic encoding

05

A protocol can require one chosen serialization among several valid encodings.

RFC 8949 · § 4.2EXAMPLE
3 / 3
03
Order map entries

For core deterministic encoding, key 100 (18 64) precedes key −1 (20), because 18 < 20 in hex. Keep each value paired with its key. Length-first ordering is a different profile (§4.2.3).

Deterministic encodingA protocol can require one chosen serialization among several valid encodings.Deterministic encodingCore deterministic: compare encoded key bytesInput: −1 → 2 [key 20] 100 → 1 [key 18 64]18 < 20 (hex)Output: 100 → 1 [key 18 64] −1 → 2 [key 20]Length-first would put −1 first; values stay pairedDeterministic ≠ signed or schema-valid

Key idea: Core deterministic encoding uses preferred shortest representations.

Terms

Look up a term in the glossary ↗

Rules & examples
  • Core deterministic encoding uses preferred shortest representations.
  • It disallows indefinite-length items and orders map keys by their deterministic encoded byte order.
  • Determinism does not itself provide signatures, schemas, or semantic validity.

Examples are illustrative. Consult the linked RFC and its errata for implementation details.

Sources
Protocol participantThreat or exceptionProtocol controlSimplified drawings · precise section references
New to this? Start hereA quick picture + helpful background

First, agree how to read the message.

An encoding tells a reader how to interpret bytes. A format tells it how values fit together. Correctly reading a value does not make that value trustworthy.

Helpful first, if these ideas are unfamiliar

These pictures are analogies to help you learn. The linked RFC explains the actual rules.

Related RFCs and changes

“Updates” changes part of an earlier RFC. “Obsoletes” replaces it. This list shows selected related documents.

All chapters in RFC 8949

Drawing view

Scroll the drawing to see every part. Playback controls stay above it.

RFC 9700 / CHAPTERS

Chapters

For full details, tables, algorithms, and exceptions, read the original RFC.

RFC status and corrections ↗