{
  "signing": "ed25519",
  "issuer": "https://agents.factstamp.dev",
  "alg": "Ed25519",
  "key_id": "2331751858f5e3b1",
  "public_key_jwk": {
    "kty": "OKP",
    "crv": "Ed25519",
    "x": "YYw5oucaGb5JndWDgVQh8ynZ2X8DOm6y1x7pl4IyNms",
    "use": "sig",
    "key_ops": [
      "verify"
    ]
  },
  "verify": "https://agents.factstamp.dev/verify",
  "note": "Verify offline: recompute the canonical payload (sorted keys, no whitespace) and check the Ed25519 signature over it with the public key whose key_id the receipt names, from `keys`. The receipt is proof of the issuer, the question, the verdict and the time — not of the underlying fact, which rests on the cited source. `receipt` below says where the receipt sits on each door and which members to drop before recomputing its `answer_hash`, in the same words every other surface uses. You do NOT have to derive a key_id to verify anything: the receipt names its `key_id`, `keys` is keyed by `key_id`, so look it up and verify with that entry's `public_key_jwk`. `key_id_rule` states exactly how we derive the id, with the bytes and the result, for anyone who wants to check the derivation itself.",
  "key_set_version": 1,
  "receipt": {
    "key_set": "/.well-known/factstamp-issuer.json",
    "canonicalization": "JSON with object keys sorted, no whitespace, strings written the way JSON.stringify writes them",
    "single_answer": {
      "doors": [
        "/check",
        "/entity",
        "/citation",
        "/package",
        "/bulk",
        "/audit"
      ],
      "receipt_member": "receipt",
      "strip": [
        "receipt",
        "receipt_note",
        "receipt_id",
        "receipt_url",
        "paid_with"
      ]
    },
    "probe": {
      "door": "/probe",
      "receipt_member": "answer.receipt",
      "strip": [
        "answer.receipt",
        "paid_with"
      ]
    },
    "multi_answer": {
      "doors": [
        "/document",
        "/watch",
        "/watch/portfolio"
      ],
      "receipt_member": "per unit, named by that unit's receipt_id; the receipt itself is at /r/<receipt_id>.json"
    }
  },
  "keys": [
    {
      "key_id": "2331751858f5e3b1",
      "public_key_jwk": {
        "kty": "OKP",
        "crv": "Ed25519",
        "x": "YYw5oucaGb5JndWDgVQh8ynZ2X8DOm6y1x7pl4IyNms",
        "use": "sig",
        "key_ops": [
          "verify"
        ]
      },
      "in_use_from": null,
      "in_use_to": null,
      "status": "current"
    }
  ],
  "key_id_rule": {
    "key_id_is": "`key_id` is the first 16 characters of the lowercase hex SHA-256 digest of the canonical JSON of the WHOLE `public_key_jwk` object — every member it publishes (`crv`, `key_ops`, `kty`, `use`, `x`) — not a subset such as `kty`/`crv`/`x` alone, not the `keys[]` entry it sits in, and not the enclosing document.",
    "object_hashed": "The `public_key_jwk` object exactly as it is published on this document — the same object, member for member, including `use` and `key_ops`. Which members that is: crv, key_ops, kty, use, x. Drop any one of them and the digest is a different id.",
    "members_hashed": [
      "crv",
      "key_ops",
      "kty",
      "use",
      "x"
    ],
    "canonicalisation": "Take the UTF-8 bytes of the JSON text of that one object, member names sorted ascending, with no whitespace between tokens, and strings written exactly the way JSON.stringify writes them — so `use` appears as \"sig\", `key_ops` as [\"verify\"], and there is no trailing newline.",
    "truncation": "The id is the first 16 characters of the 64-character lowercase hex digest — a 64-bit prefix of the digest, not the whole digest and not a base64 value.",
    "worked_example": {
      "canonical_bytes": "{\"crv\":\"Ed25519\",\"key_ops\":[\"verify\"],\"kty\":\"OKP\",\"use\":\"sig\",\"x\":\"YYw5oucaGb5JndWDgVQh8ynZ2X8DOm6y1x7pl4IyNms\"}",
      "key_id": "2331751858f5e3b1"
    },
    "check_it_yourself": "Paste `worked_example.canonical_bytes` into a file with NO trailing newline and run sha256sum on it (or printf '%s' '<bytes>' | sha256sum). Its first 16 hex characters must equal `worked_example.key_id`. A different answer means a subset of the object was hashed, or whitespace was added, or a newline was.",
    "buyers_do_not_derive": "YOU DO NOT NEED TO DERIVE THIS TO VERIFY A RECEIPT. The receipt names its `key_id`, and the `keys` array in this document is keyed by `key_id`: find the entry whose `key_id` matches the receipt's, take that entry's `public_key_jwk`, and check the Ed25519 signature over the receipt's own `canonical` bytes. Derivation is our internal guarantee that an id cannot drift from the key it names — it is not a step in the buyer's job, and nothing here asks anyone to call us back."
  }
}