algovoi-retention-chain
Self-verifiable audit chain for payment receipts. Apache-2.0.
Each receipt carries a retention_chain_ref computed as:
retention_chain_ref = SHA-256(JCS({chain_seq, issuer_id, prev_receipt_hash, receipt_hash}))
Any party holding a receipt set can verify chain integrity by recomputing the reference from locally held data alone. No AlgoVoi infrastructure, registry lookup, or network access required.
Satisfies transaction-recording and audit-trail obligations under MiCA Art. 68(9), DORA Art. 17, and AMLR Art. 77. Normative spec: draft-hopley-x402-retention-chain (IETF Independent Submission — latest revision).
Install
pip install algovoi-retention-chain
Usage
from algovoi_retention_chain import retention_chain_ref, verify_chain_sequence
# Compute a chain ref for an authorized charge
ref = retention_chain_ref(
prev_receipt_hash="", # "" for the genesis (first) charge
receipt_hash="sha256:<64-hex>", # SHA-256 of your receipt payload
chain_seq=0,
issuer_id="mandate:acct-123", # scope per mandate / account
)
# ref = "sha256:<64-hex>" — embed in the receipt; any holder can recompute it
# Verify a full sequence offline
chain = [
{"chain_seq": 0, "issuer_id": "mandate:acct-123",
"prev_receipt_hash": "", "receipt_hash": "sha256:...", "chain_ref": "sha256:..."},
{"chain_seq": 1, ...},
]
assert verify_chain_sequence(chain)
Conformance vectors
Canonical test vectors (v0 and v1) are published at
chopmob-cloud/algovoi-jcs-conformance-vectors,
verified byte-for-byte across Python, TypeScript, Go, Rust, Ruby, C#, Java, and Kotlin (2026-06-17).
The v1 set covers three invariant classes:
- Part A — 6-link extended chain (seq 0–5, single issuer)
- Part B — multi-issuer isolation (same receipt, different
issuer_id→ differentchain_ref) - Part C — seq-gap adversarial pair (correct vs tampered
prev_receipt_hash→ differentchain_ref)
Use these in your test suite to prove interoperability. If you embed at least one canonical hash in your conformance tests, you qualify for the Adopters programme below.
Adopters — free mandate auditor key
If you build on algovoi-retention-chain and meet the criteria below, you qualify
for a free v0 licence key for algovoi-mandate-auditor
— AlgoVoi's production-grade MiCA/DORA compliance audit service for payment mandate charge chains.
Qualification criteria:
algovoi-retention-chaindeclared as a dependency, pinned to a specific version (==0.1.0)- At least one canonical vector hash from
retention_chain_v0orretention_chain_v1appears in your conformance tests — proving you verified against the canonical vectors, not a reimplementation - A
NOTICEfile in your project preserving the Apache-2.0 attribution
To apply: email chopmob@gmail.com with your project's dependency file, a snippet showing
the canonical hash in your test suite, and a copy of your NOTICE file. If all criteria are met,
a v0 key is issued within one business day. The key is valid for 12 months and gives access to
build_audit_report and the HTTP audit service — verify_audit_report is always free with no
key required.
HTTP service
pip install "algovoi-retention-chain[serve]"
RETENTION_CHAIN_BIND=0.0.0.0:8096 algovoi-retention-chain
# POST /v1/chain-ref POST /v1/verify-link POST /v1/verify-sequence GET /health
Control-plane federation
The substrate is self-verifiable and needs no issuer trust set to function, but it
integrates with the substrate-2 control plane via hub_client.py. Set S2_HUB_URL
(and S2_HUB_TOKEN to self-register, POST <hub>/v1/services) and the service
announces itself so it appears in the control-plane posture alongside the other
substrate-2 services. S2_HUB_NAME / S2_HUB_SELF_URL override the registered
name and callback URL. A Compliance Command Center bridge is available additively
via the CCC_HUB_* environment.
Acceptance
python scripts/acceptance.py # exit 0 + "ALL GREEN"
Licence
Apache-2.0. See LICENSE and NOTICE.
Metadata
Release files for algovoi-retention-chain 0.4.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| algovoi_retention_chain-0.4.5.tar.gz | 16.0 kB | Without provenance | Details for algovoi_retention_chain-0.4.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| algovoi_retention_chain-0.4.5-py3-none-any.whl | Python 3 | none | any | Details for algovoi_retention_chain-0.4.5-py3-none-any.whl |
Total release size: 34.5 kB
Release files / algovoi_retention_chain-0.4.5.tar.gz
| Download URL | algovoi_retention_chain-0.4.5.tar.gz |
|---|---|
| Size | 16.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5e2d471b957a69cc6c27b0f9536c1d906f6cc03621759e6609d7959691fb6ab8
|
|
BLAKE2b-256 checksum How to use checksums |
762c0d58bf7f096e4d7c19b74e50e395a6af4bc18ad8af0502334c22116b74ab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.10
|
Release files / algovoi_retention_chain-0.4.5-py3-none-any.whl
| Download URL | algovoi_retention_chain-0.4.5-py3-none-any.whl |
|---|---|
| Size | 18.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0064ac0b506be45e1534dccb21b4ef39ce2338afbd0957b28f80b7d90eab6e0c
|
|
BLAKE2b-256 checksum How to use checksums |
0f4c7ce180ef0df7f2abb5ad65fb4b2a45f8dd44ee4a0261386acb06abe45646
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.10
|
Security for algovoi-retention-chain 0.4.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.