@cardanowall/sdk-ts 0.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +207 -0
  3. package/dist/client/index.cjs +2695 -0
  4. package/dist/client/index.cjs.map +1 -0
  5. package/dist/client/index.d.cts +397 -0
  6. package/dist/client/index.d.ts +397 -0
  7. package/dist/client/index.js +2641 -0
  8. package/dist/client/index.js.map +1 -0
  9. package/dist/conformance/cli.cjs +4901 -0
  10. package/dist/conformance/cli.cjs.map +1 -0
  11. package/dist/conformance/cli.d.cts +18 -0
  12. package/dist/conformance/cli.d.ts +18 -0
  13. package/dist/conformance/cli.js +4878 -0
  14. package/dist/conformance/cli.js.map +1 -0
  15. package/dist/fetch/index.cjs +335 -0
  16. package/dist/fetch/index.cjs.map +1 -0
  17. package/dist/fetch/index.d.cts +13 -0
  18. package/dist/fetch/index.d.ts +13 -0
  19. package/dist/fetch/index.js +323 -0
  20. package/dist/fetch/index.js.map +1 -0
  21. package/dist/fetch-outbound-BT5-NiYN.d.cts +76 -0
  22. package/dist/fetch-outbound-BT5-NiYN.d.ts +76 -0
  23. package/dist/hash/index.cjs +25 -0
  24. package/dist/hash/index.cjs.map +1 -0
  25. package/dist/hash/index.d.cts +1 -0
  26. package/dist/hash/index.d.ts +1 -0
  27. package/dist/hash/index.js +21 -0
  28. package/dist/hash/index.js.map +1 -0
  29. package/dist/identity/index.cjs +1388 -0
  30. package/dist/identity/index.cjs.map +1 -0
  31. package/dist/identity/index.d.cts +27 -0
  32. package/dist/identity/index.d.ts +27 -0
  33. package/dist/identity/index.js +1362 -0
  34. package/dist/identity/index.js.map +1 -0
  35. package/dist/ids/index.cjs +146 -0
  36. package/dist/ids/index.cjs.map +1 -0
  37. package/dist/ids/index.d.cts +55 -0
  38. package/dist/ids/index.d.ts +55 -0
  39. package/dist/ids/index.js +135 -0
  40. package/dist/ids/index.js.map +1 -0
  41. package/dist/index-BhnlWJAY.d.cts +10 -0
  42. package/dist/index-BhnlWJAY.d.ts +10 -0
  43. package/dist/index-Cg1QqVmA.d.cts +19 -0
  44. package/dist/index-Cg1QqVmA.d.ts +19 -0
  45. package/dist/index.cjs +7127 -0
  46. package/dist/index.cjs.map +1 -0
  47. package/dist/index.d.cts +21 -0
  48. package/dist/index.d.ts +21 -0
  49. package/dist/index.js +7004 -0
  50. package/dist/index.js.map +1 -0
  51. package/dist/merkle/index.cjs +396 -0
  52. package/dist/merkle/index.cjs.map +1 -0
  53. package/dist/merkle/index.d.cts +2 -0
  54. package/dist/merkle/index.d.ts +2 -0
  55. package/dist/merkle/index.js +387 -0
  56. package/dist/merkle/index.js.map +1 -0
  57. package/dist/types-B8Q3gW54.d.ts +123 -0
  58. package/dist/types-BQMtbRCb.d.cts +321 -0
  59. package/dist/types-BQMtbRCb.d.ts +321 -0
  60. package/dist/types-CLXdbjqr.d.cts +123 -0
  61. package/dist/verifier/index.cjs +4901 -0
  62. package/dist/verifier/index.cjs.map +1 -0
  63. package/dist/verifier/index.d.cts +176 -0
  64. package/dist/verifier/index.d.ts +176 -0
  65. package/dist/verifier/index.js +4848 -0
  66. package/dist/verifier/index.js.map +1 -0
  67. package/package.json +108 -0
