Lineage Specification
Byte-identical canonical JSON across Python and TypeScript, with an explicit verify endpoint and truth boundary.
Documents how ScienceToStartup canonicalizes JSON preimages and computes lineage hashes for Paper Pack v2, Buildability Receipts, and Foresight predictions. Pinned against 20 byte-identical parity fixtures committed at packages/contracts/fixtures/lineage_canonical_fixtures.json.
A typical Paper Pack lineage preimage is a JSON object whose structure agents and operators can reproduce without trusting our server. Field ordering does not matter at the preimage level — the canonical encoder sorts keys before hashing.
Preimage (JSON)
{
"arxiv_id": "2401.00001",
"tier": 3,
"source_count": 11,
"lineage_hash": "sha256:0000000000000000000000000000000000000000000000000000000000000000"
}The canonicalization profile is rfc8785-json-canonicalization-scheme-ish-v1: object keys sorted by UTF-16 code-unit ordering, no whitespace, non-ASCII verbatim, integers without trailing zeros, no NaN/Infinity. Both Python and TypeScript runners produce byte-identical output.
Canonical UTF-8 bytes
{"arxiv_id":"2401.00001","lineage_hash":"sha256:0000000000000000000000000000000000000000000000000000000000000000","source_count":11,"tier":3}The sha256 digest of the canonical UTF-8 bytes is sha256:efb340301880b31af47faee8f834478a5729cc29b6f5f6ea43d3b08beebb9c31.
POST a preimage and a declared hash to /api/v1/lineage/verify. The route recomputes canonical JSON, returns the recomputed digest, and reports any signature, Merkle, or wave-anchor evidence that ships alongside.
curl
curl -X POST "https://sciencetostartup.com/api/v1/lineage/verify" \
-H "Content-Type: application/json" \
-d '{
"payload": {
"arxiv_id": "2401.00001",
"tier": 3,
"source_count": 11,
"lineage_hash": "sha256:0000000000000000000000000000000000000000000000000000000000000000"
},
"declared_hash": "sha256:efb340301880b31af47faee8f834478a5729cc29b6f5f6ea43d3b08beebb9c31"
}'Response shape
{
"version": "lineage_verify_v1",
"canonicalization_profile": "rfc8785-json-canonicalization-scheme-ish-v1",
"algorithm": "sha256",
"declared_hash": "sha256:<declared>",
"recomputed": "sha256:<recomputed>",
"match": true | false,
"canonical_json_byte_length": <integer>,
"attestation": {
"counts_as_g6_complete": false,
"verification_ready": <bool>,
"digest_match": <bool>,
"signature": { "present": <bool>, "verified": <bool>, "status": "...", "kid": null | string, "production_signature_claimed": <bool> },
"merkle": { "present": <bool>, "verified": false, "status": "missing | present_unverified" },
"wave_anchor": { "present": <bool>, "verified": false, "status": "missing | present_unverified" },
"missing_real_evidence": ["ed25519_signature", "merkle_inclusion_proof", "wave_anchor"]
},
"truth_boundary": {
"no_production_signature_claimed": true,
"no_merkle_inclusion_claimed": true,
"no_wave_completion_claimed": true,
"note": "..."
}
}