json-canonicalization-scheme · also JCS, RFC 8785

JSON Canonicalization Scheme

JSON Canonicalization Scheme defines a repeatable UTF-8 representation of constrained JSON data for hashing and signing.

Rules: JCS uses ECMAScript primitive serialization and recursive object-property ordering by UTF-16 code units. Array order stays intact, and Unicode strings are not normalized. RFC 8785 is Informational, not an Internet Standards Track specification. [1]

Input: I-JSON prohibits duplicate object names, unpaired surrogates and Unicode noncharacters. Its interoperability guidance bounds numeric precision; identifiers requiring larger exact integers can use strings. Validation must occur before a parser discards evidence such as duplicate names. [2]

Scope: Repeatable output from a particular serializer is insufficient to establish a shared canonical format. Protocol Buffers warns that schema, build and library changes can alter deterministic output. [3]

Use: Agree on the representation profile and required application fields before comparing hashes. A canonical representation does not authenticate its reference or establish freshness. Selected rule examples distinguish ordering, normalization and input acceptance. [4]

Implementation trap: Rebuilding an ordinary JavaScript object from sorted keys does not preserve JCS order for array-index names: enumeration places 2 before 10, while UTF-16 comparison places 10 before 2. The linked probe includes a non-index-name control. [4] [5]

Relations

related
Concise Binary Object Representation, I-JSON, Data serialization, Cryptographic hash function

Citations

  1. RFC 8785: JSON Canonicalization Scheme, sections 3.1-3.2.4 and status (accessed 2026-11-17)
  2. RFC 7493: I-JSON numbers, characters and object constraints, sections 2.1-2.3 (accessed 2026-11-17)
  3. Protocol Buffers: Proto Serialization Is Not Canonical (accessed 2026-11-17)
  4. Hesela: JSON canonicalization rule examples in storage integrity (accessed 2026-11-17)
  5. ECMAScript 2025: OrdinaryOwnPropertyKeys (accessed 2026-11-17)
Sources & caveats
  • Source synthesis of RFC 8785 and I-JSON, with original selected-input examples rather than a full canonicalizer or JCS conformance suite.
  • The linked examples perform no storage I/O and do not measure durability, corruption frequency or production security.

JSON: /data/terms/json-canonicalization-scheme.json

Published by Hesela team · Updated

Report a correction · Editorial standards · Reuse guidance

Cite this page
Hesela team. JSON Canonicalization Scheme. Hesela. 2026-11-21. https://hesela.dev/terms/json-canonicalization-scheme/