@smartledger/bsv 9.22.1 → 9.24.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.
- package/CHANGELOG.md +106 -0
- package/README.md +19 -19
- package/bsv-gdaf.min.js +2 -2
- package/bsv-smartcontract.min.js +1 -1
- package/bsv.bundle.js +3 -3
- package/bsv.d.ts +5 -5
- package/bsv.min.js +3 -3
- package/docs/AUDIT_SCOPE.md +6 -6
- package/docs/MODULE_REFERENCE_COMPLETE.md +27 -27
- package/docs/advanced/UTXO_MANAGER_GUIDE.md +1 -1
- package/docs/audit-rfq/cure53.txt +1 -1
- package/docs/audit-rfq/ncc-group.txt +1 -1
- package/docs/audit-rfq/trail-of-bits.txt +1 -1
- package/docs/getting-started/INSTALLATION.md +23 -23
- package/docs/getting-started/QUICK_START.md +7 -7
- package/docs/migration/FROM_BSV_1_5_6.md +5 -5
- package/lib/gdaf/index.js +14 -14
- package/lib/notaryhash/index.js +34 -0
- package/package.json +1 -1
- package/version.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,112 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [9.24.0] - 2026-10-07
|
|
11
|
+
|
|
12
|
+
### Changed — a certificate whose `spv.format` is not TSC is now refused
|
|
13
|
+
|
|
14
|
+
`spv.format` names the format the inclusion proof is checked as. **No signature covers it**, and
|
|
15
|
+
the proof is folded as TSC whatever the field says, so a certificate can carry a genuine proof, a
|
|
16
|
+
genuine signature and a genuine root while declaring a format nobody implements. We accepted that;
|
|
17
|
+
we now refuse it.
|
|
18
|
+
|
|
19
|
+
The case is the NotaryHash service's own tamper vector T28: the genuine mainnet certificate with
|
|
20
|
+
**exactly one unsigned field changed**, `"TSC"` → `"BUMP"`. Everything else — proof, signature,
|
|
21
|
+
merkle root, headers — is untouched and verifies.
|
|
22
|
+
|
|
23
|
+
The argument for accepting it was that every cryptographic fact checks out, and that refusing on an
|
|
24
|
+
unsigned field lets anyone who can alter a certificate in transit turn a valid record into a
|
|
25
|
+
rejection. That does not survive the distinction it elides: **verifying a proof is not accepting a
|
|
26
|
+
self-described certificate.** We can establish that the proof folds as TSC to the committed root;
|
|
27
|
+
we cannot return an unqualified `valid` for a document that says it is something we never read. The
|
|
28
|
+
availability worry was overweighted too — an attacker who can rewrite the label can rewrite the
|
|
29
|
+
proof, so refusing grants no capability that tampering did not already have.
|
|
30
|
+
|
|
31
|
+
The divergence it prevents is not hypothetical. A caller could store or display our `valid: true`
|
|
32
|
+
as verification of a BUMP-labelled certificate, which a BUMP-aware consumer then rejects; **the
|
|
33
|
+
contradiction between two verdicts on one document is itself the failure**, and no successful BUMP
|
|
34
|
+
fold is needed to reach it.
|
|
35
|
+
|
|
36
|
+
- `proofIntegrity` still reports `true`, because the fold did succeed and a caller diagnosing this
|
|
37
|
+
needs to know the proof is sound and only the label is wrong.
|
|
38
|
+
- `TSC` is matched case-insensitively, and a certificate with no `spv.format` is unaffected.
|
|
39
|
+
- `opts.allowUnknownSpvFormat` accepts it anyway, for a caller that knows the label is wrong and
|
|
40
|
+
does not care.
|
|
41
|
+
|
|
42
|
+
The real repair belongs upstream — bring the field under the signature — which is a service and
|
|
43
|
+
spec change, not one a verifier can make.
|
|
44
|
+
|
|
45
|
+
### Added — the service's tamper vector, vendored
|
|
46
|
+
|
|
47
|
+
`test/data/notaryhash-tamper-cases.json` is the NotaryHash service's own 32-case tamper set,
|
|
48
|
+
single-field changes to one real mainnet batch certificate (block 954784), each with the service
|
|
49
|
+
verifier's recorded verdict. Vendored with its provenance; the cases are not ours.
|
|
50
|
+
|
|
51
|
+
A test asserts our verdict equals theirs on **31 of 32**. The exception is T27, which relabels
|
|
52
|
+
`anchor.network`, because this library checks that label only when the caller passes `opts.network`
|
|
53
|
+
— an opt-in since 9.21.0, and the test pins that it refuses once the caller does.
|
|
54
|
+
|
|
55
|
+
Independently confirmed on the three newest cases: we refuse T29 (`anchor.type` relabelled), T30
|
|
56
|
+
(`merkle` removed) and T31 (`createdAt` before 1970) — the last returning a verdict rather than
|
|
57
|
+
throwing, which was a defect on the service side and never here.
|
|
58
|
+
|
|
59
|
+
The vector's own harness note is worth repeating, because it caught a false finding of mine:
|
|
60
|
+
`blockHashAtHeight` must come from a height-indexed chain source, never from
|
|
61
|
+
`certificate.spv.blockHash`. Passing the certificate's own hash is circular and makes a height
|
|
62
|
+
tamper (T26) pass.
|
|
63
|
+
|
|
64
|
+
## [9.23.0] - 2026-10-07
|
|
65
|
+
|
|
66
|
+
### Fixed — the GDAF class could not generate or verify a membership proof at all
|
|
67
|
+
|
|
68
|
+
`bsv.GDAF` exposes what `index.js` calls "Direct Access Methods (for easier developer experience)":
|
|
69
|
+
thin wrappers that forward to the `ZKProver` module. **Four of them forwarded the wrong arguments**,
|
|
70
|
+
so the documented class-level API was inert.
|
|
71
|
+
|
|
72
|
+
| call through `new bsv.GDAF()` | before | now |
|
|
73
|
+
|---|---|---|
|
|
74
|
+
| `generateMembershipProof(set, value)` | threw `Set must be array` | returns a proof |
|
|
75
|
+
| `verifyMembershipProof(proof, opening, set)` | `false` for every proof | verifies |
|
|
76
|
+
| `verifyRangeProof(proof, min, max, opening)` | `false` for every proof | verifies |
|
|
77
|
+
| `verifyAgeProof(proof, requiredAge, opening)` | an issuer DID arrived as the opening | verifies |
|
|
78
|
+
|
|
79
|
+
Two separate drifts, both between a wrapper and the module it delegates to:
|
|
80
|
+
|
|
81
|
+
- `generateMembershipProof` has taken `(set, value, salt)` in the module **since v5.4.0**, while the
|
|
82
|
+
wrapper passed `(value, validSet, nonce)` — the first two arguments swapped. The set arrived as the
|
|
83
|
+
value, so `checkArgument(Array.isArray(set))` threw and **no proof could be generated through the
|
|
84
|
+
class at any version since 5.4.0**.
|
|
85
|
+
- `verifyMembershipProof` and `verifyRangeProof` gained the verifier-supplied set and the opening in
|
|
86
|
+
**9.20.0**, when the forgeable verifiers were fixed. The wrappers were not updated, so the module
|
|
87
|
+
received `set`/`opening` as `undefined` and its own guard — *"without a verifier-supplied set and an
|
|
88
|
+
opening there is nothing to check the prover's array against"* — answered `false` for **every**
|
|
89
|
+
proof, genuine or forged.
|
|
90
|
+
|
|
91
|
+
**Nothing was accepted that should have been refused.** All four failed closed: three returned
|
|
92
|
+
`false` and one threw. The 9.20.0 and 9.22.0 security fixes are unaffected, and the original
|
|
93
|
+
forgery is still refused through both paths. The defect was that the class API verified nothing
|
|
94
|
+
rather than that it verified wrongly.
|
|
95
|
+
|
|
96
|
+
**Why no test caught it:** every proof test called the module directly
|
|
97
|
+
(`require('lib/gdaf/zk-prover')`), never the class wrapper, so the wrappers had no coverage at all.
|
|
98
|
+
The new `test/gdaf/wrapper_signatures.js` closes that two ways — five tests exercise the class path
|
|
99
|
+
end to end, and a **general guard compares every delegating wrapper to its target by parameter
|
|
100
|
+
name**, so the next signature change on either side fails the suite instead of silently disabling a
|
|
101
|
+
verifier.
|
|
102
|
+
|
|
103
|
+
Found while answering a consumer session's question about which version to pin.
|
|
104
|
+
|
|
105
|
+
### Changed — the class-path signatures now mirror the module
|
|
106
|
+
|
|
107
|
+
`bsv.d.ts` documented the broken shapes and is corrected. The affected declarations are
|
|
108
|
+
`generateMembershipProof(set, value, salt?)`, `verifyMembershipProof(proof, opening, set)`,
|
|
109
|
+
`verifyRangeProof(proof, min, max, opening)` and `verifyAgeProof(proof, requiredAge, opening)`.
|
|
110
|
+
`api-surface.json` records the two arity changes.
|
|
111
|
+
|
|
112
|
+
This is a minor release because those public signatures change, but no working call can break: the
|
|
113
|
+
old shapes threw or returned `false` unconditionally, so nothing could have depended on a correct
|
|
114
|
+
result from them.
|
|
115
|
+
|
|
10
116
|
## [9.22.1] - 2026-10-06
|
|
11
117
|
|
|
12
118
|
### Changed — signing many inputs is no longer quadratic in the number of inputs
|
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Bitcoin SV library with an interpreter-verified script engine.
|
|
4
4
|
|
|
5
|
-
[](https://www.npmjs.com/package/@smartledger/bsv)
|
|
6
6
|
[](LICENSE)
|
|
7
7
|
[](STABILITY.md)
|
|
8
8
|
|
|
@@ -155,44 +155,44 @@ const bsv = require('@smartledger/bsv') // 128 modules
|
|
|
155
155
|
### **Core Modules**
|
|
156
156
|
| Module | Size | Use Case | CDN |
|
|
157
157
|
|--------|------|----------|-----|
|
|
158
|
-
| **bsv.min.js** | 1070KB | Core BSV + SmartContract | `unpkg.com/@smartledger/bsv@9.
|
|
159
|
-
| **bsv.bundle.js** | 1070KB | Everything in one file | `unpkg.com/@smartledger/bsv@9.
|
|
158
|
+
| **bsv.min.js** | 1070KB | Core BSV + SmartContract | `unpkg.com/@smartledger/bsv@9.24.0/bsv.min.js` |
|
|
159
|
+
| **bsv.bundle.js** | 1070KB | Everything in one file | `unpkg.com/@smartledger/bsv@9.24.0/bsv.bundle.js` |
|
|
160
160
|
|
|
161
161
|
### **W3C Verifiable Credentials**
|
|
162
162
|
| Module | Size | Use Case | CDN |
|
|
163
163
|
|--------|------|----------|-----|
|
|
164
|
-
| **🟢 bsv-didweb.min.js** | 166KB | **DID:web generation** | `unpkg.com/@smartledger/bsv@9.
|
|
165
|
-
| **🟢 bsv-vcjwt.min.js** | 166KB | **VC-JWT issue/verify** | `unpkg.com/@smartledger/bsv@9.
|
|
166
|
-
| **🟢 bsv-statuslist.min.js** | 256KB | **StatusList2021 revocation** | `unpkg.com/@smartledger/bsv@9.
|
|
167
|
-
| **🟢 bsv-anchor.min.js** | 164KB | **BSV anchoring (hash-only)** | `unpkg.com/@smartledger/bsv@9.
|
|
164
|
+
| **🟢 bsv-didweb.min.js** | 166KB | **DID:web generation** | `unpkg.com/@smartledger/bsv@9.24.0/bsv-didweb.min.js` |
|
|
165
|
+
| **🟢 bsv-vcjwt.min.js** | 166KB | **VC-JWT issue/verify** | `unpkg.com/@smartledger/bsv@9.24.0/bsv-vcjwt.min.js` |
|
|
166
|
+
| **🟢 bsv-statuslist.min.js** | 256KB | **StatusList2021 revocation** | `unpkg.com/@smartledger/bsv@9.24.0/bsv-statuslist.min.js` |
|
|
167
|
+
| **🟢 bsv-anchor.min.js** | 164KB | **BSV anchoring (hash-only)** | `unpkg.com/@smartledger/bsv@9.24.0/bsv-anchor.min.js` |
|
|
168
168
|
|
|
169
169
|
### **Smart Contract & Development**
|
|
170
170
|
| Module | Size | Use Case | CDN |
|
|
171
171
|
|--------|------|----------|-----|
|
|
172
|
-
| **bsv-smartcontract.min.js** | 141KB | Complete covenant framework | `unpkg.com/@smartledger/bsv@9.
|
|
173
|
-
| **bsv-covenant.min.js** | 35KB | Covenant operations | `unpkg.com/@smartledger/bsv@9.
|
|
174
|
-
| **bsv-script-helper.min.js** | 33KB | Custom script tools | `unpkg.com/@smartledger/bsv@9.
|
|
175
|
-
| **bsv-security.min.js** | 32KB | Security enhancements | `unpkg.com/@smartledger/bsv@9.
|
|
172
|
+
| **bsv-smartcontract.min.js** | 141KB | Complete covenant framework | `unpkg.com/@smartledger/bsv@9.24.0/bsv-smartcontract.min.js` |
|
|
173
|
+
| **bsv-covenant.min.js** | 35KB | Covenant operations | `unpkg.com/@smartledger/bsv@9.24.0/bsv-covenant.min.js` |
|
|
174
|
+
| **bsv-script-helper.min.js** | 33KB | Custom script tools | `unpkg.com/@smartledger/bsv@9.24.0/bsv-script-helper.min.js` |
|
|
175
|
+
| **bsv-security.min.js** | 32KB | Security enhancements | `unpkg.com/@smartledger/bsv@9.24.0/bsv-security.min.js` |
|
|
176
176
|
|
|
177
177
|
### **Legal & Compliance**
|
|
178
178
|
| Module | Size | Use Case | CDN |
|
|
179
179
|
|--------|------|----------|-----|
|
|
180
|
-
| **bsv-ltp.min.js** | 544KB | Legal Token Protocol | `unpkg.com/@smartledger/bsv@9.
|
|
181
|
-
| **bsv-gdaf.min.js** | 1070KB | Digital Identity & Attestation | `unpkg.com/@smartledger/bsv@9.
|
|
180
|
+
| **bsv-ltp.min.js** | 544KB | Legal Token Protocol | `unpkg.com/@smartledger/bsv@9.24.0/bsv-ltp.min.js` |
|
|
181
|
+
| **bsv-gdaf.min.js** | 1070KB | Digital Identity & Attestation | `unpkg.com/@smartledger/bsv@9.24.0/bsv-gdaf.min.js` |
|
|
182
182
|
|
|
183
183
|
### **Advanced Cryptography**
|
|
184
184
|
| Module | Size | Use Case | CDN |
|
|
185
185
|
|--------|------|----------|-----|
|
|
186
|
-
| **bsv-shamir.min.js** | 177KB | Threshold Cryptography | `unpkg.com/@smartledger/bsv@9.
|
|
186
|
+
| **bsv-shamir.min.js** | 177KB | Threshold Cryptography | `unpkg.com/@smartledger/bsv@9.24.0/bsv-shamir.min.js` |
|
|
187
187
|
|
|
188
188
|
### **Utilities**
|
|
189
189
|
| Module | Size | Use Case | CDN |
|
|
190
190
|
|--------|------|----------|-----|
|
|
191
|
-
| **bsv-ecies.min.js** | 139KB | Encryption | `unpkg.com/@smartledger/bsv@9.
|
|
192
|
-
| **bsv-message.min.js** | 34KB | Message signing | `unpkg.com/@smartledger/bsv@9.
|
|
193
|
-
| **bsv-mnemonic.min.js** | 320KB | HD wallets | `unpkg.com/@smartledger/bsv@9.
|
|
191
|
+
| **bsv-ecies.min.js** | 139KB | Encryption | `unpkg.com/@smartledger/bsv@9.24.0/bsv-ecies.min.js` |
|
|
192
|
+
| **bsv-message.min.js** | 34KB | Message signing | `unpkg.com/@smartledger/bsv@9.24.0/bsv-message.min.js` |
|
|
193
|
+
| **bsv-mnemonic.min.js** | 320KB | HD wallets | `unpkg.com/@smartledger/bsv@9.24.0/bsv-mnemonic.min.js` |
|
|
194
194
|
```html
|
|
195
|
-
<script src="https://unpkg.com/@smartledger/bsv@9.
|
|
195
|
+
<script src="https://unpkg.com/@smartledger/bsv@9.24.0/bsv.min.js"></script>
|
|
196
196
|
<script>
|
|
197
197
|
const key = bsv.PrivateKey.fromRandom()
|
|
198
198
|
</script>
|
|
@@ -240,4 +240,4 @@ MIT
|
|
|
240
240
|
|
|
241
241
|
---
|
|
242
242
|
|
|
243
|
-
**SmartLedger-BSV v9.
|
|
243
|
+
**SmartLedger-BSV v9.24.0**
|