spt-txn-poc

module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 8, 2026 License: Apache-2.0

README

SPT-Txn — Privacy-Preserving Compliance & Travel Rule Authorization (Reference POC)

CI  Apache-2.0 · Go 1.25 / gnark v0.15 · OpenBSD · live demo: https://foss.violetskysecurity.com

SPT-Txn verifies compliance once and proves it everywhere, in zero knowledge — so regulated institutions and VASPs can transact, tokenise, and settle on-chain without exposing PII. A user holds a Compliance Attestation Token (CAT) (a W3C Verifiable Credential bound to a zero-knowledge identity commitment, zkDID/humanAnchor); a platform checks a ZK proof of the CAT against a policy and issues a scope-bounded Capability Token (CT); each action emits a transaction-bound SPT-Txn token. For inter-VASP transfers it carries a payload-level FATF Travel Rule ZK attestation. No PII on the wire; no native token; blockchain-agnostic (XRPL is the primary integration target).

Status: working, security-audited reference implementation — not a skeleton, and not yet production. Deployed and running on a hardened OpenBSD host with a live two-party Travel Rule demo. Twenty chain adapters; attestation-anchor contracts live on four public testnets; an on-chain ZK verifier live on two L2s; the agentic delegation layer is POC-built, tested, and now provable in zero knowledge. See docs/STATUS for the current-state map, docs/RUNBOOK.md to reproduce the deployments, and the roadmap below for what production still needs.

What's built and running

  • Real zero-knowledge — Groth16/BN254 circuits (identity commitment, amount-over-threshold, VASP membership), not stubs. Hash migrated MiMC → Poseidon2 (benchmarked: −44 % constraints, −41 % prove). internal/zkproof, internal/zkhash, cmd/zk-setup, cmd/zk-bench.
  • Live FATF Travel Rule — IVMS101 + selective-disclosure SD-JWT + the three ZK predicates, carried over the OpenVASP Travel Rule Protocol (TRP) between two separate VASP services (originator proves, beneficiary verifies with the verifying key only). Cleartext-only transfers refused. internal/travelrule, internal/trp, internal/ivms101, internal/vaspregistry, cmd/tr-svc.
  • The token chain — CAT → CT → SPT-Txn with scope attenuation, bounded delegation depth, immutable humanAnchor, 30 s transaction-bound tokens, DPoP sender-constraint, and the eight-step offline enforcement engine.
  • Security by design (OpenBSD) — real pledge(2)/unveil(2) sandboxing, privilege separation, relayd TLS, signify keys; a host-runnable audit at FAIL=0 (scripts/security-audit.sh). See docs/SECURITY-REVIEW.md.
  • Audit log with hash-chain + signed Merkle roots; escrow envelope for lawful deanonymization.
  • Post-quantum-hybrid escrow (implemented) — the escrow envelope seals identities under a hybrid X25519 + ML-KEM-768 KEM, closing the harvest-now-decrypt-later gap. Plus EO-14409 readiness: a CycloneDX Cryptographic Bill of Materials (docs/cbom.json, docs/CBOM.md) and a lifetime-triaged PQ migration plan.
  • Blockchain-agnostic, multi-chain — one Ledger adapter interface binds an authorization to a transaction across twenty chains — a single EVM adapter serves the EVM L1s and L2s — all tested (see docs/STATUS.md for the full list). internal/ledger. Chains are integration targets, never dependencies.
  • Live on-chain footprints — attestation-anchor contracts on Ethereum Sepolia, Starknet Sepolia, Aptos testnet, and Arbitrum Sepolia (plus a Solana devnet memo anchor), each holding a genuine token-derived ContextHash. cairo/, move/, solidity/, cmd/anchor.
  • On-chain ZK verification — a gnark Groth16 verifier + AttestationVerifier wrapper verify a selective-disclosure proof (amount ≥ threshold, amount hidden) on-chain and anchor only if it checks out — live on Ethereum and Arbitrum Sepolia. cmd/zk-export-solidity, cmd/zk-solcalldata, solidity/src/.
  • Agentic authorization (POC-tested) + ZK chain proof — multi-hop CT→CT delegation, an offline N-hop verifier, a granular revocation cascade, and a Groth16 ChainCircuit that proves a delegation chain valid (attenuation, depth, human-anchor) without revealing intermediate scopes, with an opt-in, gnark-free verifier seam. internal/cttoken, internal/verifier, internal/zkproof, cmd/agentdemo, cmd/agentsvc. Designed to enforce inside an MCP server as a policy-enforcement point and across A2A hops — restoring the human-origin chain that MCP's own token-passthrough rule otherwise severs.
  • Scoped-disclosure SDK + schema — a request → consent → response protocol for time-limited, scope-selected selective disclosure (discloses only requested ∩ consented). internal/disclosure, docs/DISCLOSURE-SCHEMA.md.