package/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,207 @@
1
+ # @cardanowall/sdk-ts — the TypeScript SDK for CIP-309 Proof-of-Existence
2
+
3
+ The browser + Node TypeScript SDK for [CIP-309](https://cips.cardano.org/) Proof-of-Existence on Cardano: a **standalone verifier** (three roles), a **gateway-agnostic HTTP client**, **off-host signing** helpers, and **seed-derived identity** helpers.
4
+
5
+ ## What it is
6
+
7
+ CIP-309 anchors a content hash on Cardano under metadata label 309 so that anyone can later prove "this content existed on or before block time T" — without trusting any server, domain, or issuer identity. This package is the high-level TypeScript surface over that standard:
8
+
9
+ - **Verify** any CIP-309 transaction from chain metadata alone — no issuer server in the trust path.
10
+ - **Publish, read, and decrypt** records against **any** CIP-309 gateway (you supply the base URL and an opaque key).
11
+ - **Sign** records off-host (AWS KMS, GCP HSM, YubiHSM, air-gapped) — the private key never touches the SDK.
12
+ - **Derive identity** keypairs, recipient strings, signers, and sealed-PoE decryption from a single 32-byte seed.
13
+
14
+ It builds on two lower-level packages — [`@cardanowall/poe-standard`](../poe-standard) (the wire format) and [`@cardanowall/crypto-core`](../crypto-core) (the primitives) — and re-exports the parts a consumer needs. The verifier and sealed-PoE logic are **byte-identical** to the [Python](../sdk-py) and [Rust](../sdk-rs) twins, validated against shared canonical-CBOR test vectors. Runs in the browser, Node.js, Deno, and Bun.
15
+
16
+ ## Install
17
+
18
+ Not yet published. Build from the workspace or vendor the package directly:
19
+
20
+ ```sh
21
+ pnpm --filter @cardanowall/sdk-ts build
22
+ ```
23
+
24
+ Once published to npm the install will be:
25
+
26
+ ```sh
27
+ # once published
28
+ npm install @cardanowall/sdk-ts
29
+ ```
30
+
31
+ ## Quick start
32
+
33
+ ### Verify a record (standalone — no gateway, no issuer trust)
34
+
35
+ `verifyTx` fetches the transaction from a Cardano gateway you specify, extracts the label-309 metadata, runs the structural validator, checks confirmation depth, and verifies any record-level signatures. It reaches only the gateways you pass — no fixed deployment is contacted.
36
+
37
+ ```ts
38
+ import { verifyTx } from '@cardanowall/sdk-ts';
39
+
40
+ const report = await verifyTx({
41
+ txHash: '<64-char hex tx hash>',
42
+ cardanoGatewayChain: ['https://api.koios.rest/api/v1'], // tried in order
43
+ });
44
+
45
+ console.log(report.verdict); // 'valid' | 'pending' | 'failed'
46
+ console.log(report.exit_code); // 0 valid · 1 integrity fail · 2 network fail · 3 pending
47
+ console.log(report.record); // the decoded CIP-309 PoeRecord
48
+ ```
49
+
50
+ To decrypt a sealed PoE addressed to you, run at the **recipient-sealed** profile and supply your X25519 private key per item index:
51
+
52
+ ```ts
53
+ const report = await verifyTx({
54
+ txHash: '<tx hash>',
55
+ cardanoGatewayChain: ['https://api.koios.rest/api/v1'],
56
+ arweaveGatewayChain: ['https://arweave.net'],
57
+ profile: 'recipient-sealed',
58
+ decryption: [{ itemIndex: 0, recipientSecretKey: myX25519SecretKey }],
59
+ });
60
+ // report.item_decryptions[0].verdict === 'decrypted'
61
+ // report.item_decryptions[0].plaintext_hash_ok === true
62
+ ```
63
+
64
+ When you already hold the metadata bytes from an indexer mirror, skip the chain round-trip with `verifyResolved({ txHash, metadataCbor, numConfirmations, ... })`.
65
+
66
+ ### Talk to a gateway (publish, read, balance)
67
+
68
+ `baseUrl` is **required** — the client binds to no particular deployment. `apiKey`, when present, is an **opaque** bearer token forwarded verbatim as `Authorization: Bearer <apiKey>`; the SDK never parses or assumes its format. Omit it for anonymous read-only use.
69
+
70
+ ```ts
71
+ import { CardanowallClient } from '@cardanowall/sdk-ts';
72
+
73
+ const client = new CardanowallClient({
74
+ baseUrl: 'https://gateway.example.com', // any CIP-309 gateway
75
+ apiKey: process.env.CIP309_API_KEY, // opaque; omit for anonymous reads
76
+ });
77
+
78
+ // Read surface — no auth required for public records.
79
+ const record = await client.records.get('<tx hash>');
80
+ const report = await client.records.verify('<tx hash>'); // returns a VerifyReport
81
+
82
+ // Authenticated read.
83
+ const { balanceUsdMicros } = await client.account.balance(); // decimal string, never coerced
84
+ ```
85
+
86
+ PoE submissions debit the gateway's own balance model, so every publish needs a price lock. Request a quote first, then pass `quote_id` to the publish call:
87
+
88
+ ```ts
89
+ const quote = await client.poe.quote({
90
+ recordBytes: 256,
91
+ recipientCount: 0,
92
+ fileBytesTotal: 0,
93
+ });
94
+
95
+ // Hash-only PoE: hash the content, build the record, submit. One HTTP call.
96
+ const result = await client.poe.publishContent({
97
+ content: 'hello world', // string (UTF-8) or Uint8Array
98
+ quoteId: quote.quote_id,
99
+ // signer is optional; omit to publish unsigned (profile=core)
100
+ });
101
+ console.log(result.id, result.status, result.balance_after_usd_micros);
102
+ ```
103
+
104
+ `client.poe` also exposes `publishPrehashed`, `publishSealed`, `publishMerkle`, the low-level `uploads` / `publish` / `publishBatch`, and `quote`. `client.inbox.list()` / `client.inbox.get(txHash)` page through the sealed records addressed to the authenticated account.
105
+
106
+ ### Sign off-host (key never enters the SDK)
107
+
108
+ The signing surface touches only public data — the canonical record bytes (in) and the 32-byte public key + 64-byte signature (out). Your signer callback owns the private key, whether that is AWS KMS, a YubiHSM, or an air-gapped workstation.
109
+
110
+ ```ts
111
+ import { prepareSigStructure, assembleCoseSign1 } from '@cardanowall/sdk-ts';
112
+
113
+ // 1. Build the COSE Sig_structure bytes to be signed.
114
+ const { sigStructureBytes } = prepareSigStructure({ record, signerPubkey });
115
+
116
+ // 2. Sign those bytes anywhere — KMS, HSM, offline. Return 64 raw Ed25519 bytes.
117
+ const signature = await myExternalSigner(sigStructureBytes);
118
+
119
+ // 3. Assemble the COSE_Sign1 and the chunked sigs[] entry for the record.
120
+ const { sigEntry } = assembleCoseSign1({ record, signerPubkey, signature });
121
+ ```
122
+
123
+ ### Identity from a 32-byte seed
124
+
125
+ A developer holding a raw seed derives every keypair, recipient string, signer, and sealed-PoE decryption — no web account envelope required.
126
+
127
+ ```ts
128
+ import {
129
+ deriveKeysFromSeed,
130
+ recipientsFromSeed,
131
+ signerFromSeed,
132
+ decryptSealedFromSeed,
133
+ } from '@cardanowall/sdk-ts';
134
+
135
+ const keys = deriveKeysFromSeed(seed); // { ed25519, x25519, mlkem768x25519 }
136
+ const me = recipientsFromSeed(seed); // { age: 'age1…', age1pqc: 'age1pqc…' }
137
+ const signer = signerFromSeed(seed); // a path-1 Signer for the publish helpers
138
+
139
+ // Decrypt a sealed PoE addressed to this seed — works for both classical
140
+ // (x25519) and hybrid post-quantum (mlkem768x25519 / X-Wing) records.
141
+ const result = decryptSealedFromSeed({ seed, envelope, ciphertext });
142
+ if (result.matched) {
143
+ console.log(result.plaintext);
144
+ }
145
+ ```
146
+
147
+ ## API overview
148
+
149
+ Everything is reachable from the package root; submodule entry points (`/verifier`, `/client`, `/identity`, `/merkle`, `/hash`, `/fetch`) exist for tree-shaking.
150
+
151
+ **Verifier** (`@cardanowall/sdk-ts` or `/verifier`)
152
+ - `verifyTx(input)` / `verifyResolved(input)` — the full pipeline; returns a `VerifyReport`.
153
+ - `verifyRecordSignatures`, `verifyMerkleCommitments`, `tryDecryptions` — individual stages.
154
+ - `DEFAULT_PROFILE`, `profileImplements`, `planProfileSkips` — the four conformance profiles (`core` → `signed` → `sealed` → `recipient-sealed`).
155
+ - `CONFIRMATION_DEPTH_THRESHOLD_DEFAULT` (15), `exitCodeForVerdict`, `verifyReportToDict`.
156
+ - `resolveCardanoTx`, `extractLabel309Metadata`, `decodeTxWitnesses`, `decodeTxSummary` — resolution + transaction-level description.
157
+
158
+ **Client** (`/client`)
159
+ - `CardanowallClient({ baseUrl, apiKey?, fetch? })` — `baseUrl` required, key opaque.
160
+ - `client.poe.{quote, publishContent, publishPrehashed, publishSealed, publishMerkle, uploads, publish, publishBatch}`.
161
+ - `client.records.{get, verify}`, `client.inbox.{list, get}`, `client.account.balance()`.
162
+ - Off-host signing: `prepareSigStructure`, `assembleCoseSign1`, plus the CIP-8 hashed-mode pair `prepareSigStructureHashed` / `assembleCoseSign1Hashed`.
163
+ - Typed errors extending `CardanowallHttpError`: `InsufficientFundsError`, `QuoteExpiredError`, `QuoteAlreadyConsumedError`, `FxStaleError`, `RateLimitedError`, `UnauthorizedError`, `ValidationFailedError`, `MalformedCborError`, `InvalidClientConfigError`, and more.
164
+
165
+ **Identity** (`/identity`)
166
+ - `deriveKeysFromSeed`, `recipientsFromSeed`, `signerFromSeed`, `recipientKeyBundleFromSeed`, `decryptSealedFromSeed`.
167
+ - Recipient codecs `encodeAgeX25519Recipient`, `encodeAgeXWingRecipient`, `parseAgeRecipient`.
168
+ - Low-level derive primitives `deriveEd25519KeypairFromSeed`, `deriveX25519KeypairFromSeed`, `deriveMlKem768X25519KeypairFromSeed`.
169
+
170
+ **Wire format & primitives** (re-exported for convenience)
171
+ - From `@cardanowall/poe-standard`: `validatePoeRecord`, `encodePoeRecord`, `encodeRecordBodyForSigning`, the error-code catalogues (`STRUCTURAL_ERROR_CODES`, `VERIFIER_ERROR_CODES`, `ERROR_CODES`), `severityOf`, `PoeRecordSchema`.
172
+ - From `@cardanowall/crypto-core`: `eciesSealedPoeWrap` / `eciesSealedPoeUnwrap` (sealed PoE), `hash.*` (digests), `merkle.*` (`merkleSha2256Root`, `merkleSha2256InclusionProof`, `merkleSha2256VerifyInclusion`, leaves-list codecs).
173
+
174
+ **Egress** (`/fetch`) — the verifier's single network egress point: `fetchOutbound`, `wrapFetchOutbound`, the deny-host guard (`DENY_HOSTS_DEFAULT`, `DenyHostError`), `BodyTooLargeError`, and the SSRF guard (`assertWebhookUrlSafe`). Inject your own `fetchOutbound` to fully control where the verifier may reach.
175
+
176
+ See the package source for the exhaustive list.
177
+
178
+ ## The three verifier roles
179
+
180
+ A consumer picks how far down the trust chain to go:
181
+
182
+ - **Structural validator** — a pure function over the CBOR bytes (`validatePoeRecord`). No I/O, no signatures, no decryption.
183
+ - **Public verifier** — `verifyTx` at profile `core` or `signed`: fetches metadata, runs structural validation, verifies record signatures. Does not decrypt.
184
+ - **Recipient verifier** — `verifyTx` at profile `recipient-sealed` with a `decryption` entry: the public verifier plus an X25519 private key that decrypts a sealed PoE and recomputes the plaintext hashes.
185
+
186
+ ## Sealed PoE & post-quantum
187
+
188
+ Sealed records wrap a content-encryption key to one or more recipient public keys (age-style sealed envelope). The default KEM is **X-Wing** (`mlkem768x25519`, hybrid ML-KEM-768 + X25519), addressed by `age1pqc…` recipient strings; the classical `x25519` path (`age1…`) remains available. Both decrypt through the same `decryptSealedFromSeed` / `tryDecryptions` dispatch, which selects the right secret from the envelope's `kem` field.
189
+
190
+ ## Cross-implementation parity
191
+
192
+ The verifier, the structural validator, the sealed-PoE construction, the off-host signing builder, and the seed-derivation are **byte-identical** across the TypeScript, [Python](../sdk-py), and [Rust](../sdk-rs) SDKs. Parity is enforced by shared known-answer-test corpora (canonical-CBOR record bodies, COSE_Sign1 build vectors, seed-derive vectors, recipient-string vectors). A record published or signed by one implementation verifies identically under the others.
193
+
194
+ ## Standard & service independence
195
+
196
+ A CIP-309 proof verifies from three inputs only: the **transaction metadata**, optionally the **content bytes**, and a **public blockchain explorer**. No issuer server sits in the trust path. `verifyTx` reaches only the gateway chains you pass it, routes every outbound request through a single auditable egress point (every call lands in `VerifyReport.http_calls`), and enforces a deny-host policy — so the standalone verifier can be pointed at any infrastructure and still produce a trustworthy verdict.
197
+
198
+ ## Relation to the other packages
199
+
200
+ - **`@cardanowall/crypto-core`** — closed-catalogue cryptographic primitives (hash, KDF, signature, KEM, AEAD, CBOR, COSE, sealed-PoE, Merkle, recipient encoding, seed derivation). The building blocks this SDK is built on.
201
+ - **`@cardanowall/poe-standard`** — the CIP-309 wire-format library: record schema, canonical-CBOR encoder, pure structural validator, error-code catalogue.
202
+ - **`@cardanowall/sdk-py`** — the Python SDK: a byte-identical parity twin of this package, validated against the same canonical-CBOR vectors.
203
+ - **`cardanowall`** (Rust crate) — the Rust SDK: the byte-parity twin in Rust, blocking HTTP, secure-by-default egress. The `cardanowall` CLI is built on it.
204
+
205
+ ## License
206
+
207
+ Apache-2.0.