Conformance
A standard is only a standard if two independent implementations agree. This page fixes the exact rules and gives you the test vectors, a standalone verifier and a JavaScript verifier that all give the same answers.
What is signed is the receipt core: every field except signature_ed25519 and public_key, serialized in one exact way so any language reproduces the same bytes.
\uXXXX escape (characters above U+FFFF as surrogate pairs). Quote and backslash are written \" and \\; control characters as \b \f \n \r \t or \u00XX."12.50") and avoid floats and exponents.content_hash is sha256: plus the hex SHA-256 of the canonical form of the action.This equals Python's json.dumps(obj, sort_keys=True, separators=(",", ":"), ensure_ascii=True), which is what the reference issuer uses.
11 vectors generated from the reference issuer. A conforming verifier reproduces every outcome. Download test-vectors.json.
| Vector | What it tests | Expected |
|---|---|---|
valid_ascii | A plain valid Seal binding an ASCII action. | valid |
valid_non_ascii | Accents and an emoji in the action: the verifier must escape them exactly as the reference does. | valid |
valid_integral_float | An integral float (100.0): the verifier must keep the number exactly as written. | valid |
valid_with_oversight | A Level 2 Seal carrying the signed oversight evidence object. | valid |
valid_refusal | A refusal is also a valid, signed decision. | valid |
tampered_decision | The decision was changed after signing. | must FAIL |
tampered_approver | The approver was changed after signing. | must FAIL |
tampered_oversight | A forged fast decision time inside the signed oversight evidence. | must FAIL |
swapped_action | The signature is valid but the action presented is not the one that was approved. | must FAIL |
unsigned | No signature present. | must FAIL |
wrong_key | The signature was made by a different key than the one the receipt names. | must FAIL |
node run-vectors.js test-vectors.json
# needs hs-verify.js beside it (or in ../assets)
pip install cryptography
python3 hs_verify.py --vectors test-vectors.json
Or open the browser verifier and pick any vector from the dropdown to watch a tampered or swapped Seal fail.
100.0, because it canonicalized differently from the reference issuer. The verifier now reproduces the reference exactly and the vectors guard against the whole class of bug.