Documentation

Repository layout

cmd/ services + tools (tr-svc, agentsvc, catsvc, trsvc, agentdemo, anchor, zk-setup, zk-export-solidity, zk-solcalldata, zk-bench, regkey, mksubject) · internal/ libraries (ledger, zkproof, zkhash, zkdid, disclosure, travelrule, trp, ivms101, vaspregistry, sdjwt, dpop, escrow, verifier, trustregistry, cattoken, cttoken, txntoken, tbac, …) · cairo/, move/, solidity/ (on-chain attestation-anchor + ZK verifier contracts) · docs/ · scripts/ (security-audit, rc services, register-issuers) · configs/ · web/ (the foss.violetskysecurity.com site source).

Terminology anchors to W3C Verifiable Credentials / DID Core, SD-JWT, OAuth Transaction Tokens (draft-coetzee-oauth-spt-txn-tokens), DPoP (RFC 9449), NIST SP 800-207/162, FIPS 203/204, FATF Rec 16 / IVMS101. Live: https://foss.violetskysecurity.com. Preprints: Zenodo 10.5281/zenodo.20870193 (framework paper v2), 10.5281/zenodo.19299787 (theory), 10.5281/zenodo.18917439 (framework v1).

Build & test

Go 1.25+, gnark v0.15. The reference deployment runs on OpenBSD; the Go code is OS-portable (the pledge/unveil layer is behind build tags, with a no-op for non-OpenBSD). go build ./...; go test ./internal/.... ZK setup writes circuit keys via cmd/zk-setup.

Roadmap (honest)

Not production-ready. Agentic AI authorization is now POC-built and tested (multi-hop delegation, offline N-hop verification, granular revocation cascade) and provable in zero knowledge: the ChainCircuit verifies each active hop's registered-issuer signature in-circuit (Baby Jubjub EdDSA), alongside attenuation, depth, and the human anchor — though not yet battle-tested at scale. Honest gaps that remain: on-chain footprints are testnet (mainnet anchoring + the on-chain ZK verifier on mainnet are the next step); the open append-only anchor contracts would want access control or a fee on mainnet; biometric uniqueness is a placeholder; the .zkdid/.zkdns production identity/naming layer is an integration (interim works today); the escrow's post-quantum-hybrid KEM (X25519 + ML-KEM-768) is implemented, while broader PQ migration of TLS and signatures is designed, not yet implemented; and an independent ZK-circuit + protocol audit is wanted (the Arbitrum Audit Fund can subsidize). See docs/STATUS.md and the grant docs for the funded plan.

License

Apache-2.0 (see LICENSE and NOTICE). All dependencies are permissive (Apache-2.0 / BSD / MIT / ISC); no copyleft. Copyright 2026 Rudolf J. Coetzee / Violet Sky Security SEZC.

Directories

