# The Forever Proof format — `sebbi-forever-proof/1`

**Status:** Published standard, version 1
**Editor:** Justin Dobson, Founder & Lead Systems Architect, sebbi.pro (Monop Content)
**Canonical address:** https://sebbi.pro/standard/forever-proof
**Licence:** this text is CC BY 4.0. The two reference verifiers are MIT.
**Implementations:** two independent ones, in Python and in JavaScript. Both pass every conformance vector in `vectors/conformance.json`.

The key words MUST, MUST NOT, SHOULD and MAY are used as in RFC 2119 and RFC 8174.

---

## 1. What a Forever Proof is

A Forever Proof is a small JSON document. It proves that one fingerprint existed before a particular Bitcoin block was mined. The fingerprint can be a file, a text, or a sealed AI decision.

The proof is complete in itself. Checking it needs only:

1. the proof document;
2. the Bitcoin blockchain, read from any source the checker trusts (including their own node); and
3. a verifier that follows this specification.

A verifier MUST NOT need anything from the party that issued the proof. **If the issuer disappears, every proof it ever issued stays checkable for as long as Bitcoin exists.** That is the purpose of this standard.

## 2. The document

A Forever Proof is a JSON object with at least these members:

| Member | Type | Meaning |
|---|---|---|
| `format` | string | MUST be exactly `sebbi-forever-proof/1`. |
| `subject` | object | What is being proven (section 3). |
| `leaf` | string | The exact string committed to the Merkle tree (section 3). |
| `merkle` | object | `index` (integer), `tree_size` (integer), `path` (array of 64-character hex strings) and `root` (64-character hex). |
| `bitcoin` | object | `proof_ots_base64`: a standard OpenTimestamps detached proof of the Merkle root, base64-encoded. |

Issuers MAY add other members, such as receipts, labels, explorer links or batch details. Verifiers MUST ignore members they do not understand. Those members MUST NOT affect the verdict.

## 3. Subjects and leaves

The `subject.kind` member decides how the leaf is formed. A verifier MUST recompute the leaf from the subject and MUST reject the proof if it differs from `leaf`.

### 3.1 `hash` — any file or data

* `subject.digest`: the SHA-256 of the data, as lowercase hex.
* Leaf: `sebbi-notary/1|` followed by `digest` in lowercase.
* If the checker supplies the original data, the verifier MUST hash it with SHA-256 and compare it with `digest`.

### 3.2 `humankeys` — words a person typed

* Text fingerprint: SHA-256 (as hex) of the UTF-8 encoding of the text after it is:
  1. normalised to Unicode NFC;
  2. changed so that CRLF and CR become LF;
  3. trimmed of leading and trailing whitespace.
* Leaf: `sebbi-humankeys/1|{code}|{text_hash}|{verdict}|{sealed_at}`, where `sealed_at` is a whole number of Unix seconds.

### 3.3 `chain_block` — a sealed AI decision

* The block hash is the SHA-256 of the JSON object `{event, prev_hash, result, ts}`, serialised with:
  * keys sorted;
  * `", "` and `": "` as separators;
  * non-ASCII characters escaped as `\uXXXX`.
* Leaf: the block hash (`subject.audit_hash`) as lowercase hex.
* If the checker supplies the block, the verifier MUST recompute its hash and compare it.

## 4. The Merkle tree

Leaves are batched in a binary Merkle tree as defined in RFC 6962 and RFC 9162:

* leaf hash = SHA-256(`0x00` ‖ UTF-8 leaf string);
* node hash = SHA-256(`0x01` ‖ left ‖ right).

The verifier MUST compute the root from the leaf hash, `index`, `tree_size` and `path`, using the algorithm in RFC 9162 section 2.1.3.2. It MUST reject the proof if:

* `index` is outside `0 ≤ index < tree_size`;
* the path is the wrong length; or
* the computed root differs from `merkle.root`.

## 5. The Bitcoin anchor

`bitcoin.proof_ots_base64` decodes to a standard OpenTimestamps detached proof (magic header, version 1, file-hash operation, digest, then the commitment tree). The verifier MUST:

1. check that the digest equals `merkle.root`;
2. replay every operation in the tree:
   * `sha256`, `sha1`, `ripemd160` and `keccak256`;
   * `append` and `prepend`;
   * `reverse` and `hexlify`;
3. reject the proof if:
   * there are unknown tags;
   * there are trailing bytes;
   * nesting is deeper than 256 levels; or
   * an intermediate message is longer than 4096 bytes;
4. for each Bitcoin attestation, take the attested message, reverse its bytes, and compare it with the Merkle root of the Bitcoin block at the attested height.

The verifier SHOULD let the checker choose where the block header comes from: their own node, explorers they choose, or a Merkle root they type in. If it uses explorers by default, it SHOULD ask more than one and MUST NOT pass the proof if any of them disagrees.

If the proof carries only pending (calendar) attestations, the verdict is **pending**. It is not a pass, and it is not a failure of the document.

## 6. The verdict

A proof is **verified** only when every step in sections 3 to 5 passes and at least one Bitcoin attestation matches. A verified proof establishes this, and nothing more: *the subject existed no later than the time of that Bitcoin block.*

## 7. Conformance

An implementation conforms if it reproduces every value in `vectors/conformance.json`. That file contains:

* hash vectors for the four hash functions;
* 45 Merkle inclusion vectors (trees of 1 to 9 leaves);
* subject vectors for `humankeys` and `chain_block`;
* nine whole-proof cases, including:
  * a real proof confirmed in Bitcoin block 976649;
  * eight tampered or wrong cases that MUST fail.

Run them with:

    node tests/conformance.mjs
    python3 tests/conformance.py

Implementers are invited to publish their own verifier and say that it conforms. No permission is needed.

## 8. Why this exists

Today most records of automated decisions are logs that the operator holds and can change. A Forever Proof moves the evidence out of the operator's hands, into an open format checked against a public ledger nobody controls. The format is open so that the proof never depends on its issuer, sebbi.pro included.
