retention_chain_ref — a single hash computed from four fields the receipt already contains — that lets any party independently verify chain integrity with no network access and no AlgoVoi infrastructure.
Specified in IETF Internet-Draft draft-hopley-x402-retention-chain-00, sole AlgoVoi authorship. Cross-validated byte-for-byte across 8 implementations in 8 programming languages.
Commercial add-on. Available under the AlgoVoi Retention Chain commercial licence. Included as standard in every Substrate 2 licence. Contact chopmob@gmail.com to license the add-on standalone.
How it works
The chain reference is computed as:chain_seq, issuer_id, prev_receipt_hash, receipt_hash.
The genesis receipt has chain_seq = 0 and prev_receipt_hash = "". Every subsequent receipt increments chain_seq by 1 and sets prev_receipt_hash to the receipt_hash of the receipt immediately before it — not the previous chain ref, the previous receipt hash. This means an auditor with any subset of receipts can recompute and verify each link independently.
What an auditor can verify
| Auditor holds | What they can check |
|---|---|
| A single receipt | That the retention_chain_ref is internally consistent |
| A contiguous range | That no receipt was inserted, deleted, or reordered |
| A non-contiguous subset | That each held receipt is individually intact |
| All receipts, chain_seq 0 to N | Complete chain audit from genesis |
Regulatory mapping
| Obligation | Article | How the chain ref satisfies it |
|---|---|---|
| Transaction record integrity | MiCA Art. 80 | Any receipt can be re-verified years later from locally held data; no issuer callback required |
| ICT audit trail | DORA Art. 14 | chain_seq enforces ordering; hash linkage makes deletion detectable by any receipt-adjacent party |
| AML record retention | AMLR Art. 56 | A competent authority holding receipts can verify integrity without requesting further data from the obliged entity |
Cross-language conformance
The algorithm is specified at the byte level in the I-D and cross-validated across 8 independent implementations. Every implementation must produce identicalretention_chain_ref values for the same inputs.
| Language | Conformance status |
|---|---|
| Python | 22/22 tests pass |
| TypeScript | 22/22 tests pass |
| Go | 3/3 vectors verified |
| Ruby | 3/3 vectors verified |
| Rust | 3/3 vectors verified |
| C# (.NET) | 3/3 vectors verified |
| Java | 3/3 vectors verified |
| Kotlin | Vectors specified; runnable in any JVM/Gradle environment |
Conformance vectors (summary)
The three published vectors useissuer_id = "algovoi:test" and receipt hashes derived from known byte inputs.
| # | chain_seq | Expected chain_ref |
|---|---|---|
| 0 | 0 (genesis) | sha256:f15a1dcd03cc039204dff24619ff4815ad041ad8796b94f59d52252043d0d08f |
| 1 | 1 | sha256:7114dc39543710bf26d0a5825acddd915ffd51fb5b14503024f70fda403053d9 |
| 2 | 2 | sha256:d3bddca79477e6003cb6ef199897bffed185f5d785b4e7333f9b0585b2b81144 |
Relationship to the open substrate
The Retention Chain Substrate sits directly on top of the open JCS Canonicalisation Substrate. It uses the same RFC 8785 JCS canonicalization and SHA-256 primitives that the open substrate defines — no additional cryptographic dependencies.retention_chain_ref field in your receipts.
Substrate 2
The Retention Chain Substrate is included as standard in every Substrate 2 licence. Substrate 2 customers receive all 8-language implementations, the full verification library, and the regulatory compliance documentation at no additional cost. If you are licensing Substrate 2, the Retention Chain add-on is already included.Specification
The normative specification is IETF Internet-Draftdraft-hopley-x402-retention-chain-00 (AlgoVoi, sole authorship, 16 June 2026). The I-D defines:
- The exact preimage schema and field constraints
- The JCS canonicalization requirement (RFC 8785 normative reference)
- Chain construction rules (genesis condition, link ordering)
- Single-link and sequence verification procedures
- The three conformance vectors with exact canonical byte sequences
- Regulatory applicability analysis (MiCA Art. 80, DORA Art. 14, AMLR Art. 56)
- Security considerations (collision resistance, subset auditability, truncation, issuer isolation)