Path Synopsis
cmd
agent command
Command agent is the autonomous payer in the agentic-x402 demo (P1).
Command agent is the autonomous payer in the agentic-x402 demo (P1).
agentdemo command
Command agentdemo is a runnable, offline demonstration of SPT-Txn agentic authorization (Milestone 7).
Command agentdemo is a runnable, offline demonstration of SPT-Txn agentic authorization (Milestone 7).
agentsvc command
cmd/agentsvc — agentic authorization VERIFY service (Milestone 7).
cmd/agentsvc — agentic authorization VERIFY service (Milestone 7).
anchor command
Command anchor closes the loop between an SPT-Txn token and an on-chain attestation anchor.
Command anchor closes the loop between an SPT-Txn token and an on-chain attestation anchor.
auditverify command
Command auditverify independently re-checks an SPT-Txn audit log: it recomputes the hash chain end-to-end and the SHA-256 Merkle root over all entries, and (optionally) compares that root to a value anchored on-chain.
Command auditverify independently re-checks an SPT-Txn audit log: it recomputes the hash chain end-to-end and the SHA-256 Merkle root over all entries, and (optionally) compares that root to a value anchored on-chain.
catsvc command
cmd/catsvc — Compliance Attestation Token issuer service.
cmd/catsvc — Compliance Attestation Token issuer service.
conformance command
Command conformance emits (and re-checks) deterministic SPT-Txn conformance vectors: the canonical spt_txn_context_hash for a fixed transaction on each chain, and the humanAnchor commitment for fixed identity material.
Command conformance emits (and re-checks) deterministic SPT-Txn conformance vectors: the canonical spt_txn_context_hash for a fixed transaction on each chain, and the humanAnchor commitment for fixed identity material.
deanondemo command
Command deanondemo demonstrates SPT-Txn accountable anonymity (P3): the real human identity behind a transaction is sealed at issuance into a PQ-hybrid escrow envelope, never appears on-chain, and is recoverable ONLY by the escrow authority under a signed, lawful-basis request.
Command deanondemo demonstrates SPT-Txn accountable anonymity (P3): the real human identity behind a transaction is sealed at issuance into a PQ-hybrid escrow envelope, never appears on-chain, and is recoverable ONLY by the escrow authority under a signed, lawful-basis request.
deanonsvc command
cmd/deanonsvc — escrow deanonymization service for the SPT-Txn POC.
cmd/deanonsvc — escrow deanonymization service for the SPT-Txn POC.
escrowkeygen command
cmd/escrowkeygen — generate a hybrid escrow keypair (X25519 + ML-KEM-768).
cmd/escrowkeygen — generate a hybrid escrow keypair (X25519 + ML-KEM-768).
gatesvc command
Command gatesvc exposes the SPT-Txn x402 authorization gate as a small local HTTP service — the AUTHORITY in the x402 loop (P1 of the agentic-x402 demo).
Command gatesvc exposes the SPT-Txn x402 authorization gate as a small local HTTP service — the AUTHORITY in the x402 loop (P1 of the agentic-x402 demo).
loadbench command
Command loadbench measures the throughput and latency of the SPT-Txn hot path, so an integrator (e.g.
Command loadbench measures the throughput and latency of the SPT-Txn hot path, so an integrator (e.g.
merchantsvc command
Command merchantsvc is a metered resource server that speaks x402 AND cryptographically verifies the SPT-Txn attestation before delivering — P2 of the agentic-x402 demo.
Command merchantsvc is a metered resource server that speaks x402 AND cryptographically verifies the SPT-Txn attestation before delivering — P2 of the agentic-x402 demo.
mksubject command
cmd/mksubject — issue a wallet "subject token" (identity assertion) signed by the ct_issuer signify key.
cmd/mksubject — issue a wallet "subject token" (identity assertion) signed by the ct_issuer signify key.
regkey command
cmd/regkey — Register real signify public keys in the Trust Registry.
cmd/regkey — Register real signify public keys in the Trust Registry.
tr-svc command
cmd/tr-svc — live SPT-Txn Travel Rule service (privacy-preserving FATF Rec 16).
cmd/tr-svc — live SPT-Txn Travel Rule service (privacy-preserving FATF Rec 16).
trsvc command
cmd/trsvc — Trust Registry HTTP service for the SPT-Txn POC.
cmd/trsvc — Trust Registry HTTP service for the SPT-Txn POC.
x402gate command
Command x402gate is a proof-of-concept payer-side gate for x402 agentic payments on the XRP Ledger.
Command x402gate is a proof-of-concept payer-side gate for x402 agentic payments on the XRP Ledger.
zk-bench command
cmd/zk-bench — isolated ZK primitive benchmark for the SPT-Txn v2 crypto choice.
cmd/zk-bench — isolated ZK primitive benchmark for the SPT-Txn v2 crypto choice.
zk-export-solidity command
Command zk-export-solidity generates a Solidity Groth16 verifier for one of the SPT-Txn ZK circuits, so an Ethereum / EVM L2 contract can verify an SPT-Txn selective-disclosure proof on-chain.
Command zk-export-solidity generates a Solidity Groth16 verifier for one of the SPT-Txn ZK circuits, so an Ethereum / EVM L2 contract can verify an SPT-Txn selective-disclosure proof on-chain.
zk-setup command
cmd/zk-setup — one-time trusted setup for the SPT-Txn ZK Travel Rule circuits.
cmd/zk-setup — one-time trusted setup for the SPT-Txn ZK Travel Rule circuits.
zk-solcalldata command
Command zk-solcalldata produces the calldata for AttestationVerifier.anchorVerified: it generates a real threshold proof (amount >= threshold, with the amount hidden), then prints the proof bytes, the public inputs [commitment, threshold], and a ready-to-run cast command.
Command zk-solcalldata produces the calldata for AttestationVerifier.anchorVerified: it generates a real threshold proof (amount >= threshold, with the amount hidden), then prints the proof bytes, the public inputs [commitment, threshold], and a ready-to-run cast command.
internal
audit
Package audit implements the SPT-Txn append-only audit log with periodic signed Merkle-root publication — Milestone 6.
Package audit implements the SPT-Txn append-only audit log with periodic signed Merkle-root publication — Milestone 6.
cattoken
Package cattoken implements Compliance Attestation Token (CAT) issuance for the SPT-Txn POC.
Package cattoken implements Compliance Attestation Token (CAT) issuance for the SPT-Txn POC.
cttoken
Package cttoken implements Capability Token (CT) issuance for the SPT-Txn POC — Milestone 3.
Package cttoken implements Capability Token (CT) issuance for the SPT-Txn POC — Milestone 3.
disclosure
Package disclosure is the SPT-Txn scoped-disclosure SDK: a small request → consent → response protocol for time-limited, scope-selected selective disclosure over an SD-JWT credential.
Package disclosure is the SPT-Txn scoped-disclosure SDK: a small request → consent → response protocol for time-limited, scope-selected selective disclosure over an SD-JWT credential.
dpop
Package dpop implements a POC subset of DPoP (RFC 9449) for SPT-Txn M4.
Package dpop implements a POC subset of DPoP (RFC 9449) for SPT-Txn M4.
escrow
Package escrow implements the SPT-Txn Section 9.6 escrow envelope and deanonymization flow — Milestone 7.
Package escrow implements the SPT-Txn Section 9.6 escrow envelope and deanonymization flow — Milestone 7.
gate
Package gate encapsulates the SPT-Txn x402 payer-side authorization decision: given an agent's standing capability (a ceiling) and a specific payment requirement, it mints the CAT -> CT -> SPT-Txn chain for that exact payment and runs the eight-step offline verifier, returning ALLOW/DENY plus the on-ledger stamp fields (Destination, Amount, SourceTag, Memo = humanAnchor, context hash) and the attestation token.
Package gate encapsulates the SPT-Txn x402 payer-side authorization decision: given an agent's standing capability (a ceiling) and a specific payment requirement, it mints the CAT -> CT -> SPT-Txn chain for that exact payment and runs the eight-step offline verifier, returning ALLOW/DENY plus the on-ledger stamp fields (Destination, Amount, SourceTag, Memo = humanAnchor, context hash) and the attestation token.
ivms101
Package ivms101 implements a FATF-aligned subset of the interVASP Messaging Standard 101 (IVMS101) — the data model TRISA and TRP use for Travel Rule payloads.
Package ivms101 implements a FATF-aligned subset of the interVASP Messaging Standard 101 (IVMS101) — the data model TRISA and TRP use for Travel Rule payloads.
ledger
Package ledger is the blockchain-agnostic adapter boundary for SPT-Txn.
Package ledger is the blockchain-agnostic adapter boundary for SPT-Txn.
negotiate
Package negotiate solves the Travel Rule "sunrise problem": two CASPs that must exchange Travel Rule information may not support the same payload privacy level.
Package negotiate solves the Travel Rule "sunrise problem": two CASPs that must exchange Travel Rule information may not support the same payload privacy level.
regdisclosure
Package regdisclosure assembles a minimal, verifiable disclosure package for a competent authority (a lawful TFR/MiCA recordkeeping request) WITHOUT exposing more than the legal basis allows.
Package regdisclosure assembles a minimal, verifiable disclosure package for a competent authority (a lawful TFR/MiCA recordkeeping request) WITHOUT exposing more than the legal basis allows.
tbac
Package tbac implements the Token-Bound Access Control scope logic for the SPT-Txn POC.
Package tbac implements the Token-Bound Access Control scope logic for the SPT-Txn POC.
tfrpolicy
Package tfrpolicy is a configurable decision engine for the EU Transfer of Funds Regulation (Reg (EU) 2023/1113) "missing-information" procedures: a CASP must have a risk-based policy for what to do when an incoming transfer lacks required originator/beneficiary information, comes from an unregistered counterparty, or involves a self-hosted wallet above the verification threshold.
Package tfrpolicy is a configurable decision engine for the EU Transfer of Funds Regulation (Reg (EU) 2023/1113) "missing-information" procedures: a CASP must have a risk-based policy for what to do when an incoming transfer lacks required originator/beneficiary information, comes from an unregistered counterparty, or involves a self-hosted wallet above the verification threshold.
travelrule
Package travelrule assembles the privacy-preserving FATF Travel Rule attestation for SPT-Txn.
Package travelrule assembles the privacy-preserving FATF Travel Rule attestation for SPT-Txn.
trisa
Package trisa bridges an SPT-Txn Travel Rule attestation to/from a TRISA SecureEnvelope payload, so a SPT-Txn node can exchange with a TRISA counterparty (TRP support already lives in internal/trp).
Package trisa bridges an SPT-Txn Travel Rule attestation to/from a TRISA SecureEnvelope payload, so a SPT-Txn node can exchange with a TRISA counterparty (TRP support already lives in internal/trp).
trp
Package trp is an OpenVASP Travel Rule Protocol (TRP) transport for SPT-Txn.
Package trp is an OpenVASP Travel Rule Protocol (TRP) transport for SPT-Txn.
trustregistry
Package trustregistry defines the abstraction over issuer key resolution for the SPT-Txn POC.
Package trustregistry defines the abstraction over issuer key resolution for the SPT-Txn POC.
txntoken
Package txntoken implements SPT-Txn Token issuance for the POC — Milestone 4.
Package txntoken implements SPT-Txn Token issuance for the POC — Milestone 4.
vaspregistry
Package vaspregistry is the registered-VASP set: a config-loaded list of VASP identifiers committed to a MiMC Merkle tree (internal/zkproof), with a signed root so the originator and beneficiary can confirm they share the same registry.
Package vaspregistry is the registered-VASP set: a config-loaded list of VASP identifiers committed to a MiMC Merkle tree (internal/zkproof), with a signed root so the originator and beneficiary can confirm they share the same registry.
verifier
Package verifier implements the SPT-Txn eight-step enforcement engine (Section 3.3 of draft-coetzee-oauth-spt-txn-tokens) — Milestone 5.
Package verifier implements the SPT-Txn eight-step enforcement engine (Section 3.3 of draft-coetzee-oauth-spt-txn-tokens) — Milestone 5.
walletproof
Package walletproof implements proof-of-control for self-hosted (unhosted) wallets — the verification the EU Transfer of Funds Regulation requires for transfers to/from a self-hosted wallet at or above €1000: the CASP must establish that its customer owns or controls the address.
Package walletproof implements proof-of-control for self-hosted (unhosted) wallets — the verification the EU Transfer of Funds Regulation requires for transfers to/from a self-hosted wallet at or above €1000: the CASP must establish that its customer owns or controls the address.
zkdid
Package zkdid implements the zkDID commitment function for SPT-Txn.
Package zkdid implements the zkDID commitment function for SPT-Txn.
zkhash
Package zkhash is the single source of truth for the SPT-Txn ZK-friendly hash over BN254.
Package zkhash is the single source of truth for the SPT-Txn ZK-friendly hash over BN254.
zkproof
Package zkproof provides the real Groth16 zero-knowledge circuits for the SPT-Txn privacy-preserving Travel Rule layer, validated on the OpenBSD host.
Package zkproof provides the real Groth16 zero-knowledge circuits for the SPT-Txn privacy-preserving Travel Rule layer, validated on the OpenBSD host.
pkg
verify
Package verify is the public, embeddable entry point to the SPT-Txn eight-step offline verifier.
Package verify is the public, embeddable entry point to the SPT-Txn eight-step offline verifier.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL