github.com/rudizee007/spt-txn-poc


License
Apache-2.0
Install
go get github.com/rudizee007/spt-txn-poc

Documentation

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).

Standards & links

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.