{"_id":"@algovoi/settlement-attestation","_rev":"2-37b827d1456abef6026f46566731fcc8","name":"@algovoi/settlement-attestation","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@algovoi/settlement-attestation","version":"0.1.0","keywords":["x402","ap2","a2a","mpp","jcs","rfc8785","canonicalisation","agentic-payments","settlement","xchain","audit-chain","mica","psd2"],"author":{"name":"AlgoVoi","email":"chopmob@gmail.com"},"license":"Apache-2.0","_id":"@algovoi/settlement-attestation@0.1.0","maintainers":[{"name":"algovoi","email":"chopmob@gmail.com"}],"homepage":"https://github.com/chopmob-cloud/algovoi-settlement-attestation","bugs":{"url":"https://github.com/chopmob-cloud/algovoi-settlement-attestation/issues"},"dist":{"shasum":"d3cc97539b116bac274e584bc589fcba4cca1ca0","tarball":"https://registry.npmjs.org/@algovoi/settlement-attestation/-/settlement-attestation-0.1.0.tgz","fileCount":7,"integrity":"sha512-9S6ne1Dls4zntYSrEk4TnH9G8VNj/asojV86rFMi0/YKCogw8dQAiGGH2gkDr3zqhyY+OjnL6Kq2LyCaOFUW7w==","signatures":[{"sig":"MEUCID27mTUgQKNwQ7qcMXMeauwVwtmqnEUn//9ORSs4P1bZAiEApN2naVazY3ErUqzjKJZmL9ETvf4gp5B/hdlPVxJyTKI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":17345},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"97a6058f4cd00e141a58965929fa4b1050d2674b","scripts":{"test":"vitest run","build":"tsc","clean":"rimraf dist","test:watch":"vitest","prepublishOnly":"npm run clean && npm run build && npm test"},"_npmUser":{"name":"algovoi","email":"chopmob@gmail.com"},"repository":{"url":"git+https://github.com/chopmob-cloud/algovoi-settlement-attestation.git","type":"git","directory":"typescript"},"_npmVersion":"11.6.2","description":"AlgoVoi settlement attestation format reference implementation -- multi-chain categorical attestation under urn:x402:canonicalisation:jcs-rfc8785-v1, companion to @algovoi/substrate compliance and refund receipts","directories":{},"_nodeVersion":"24.12.0","dependencies":{"@algovoi/substrate":"^0.3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"rimraf":"^5.0.0","vitest":"^1.6.0","typescript":"^5.4.0","@types/node":"^20.0.0"},"_npmOperationalInternal":{"tmp":"tmp/settlement-attestation_0.1.0_1779660990694_0.1974651517564916","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@algovoi/settlement-attestation","version":"0.1.1","description":"AlgoVoi settlement attestation format reference implementation -- multi-chain categorical attestation under urn:x402:canonicalisation:jcs-rfc8785-v1, companion to @algovoi/substrate compliance and refund receipts","keywords":["x402","ap2","a2a","mpp","jcs","rfc8785","canonicalisation","agentic-payments","settlement","xchain","audit-chain","mica","psd2"],"homepage":"https://github.com/chopmob-cloud/algovoi-settlement-attestation","repository":{"type":"git","url":"git+https://github.com/chopmob-cloud/algovoi-settlement-attestation.git","directory":"typescript"},"bugs":{"url":"https://github.com/chopmob-cloud/algovoi-settlement-attestation/issues"},"license":"Apache-2.0","author":{"name":"AlgoVoi","email":"chopmob@gmail.com"},"type":"module","main":"./dist/index.js","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"import":"./dist/index.js","types":"./dist/index.d.ts"}},"scripts":{"build":"tsc","test":"vitest run","test:watch":"vitest","clean":"rimraf dist","prepublishOnly":"npm run clean && npm run build && npm test"},"engines":{"node":">=18"},"dependencies":{"@algovoi/substrate":"^0.3.0"},"devDependencies":{"@types/node":"^20.0.0","rimraf":"^5.0.0","typescript":"^5.4.0","vitest":"^1.6.0"},"publishConfig":{"access":"public"},"gitHead":"adda9be0158bd1d5ca1707b65b3ff54291073af7","_id":"@algovoi/settlement-attestation@0.1.1","_nodeVersion":"24.12.0","_npmVersion":"11.6.2","dist":{"integrity":"sha512-jX9+b/33uHKwNdaWapC9Zn5b/hmrGDC5TfY1jJyca0zzjJYEqwxzhsQ4nrPLShMbRYuSIBVsV4ydOOdXtCAdoQ==","shasum":"8a1dc99c039eb00b78bb5baf107af15d0857deaa","tarball":"https://registry.npmjs.org/@algovoi/settlement-attestation/-/settlement-attestation-0.1.1.tgz","fileCount":8,"unpackedSize":25290,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCZioNMMp++08/MCC5/i51GDA9HbFbGPYOl2pi8R8Vn/wIhANmGGyBHw8u9oJcAENhlURKZClOPq1C/Icw8Ienf6pe7"}]},"_npmUser":{"name":"algovoi","email":"chopmob@gmail.com"},"directories":{},"maintainers":[{"name":"algovoi","email":"chopmob@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/settlement-attestation_0.1.1_1779805459831_0.0025023971098490083"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-24T22:16:30.494Z","modified":"2026-05-26T14:24:20.071Z","0.1.0":"2026-05-24T22:16:30.903Z","0.1.1":"2026-05-26T14:24:19.975Z"},"bugs":{"url":"https://github.com/chopmob-cloud/algovoi-settlement-attestation/issues"},"author":{"name":"AlgoVoi","email":"chopmob@gmail.com"},"license":"Apache-2.0","homepage":"https://github.com/chopmob-cloud/algovoi-settlement-attestation","keywords":["x402","ap2","a2a","mpp","jcs","rfc8785","canonicalisation","agentic-payments","settlement","xchain","audit-chain","mica","psd2"],"repository":{"type":"git","url":"git+https://github.com/chopmob-cloud/algovoi-settlement-attestation.git","directory":"typescript"},"description":"AlgoVoi settlement attestation format reference implementation -- multi-chain categorical attestation under urn:x402:canonicalisation:jcs-rfc8785-v1, companion to @algovoi/substrate compliance and refund receipts","maintainers":[{"name":"algovoi","email":"chopmob@gmail.com"}],"readme":"# algovoi-settlement-attestation\n\n[![PyPI](https://img.shields.io/pypi/v/algovoi-settlement-attestation?label=PyPI)](https://pypi.org/project/algovoi-settlement-attestation/)\n[![npm](https://img.shields.io/npm/v/@algovoi/settlement-attestation?label=npm)](https://www.npmjs.com/package/@algovoi/settlement-attestation)\n[![Apache 2.0](https://img.shields.io/badge/license-Apache--2.0-green)](./LICENSE)\n[![IETF I-D](https://img.shields.io/badge/companion%20IETF%20I--D-draft--hopley--x402--settlement--attestation--00-blue)](https://datatracker.ietf.org/doc/draft-hopley-x402-settlement-attestation/)\n\nAlgoVoi-authored reference implementation for the settlement attestation\nformat specified in IETF Internet-Draft\n[`draft-hopley-x402-settlement-attestation-00`](https://datatracker.ietf.org/doc/draft-hopley-x402-settlement-attestation/)\n(Independent Submission, Informational).\n\nMulti-chain categorical attestation under the JCS RFC 8785\ncanonicalisation discipline\n([`urn:x402:canonicalisation:jcs-rfc8785-v1`](https://datatracker.ietf.org/doc/draft-hopley-x402-canonicalisation-jcs-v1/)).\nCompanion to the AlgoVoi compliance receipt and refund receipt I-Ds —\ncloses the lifecycle gap between admission and refund.\n\nPython and TypeScript reference implementations, byte-for-byte parity,\nApache 2.0.\n\n## Lifecycle position\n\n```\nadmission         settlement        refund\ncompliance   -->  settlement   -->  refund\nreceipt           attestation       receipt\n```\n\nAll three formats anchor to the same canonicalisation discipline. A\nverifier walking the audit chain confirms admission → settlement →\nrefund under one byte-deterministic pin.\n\n## Packages\n\n| Language | Package | Install |\n|---|---|---|\n| Python | [`algovoi-settlement-attestation`](https://pypi.org/project/algovoi-settlement-attestation/) | `pip install algovoi-settlement-attestation` |\n| TypeScript | [`@algovoi/settlement-attestation`](https://www.npmjs.com/package/@algovoi/settlement-attestation) | `npm install @algovoi/settlement-attestation` |\n\nBoth depend on `algovoi-substrate` / `@algovoi/substrate` for the JCS\ncanonicalisation primitive.\n\n## Quick start\n\n### Python\n\n```python\nfrom algovoi_settlement_attestation import build_settlement_attestation\nfrom algovoi_substrate import sha256_jcs\n\na = build_settlement_attestation(\n    settled_payment_ref=\"sha256:0dd5d0b76c9b9281fdeb2509ad38ab132b16a17385ca01d976ff9e6e12563a0f\",\n    settlement_result=\"SETTLED\",\n    settlement_timestamp_ms=1716494400000,\n    settlement_provider_did=\"did:web:api.algovoi.co.uk\",\n    settlement_amount={\"amount_minor\": \"100000\", \"asset_id\": \"USDC.6\"},\n    settlement_chain=\"ethereum:8453\",\n    jurisdiction_flags=[\"UK\", \"EU\"],\n)\nprint(sha256_jcs(dict(a)))\n# 0ead75bfe7fc74cc0421124903e56cb5c5006d02c393231a1d5f260fa87e96d3\n```\n\n### TypeScript\n\n```typescript\nimport { buildSettlementAttestation } from \"@algovoi/settlement-attestation\";\nimport { sha256Jcs } from \"@algovoi/substrate\";\n\nconst a = buildSettlementAttestation({\n  settled_payment_ref:\n    \"sha256:0dd5d0b76c9b9281fdeb2509ad38ab132b16a17385ca01d976ff9e6e12563a0f\",\n  settlement_result: \"SETTLED\",\n  settlement_timestamp_ms: 1716494400000,\n  settlement_provider_did: \"did:web:api.algovoi.co.uk\",\n  settlement_amount: { amount_minor: \"100000\", asset_id: \"USDC.6\" },\n  settlement_chain: \"ethereum:8453\",\n  jurisdiction_flags: [\"UK\", \"EU\"],\n});\nconsole.log(sha256Jcs(a));\n// 0ead75bfe7fc74cc0421124903e56cb5c5006d02c393231a1d5f260fa87e96d3\n```\n\n## Receipt format\n\nEight-field JSON object canonicalised under RFC 8785 (JCS):\n\n| Field | Type | Description |\n|---|---|---|\n| `canon_version` | string | `jcs-rfc8785-v1` |\n| `jurisdiction_flags` | ordered array | ISO-3166-1 codes; primary jurisdiction first |\n| `settled_payment_ref` | string | `sha256:<hex>` reference to original payment record |\n| `settlement_amount` | object | `{amount_minor: string, asset_id: string}` |\n| `settlement_chain` | string | `<chain_family>` (e.g. `algo`, `solana`) or `<chain_family>:<network>` (e.g. `ethereum:8453`) |\n| `settlement_provider_did` | string | DID URI of attesting party |\n| `settlement_result` | string (closed enum) | `SETTLED` / `PENDING_FINALITY` / `REVERSED` |\n| `settlement_timestamp_ms` | integer | Epoch ms (Substrate Rule 2) |\n\n## Closed enumeration: `settlement_result`\n\n| Value | Semantic | Regulatory significance |\n|---|---|---|\n| `SETTLED` | Payment confirmed on-chain with sufficient finality. | Triggers settlement-finality record-keeping under MiCA Article 80 and AMLR Article 56. PSD2 Article 89 refund-window clock starts. |\n| `PENDING_FINALITY` | Broadcast and included, awaiting confirmation depth. | Operator has visibility of inclusion but does not assert finality. PSD2 refund-window timing differs from SETTLED. |\n| `REVERSED` | Previously SETTLED payment now considered reversed (chain reorg, fraud reversal, operator-initiated under regulatory directive). | Triggers reversal-evidence obligations under POCA s.330 and AML5/6. |\n\n## Multi-chain settlement_chain identifier\n\nAlgoVoi's production xChain runs on 8 chain families. Conventional identifiers:\n\n| Chain | Identifier |\n|---|---|\n| Algorand mainnet | `algo` |\n| VOI mainnet | `voi` |\n| Solana mainnet | `solana` |\n| Stellar Pubnet | `stellar` |\n| Hedera mainnet | `hedera` |\n| Base L2 | `base` or `ethereum:8453` |\n| Tempo mainnet | `tempo:mainnet` |\n| Ethereum mainnet | `ethereum:1` |\n\n## Conformance vectors\n\n8 byte-level reference vectors + 5 pair invariants + 3 chain invariants\nat [`vectors/settlement_attestation_v1/`](https://github.com/chopmob-cloud/algovoi-jcs-conformance-vectors/tree/main/vectors/settlement_attestation_v1).\n\n## Companion IETF Internet-Draft\n\n[`draft-hopley-x402-settlement-attestation-00`](https://datatracker.ietf.org/doc/draft-hopley-x402-settlement-attestation/)\n(Independent Submission, Informational). AlgoVoi-authored, sole\nauthorship.\n\n## Related AlgoVoi packages\n\n| Package | Purpose |\n|---|---|\n| [`algovoi-substrate`](https://pypi.org/project/algovoi-substrate/) / [`@algovoi/substrate`](https://www.npmjs.com/package/@algovoi/substrate) | JCS RFC 8785 canonicalisation, `action_ref`, compliance receipts |\n| [`algovoi-refund-receipt`](https://pypi.org/project/algovoi-refund-receipt/) / [`@algovoi/refund-receipt`](https://www.npmjs.com/package/@algovoi/refund-receipt) | Refund receipt format |\n| [`algovoi-rfc9421-verifier`](https://pypi.org/project/algovoi-rfc9421-verifier/) / [`@algovoi/rfc9421-verifier`](https://www.npmjs.com/package/@algovoi/rfc9421-verifier) | RFC 9421 HTTP message signature verifier |\n| **`algovoi-settlement-attestation`** / `@algovoi/settlement-attestation` | **This package.** Settlement attestation format |\n\n## Conformance to the canonicalisation discipline\n\nThis package emits settlement attestations pinned to `canon_version: jcs-rfc8785-v1` on every emitted attestation. The pin is in-band; downstream verifiers (including [`algovoi-audit-verifier`](https://pypi.org/project/algovoi-audit-verifier/) and any conformant third-party verifier) read the pin to select the canonicalisation rule applied at emission.\n\nThe pin is the load-bearing primitive for the [Substrate Adopters Registry](https://docs.algovoi.co.uk/adopters): adopters anchoring to this discipline pin the same `canon_version` value in their own publicly-citable artefacts. AlgoVoi maintains the registry as a neutral observer; this package itself is recorded there as the AlgoVoi reference implementation.\n\n## Substrate adopters\n\nAlgoVoi is recorded in the [Substrate Adopters Registry](https://docs.algovoi.co.uk/adopters) as the substrate author (v1 and v2). Parties anchoring their own services or specifications to `canon_version: jcs-rfc8785-v1` are recorded in the registry via the [submission process](https://docs.algovoi.co.uk/adopters#how-to-submit-an-adoption-entry). AlgoVoi validates submissions against the artefact's canonical bytes and adds qualifying entries.\n\n## Licence\n\nApache 2.0.\n","readmeFilename":"README.md"}