SDX Protocol

Test vectors

The published known-answer suites for specification v0.1: cbor-det-v1 pins the deterministic encoding profile byte for byte, and historical-float64-decode pins decode tolerance for records written before the integer-widening rule.

Normative. Reflects the specification as ratified on 1 September 2026. Version pinning is by date. Where this text and a published test vector disagree, the vector wins and the text is corrected.

Two suites are published for v0.1. Each is a single JSON file with a profile name, a spec paragraph stating the rule it pins, and a vectors array. Bytes are hex-encoded. The vector bytes are identical to the internal suite the reference implementation is tested against.

SuiteVectorsWhat it pinsFile
cbor-det-v136The deterministic encoding profile of The record envelope: map keys ordered by their encoded bytes, shortest-form integer heads, the refusal of integer inputs beyond the 53-bit safe range, and the erasure of type distinctions the encoding does not preserve.cbor-det-v1.json
historical-float64-decode8Decode tolerance. Byte strings the reference encoder produced before the integer-widening rule, when an integer needing an 8-byte head was written as a float64. Records anchored under that encoder are immutable, so a conforming decoder MUST still read them back to the integer shown.historical-float64-decode.json

Vector shape

In cbor-det-v1 each vector carries name, doc (the rule it exercises, with its RFC 8949 reference where one applies), input (a kind and a value) and encoded_hex, the exact bytes a conforming encoder MUST produce.

In historical-float64-decode each vector carries name, doc, historical_hex (the bytes as written by the pre-widening encoder) and decodes_to, the integer a conforming decoder MUST return. The suite was captured on 2026-08-11 from two independent sources agreeing byte for byte.

How to validate an implementation

  1. Fetch the suite and turn each input into your native value.
  2. Encode it under the deterministic profile.
  3. Compare the hex of your bytes with encoded_hex. Any difference is a conformance failure on that vector; the profile has no tolerance on the encode side.
  4. For the historical suite, decode historical_hex and compare with decodes_to. A decoder that refuses these bytes fails the suite.

Suites named in Section 6 but not yet published

docv2-envelope, dual-curve, placement, utxo-chaining, overlay-binding and cross-domain-refs are named in Section 6 of the specification and follow alongside the reference implementation, at this address. Until each is published, the normative sections fix the shape an implementation must match.

On this page