@smartledger/bsv 6.1.2 → 6.2.1

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 (53) hide show
  1. package/CHANGELOG.md +56 -0
  2. package/README.md +38 -38
  3. package/SECURITY.md +39 -12
  4. package/bsv-anchor.min.js +18 -11
  5. package/bsv-covenant.min.js +2 -48
  6. package/bsv-didweb.min.js +18 -11
  7. package/bsv-ecies.min.js +2 -20
  8. package/bsv-gdaf.min.js +103 -45
  9. package/bsv-ltp.min.js +103 -45
  10. package/bsv-message.min.js +3 -10
  11. package/bsv-mnemonic.min.js +20 -11
  12. package/bsv-script-helper.min.js +2 -10
  13. package/bsv-security.min.js +2 -10
  14. package/bsv-shamir.min.js +20 -11
  15. package/bsv-smartcontract.min.js +26 -48
  16. package/bsv-statuslist.min.js +74 -17
  17. package/bsv-vcjwt.min.js +18 -11
  18. package/bsv.bundle.js +103 -45
  19. package/bsv.min.js +103 -45
  20. package/build/esbuild/empty.js +2 -0
  21. package/build/esbuild/globals.js +6 -0
  22. package/build/esbuild.js +129 -0
  23. package/docs/MODULE_REFERENCE_COMPLETE.md +27 -27
  24. package/docs/THREAT_MODEL.md +127 -0
  25. package/docs/advanced/UTXO_MANAGER_GUIDE.md +1 -1
  26. package/docs/getting-started/INSTALLATION.md +23 -23
  27. package/docs/getting-started/QUICK_START.md +7 -7
  28. package/docs/migration/FROM_BSV_1_5_6.md +5 -5
  29. package/index.js +3 -2
  30. package/lib/smart_contract/index.js +1 -1
  31. package/package.json +5 -23
  32. package/test/build/bundle_smoke.js +55 -0
  33. package/test/build/esbuild_main.js +65 -0
  34. package/test/build/version_sync.js +14 -0
  35. package/test/security/threat_model_coverage.js +31 -0
  36. package/version.js +3 -0
  37. package/build/webpack.anchor.config.js +0 -15
  38. package/build/webpack.base.js +0 -125
  39. package/build/webpack.bundle.config.js +0 -15
  40. package/build/webpack.config.js +0 -17
  41. package/build/webpack.covenant.config.js +0 -17
  42. package/build/webpack.didweb.config.js +0 -15
  43. package/build/webpack.ecies.config.js +0 -15
  44. package/build/webpack.gdaf.config.js +0 -15
  45. package/build/webpack.ltp.config.js +0 -15
  46. package/build/webpack.message.config.js +0 -15
  47. package/build/webpack.mnemonic.config.js +0 -15
  48. package/build/webpack.script-helper.config.js +0 -17
  49. package/build/webpack.security.config.js +0 -15
  50. package/build/webpack.shamir.config.js +0 -15
  51. package/build/webpack.smartcontract.config.js +0 -18
  52. package/build/webpack.statuslist.config.js +0 -15
  53. package/build/webpack.vcjwt.config.js +0 -15
package/CHANGELOG.md CHANGED
@@ -7,6 +7,62 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [6.2.1] - 2026-07-15
11
+
12
+ Bundle hygiene. No runtime/API change.
13
+
14
+ ### Changed
15
+
16
+ - **Bundles no longer embed the full `package.json`.** `bsv.version` and
17
+ `SmartContract.version` now read a generated `version.js` (a one-line
18
+ `module.exports = '<version>'`) instead of `require('./package.json')`, so the
19
+ browser bundles no longer carry ~4 KB of dev metadata (devDependencies,
20
+ scripts, keywords). The full and smart-contract bundles shrink accordingly
21
+ (e.g. `bsv.min.js` −5.8 KB) with byte-identical, reproducible output.
22
+
23
+ ### Added
24
+
25
+ - `scripts/sync-version.js` regenerates `version.js` from `package.json.version`
26
+ on every `npm version` bump; `test/build/version_sync.js` gates the two from
27
+ drifting.
28
+
29
+ ## [6.2.0] - 2026-07-14
30
+
31
+ Build modernization: the browser bundles are now built with **esbuild** (webpack
32
+ removed). No runtime/API change; the bundles are functionally equivalent (and two are
33
+ fixed — see below).
34
+
35
+ ### Security / docs (audit-readiness)
36
+
37
+ - **Test-backed threat model** (`docs/THREAT_MODEL.md`): states each security property, its
38
+ trust assumptions, and the adversarial test that enforces it (fail-closed verification,
39
+ covenant/marketplace enforcement, credential C1–C4 binding, revocation-bypass closure, SPV
40
+ inclusion, Shamir non-leak, type honesty). `test/security/threat_model_coverage.js` asserts
41
+ every test the model cites exists, so it can't drift. Honest "known limitations" section
42
+ (unaudited inherited core, the residual `ECDSA.verify()` footgun, no difficulty-retarget
43
+ validation, provenance pending).
44
+ - **`SECURITY.md` refreshed** to 6.x — corrected the stale supported-versions table (was 4.x),
45
+ documented the 6.0.0 fail-open hardening + the residual `verify()` trap, updated build tooling
46
+ and disclosure history.
47
+
48
+ ### Build — webpack → esbuild (cutover complete)
49
+
50
+ - **All 16 browser bundles are now built with esbuild** (`build/esbuild.js`; `npm run
51
+ build-all`). The 16 webpack configs + `webpack.base.js` are removed. One config-driven
52
+ builder replicates the two webpack polyfill modes (`full` browserify shims so the browser
53
+ Shamir CSPRNG works; `stub` externalised built-ins) and externalises the bsv root to the
54
+ global `bsv` for the feature bundles. Every bundle is UMD (browser global **and**
55
+ `require()`/AMD). The build needs **no `--openssl-legacy-provider`** and is **byte-identical
56
+ across Node 20 and 22** (the bundle-parity gate stays reliable).
57
+ - Validated: **20/20 Chrome browser-smoke** on `bsv.min.js`, plus an isolated per-bundle load
58
+ smoke asserting all 16 shipped bundles load and expose an API.
59
+ - **Fixed: `bsv-covenant.min.js` / `bsv-smartcontract.min.js` shrank from ~900 KB to
60
+ ~30–290 KB.** The old webpack `externals` key never matched the real `require('../..')`, so
61
+ those two wrongly embedded the whole library (yet still referenced the global, so they were
62
+ broken standalone). They are now correctly externalised — load `bsv.min.js` first, as
63
+ intended. All other bundles are functionally equivalent (bytes differ: esbuild vs webpack
64
+ minification).
65
+
10
66
  ## [6.1.2] - 2026-07-13
11
67
 
12
68
  First release published tokenlessly via **npm OIDC Trusted Publishing** with automatic
package/README.md CHANGED
@@ -186,42 +186,42 @@ console.log('Status:', status) // 'revoked'
186
186
  ### **Core Modules**
187
187
  | Module | Size | Use Case | CDN |
188
188
  |--------|------|----------|-----|
189
- | **bsv.min.js** | 1149KB | Core BSV + SmartContract | `unpkg.com/@smartledger/bsv@6.1.2/bsv.min.js` |
190
- | **bsv.bundle.js** | 1149KB | Everything in one file | `unpkg.com/@smartledger/bsv@6.1.2/bsv.bundle.js` |
189
+ | **bsv.min.js** | 1149KB | Core BSV + SmartContract | `unpkg.com/@smartledger/bsv@6.2.1/bsv.min.js` |
190
+ | **bsv.bundle.js** | 1149KB | Everything in one file | `unpkg.com/@smartledger/bsv@6.2.1/bsv.bundle.js` |
191
191
 
192
192
  ### **W3C Verifiable Credentials**
193
193
  | Module | Size | Use Case | CDN |
194
194
  |--------|------|----------|-----|
195
- | **🟢 bsv-didweb.min.js** | 315KB | **DID:web generation** | `unpkg.com/@smartledger/bsv@6.1.2/bsv-didweb.min.js` |
196
- | **🟢 bsv-vcjwt.min.js** | 315KB | **VC-JWT issue/verify** | `unpkg.com/@smartledger/bsv@6.1.2/bsv-vcjwt.min.js` |
197
- | **🟢 bsv-statuslist.min.js** | 415KB | **StatusList2021 revocation** | `unpkg.com/@smartledger/bsv@6.1.2/bsv-statuslist.min.js` |
198
- | **🟢 bsv-anchor.min.js** | 314KB | **BSV anchoring (hash-only)** | `unpkg.com/@smartledger/bsv@6.1.2/bsv-anchor.min.js` |
195
+ | **🟢 bsv-didweb.min.js** | 315KB | **DID:web generation** | `unpkg.com/@smartledger/bsv@6.2.1/bsv-didweb.min.js` |
196
+ | **🟢 bsv-vcjwt.min.js** | 315KB | **VC-JWT issue/verify** | `unpkg.com/@smartledger/bsv@6.2.1/bsv-vcjwt.min.js` |
197
+ | **🟢 bsv-statuslist.min.js** | 415KB | **StatusList2021 revocation** | `unpkg.com/@smartledger/bsv@6.2.1/bsv-statuslist.min.js` |
198
+ | **🟢 bsv-anchor.min.js** | 314KB | **BSV anchoring (hash-only)** | `unpkg.com/@smartledger/bsv@6.2.1/bsv-anchor.min.js` |
199
199
 
200
200
  ### **Smart Contract & Development**
201
201
  | Module | Size | Use Case | CDN |
202
202
  |--------|------|----------|-----|
203
- | **bsv-smartcontract.min.js** | 873KB | Complete covenant framework | `unpkg.com/@smartledger/bsv@6.1.2/bsv-smartcontract.min.js` |
204
- | **bsv-covenant.min.js** | 873KB | Covenant operations | `unpkg.com/@smartledger/bsv@6.1.2/bsv-covenant.min.js` |
205
- | **bsv-script-helper.min.js** | 30KB | Custom script tools | `unpkg.com/@smartledger/bsv@6.1.2/bsv-script-helper.min.js` |
206
- | **bsv-security.min.js** | 30KB | Security enhancements | `unpkg.com/@smartledger/bsv@6.1.2/bsv-security.min.js` |
203
+ | **bsv-smartcontract.min.js** | 873KB | Complete covenant framework | `unpkg.com/@smartledger/bsv@6.2.1/bsv-smartcontract.min.js` |
204
+ | **bsv-covenant.min.js** | 873KB | Covenant operations | `unpkg.com/@smartledger/bsv@6.2.1/bsv-covenant.min.js` |
205
+ | **bsv-script-helper.min.js** | 30KB | Custom script tools | `unpkg.com/@smartledger/bsv@6.2.1/bsv-script-helper.min.js` |
206
+ | **bsv-security.min.js** | 30KB | Security enhancements | `unpkg.com/@smartledger/bsv@6.2.1/bsv-security.min.js` |
207
207
 
208
208
  ### **Legal & Compliance**
209
209
  | Module | Size | Use Case | CDN |
210
210
  |--------|------|----------|-----|
211
- | **bsv-ltp.min.js** | 1149KB | Legal Token Protocol | `unpkg.com/@smartledger/bsv@6.1.2/bsv-ltp.min.js` |
212
- | **bsv-gdaf.min.js** | 1149KB | Digital Identity & Attestation | `unpkg.com/@smartledger/bsv@6.1.2/bsv-gdaf.min.js` |
211
+ | **bsv-ltp.min.js** | 1149KB | Legal Token Protocol | `unpkg.com/@smartledger/bsv@6.2.1/bsv-ltp.min.js` |
212
+ | **bsv-gdaf.min.js** | 1149KB | Digital Identity & Attestation | `unpkg.com/@smartledger/bsv@6.2.1/bsv-gdaf.min.js` |
213
213
 
214
214
  ### **Advanced Cryptography**
215
215
  | Module | Size | Use Case | CDN |
216
216
  |--------|------|----------|-----|
217
- | **bsv-shamir.min.js** | 353KB | Threshold Cryptography | `unpkg.com/@smartledger/bsv@6.1.2/bsv-shamir.min.js` |
217
+ | **bsv-shamir.min.js** | 353KB | Threshold Cryptography | `unpkg.com/@smartledger/bsv@6.2.1/bsv-shamir.min.js` |
218
218
 
219
219
  ### **Utilities**
220
220
  | Module | Size | Use Case | CDN |
221
221
  |--------|------|----------|-----|
222
- | **bsv-ecies.min.js** | 79KB | Encryption | `unpkg.com/@smartledger/bsv@6.1.2/bsv-ecies.min.js` |
223
- | **bsv-message.min.js** | 30KB | Message signing | `unpkg.com/@smartledger/bsv@6.1.2/bsv-message.min.js` |
224
- | **bsv-mnemonic.min.js** | 592KB | HD wallets | `unpkg.com/@smartledger/bsv@6.1.2/bsv-mnemonic.min.js` |
222
+ | **bsv-ecies.min.js** | 79KB | Encryption | `unpkg.com/@smartledger/bsv@6.2.1/bsv-ecies.min.js` |
223
+ | **bsv-message.min.js** | 30KB | Message signing | `unpkg.com/@smartledger/bsv@6.2.1/bsv-message.min.js` |
224
+ | **bsv-mnemonic.min.js** | 592KB | HD wallets | `unpkg.com/@smartledger/bsv@6.2.1/bsv-mnemonic.min.js` |
225
225
 
226
226
  ## ⚡ **2-Minute Quick Start**
227
227
 
@@ -232,7 +232,7 @@ Get started with Bitcoin SV development in under 2 minutes:
232
232
  npm install @smartledger/bsv
233
233
 
234
234
  # Or include in HTML
235
- <script src="https://unpkg.com/@smartledger/bsv@6.1.2/bsv.min.js"></script>
235
+ <script src="https://unpkg.com/@smartledger/bsv@6.2.1/bsv.min.js"></script>
236
236
  ```
237
237
 
238
238
  > **🔒 v5.0.0 (production hardening — has breaking changes):** Shamir secret
@@ -332,8 +332,8 @@ const covenant = bsv.SmartContract.createCovenantBuilder()
332
332
 
333
333
  ### 🔧 **Basic Development** (~1.2MB total)
334
334
  ```html
335
- <script src="https://unpkg.com/@smartledger/bsv@6.1.2/bsv.min.js"></script>
336
- <script src="https://unpkg.com/@smartledger/bsv@6.1.2/bsv-script-helper.min.js"></script>
335
+ <script src="https://unpkg.com/@smartledger/bsv@6.2.1/bsv.min.js"></script>
336
+ <script src="https://unpkg.com/@smartledger/bsv@6.2.1/bsv-script-helper.min.js"></script>
337
337
  <script>
338
338
  const privateKey = new bsv.PrivateKey();
339
339
  const utxos = new bsv.SmartContract.UTXOGenerator().createRealUTXOs(2, 100000);
@@ -342,9 +342,9 @@ const covenant = bsv.SmartContract.createCovenantBuilder()
342
342
 
343
343
  ### 🔒 **Smart Contract Development** (~2.8MB total — each bundle re-embeds core BSV)
344
344
  ```html
345
- <script src="https://unpkg.com/@smartledger/bsv@6.1.2/bsv.min.js"></script>
346
- <script src="https://unpkg.com/@smartledger/bsv@6.1.2/bsv-covenant.min.js"></script>
347
- <script src="https://unpkg.com/@smartledger/bsv@6.1.2/bsv-smartcontract.min.js"></script>
345
+ <script src="https://unpkg.com/@smartledger/bsv@6.2.1/bsv.min.js"></script>
346
+ <script src="https://unpkg.com/@smartledger/bsv@6.2.1/bsv-covenant.min.js"></script>
347
+ <script src="https://unpkg.com/@smartledger/bsv@6.2.1/bsv-smartcontract.min.js"></script>
348
348
  <script>
349
349
  const covenant = bsv.SmartContract.createCovenantBuilder()
350
350
  .extractField('amount').push(50000).greaterThanOrEqual().verify().build();
@@ -354,9 +354,9 @@ const covenant = bsv.SmartContract.createCovenantBuilder()
354
354
 
355
355
  ### 🆕 **Legal & Identity Development** (~3.4MB total — each bundle re-embeds core BSV)
356
356
  ```html
357
- <script src="https://unpkg.com/@smartledger/bsv@6.1.2/bsv.min.js"></script>
358
- <script src="https://unpkg.com/@smartledger/bsv@6.1.2/bsv-ltp.min.js"></script>
359
- <script src="https://unpkg.com/@smartledger/bsv@6.1.2/bsv-gdaf.min.js"></script>
357
+ <script src="https://unpkg.com/@smartledger/bsv@6.2.1/bsv.min.js"></script>
358
+ <script src="https://unpkg.com/@smartledger/bsv@6.2.1/bsv-ltp.min.js"></script>
359
+ <script src="https://unpkg.com/@smartledger/bsv@6.2.1/bsv-gdaf.min.js"></script>
360
360
  <script>
361
361
  // Legal Token Protocol
362
362
  const propertyToken = bsv.createPropertyToken({
@@ -370,9 +370,9 @@ const covenant = bsv.SmartContract.createCovenantBuilder()
370
370
 
371
371
  ### 🆕 **Security & Cryptography** (~1.5MB total)
372
372
  ```html
373
- <script src="https://unpkg.com/@smartledger/bsv@6.1.2/bsv.min.js"></script>
374
- <script src="https://unpkg.com/@smartledger/bsv@6.1.2/bsv-security.min.js"></script>
375
- <script src="https://unpkg.com/@smartledger/bsv@6.1.2/bsv-shamir.min.js"></script>
373
+ <script src="https://unpkg.com/@smartledger/bsv@6.2.1/bsv.min.js"></script>
374
+ <script src="https://unpkg.com/@smartledger/bsv@6.2.1/bsv-security.min.js"></script>
375
+ <script src="https://unpkg.com/@smartledger/bsv@6.2.1/bsv-shamir.min.js"></script>
376
376
  <script>
377
377
  // Threshold Cryptography
378
378
  const shares = bsv.splitSecret('my_secret_key', 5, 3); // 5 shares, 3 needed
@@ -384,7 +384,7 @@ const covenant = bsv.SmartContract.createCovenantBuilder()
384
384
 
385
385
  ### 🎯 **Everything Bundle** (~1.1MB)
386
386
  ```html
387
- <script src="https://unpkg.com/@smartledger/bsv@6.1.2/bsv.bundle.js"></script>
387
+ <script src="https://unpkg.com/@smartledger/bsv@6.2.1/bsv.bundle.js"></script>
388
388
  <script>
389
389
  // Everything available immediately
390
390
  const shares = bsv.splitSecret('secret', 5, 3); // Shamir Secret Sharing
@@ -494,8 +494,8 @@ const contractTx = covenant.createCovenantTransaction({
494
494
 
495
495
  #### 1. **Minimal Setup** - Core + Script Helper (~1.2MB)
496
496
  ```html
497
- <script src="https://unpkg.com/@smartledger/bsv@6.1.2/bsv.min.js"></script>
498
- <script src="https://unpkg.com/@smartledger/bsv@6.1.2/bsv-script-helper.min.js"></script>
497
+ <script src="https://unpkg.com/@smartledger/bsv@6.2.1/bsv.min.js"></script>
498
+ <script src="https://unpkg.com/@smartledger/bsv@6.2.1/bsv-script-helper.min.js"></script>
499
499
  <script>
500
500
  const tx = new bsv.Transaction();
501
501
  const sig = bsvScriptHelper.createSignature(tx, privateKey, 0, script, satoshis);
@@ -504,9 +504,9 @@ const contractTx = covenant.createCovenantTransaction({
504
504
 
505
505
  #### 2. **DeFi Development** - Core + Covenants + Debug (~2.8MB — each bundle re-embeds core BSV)
506
506
  ```html
507
- <script src="https://unpkg.com/@smartledger/bsv@6.1.2/bsv.min.js"></script>
508
- <script src="https://unpkg.com/@smartledger/bsv@6.1.2/bsv-covenant.min.js"></script>
509
- <script src="https://unpkg.com/@smartledger/bsv@6.1.2/bsv-smartcontract.min.js"></script>
507
+ <script src="https://unpkg.com/@smartledger/bsv@6.2.1/bsv.min.js"></script>
508
+ <script src="https://unpkg.com/@smartledger/bsv@6.2.1/bsv-covenant.min.js"></script>
509
+ <script src="https://unpkg.com/@smartledger/bsv@6.2.1/bsv-smartcontract.min.js"></script>
510
510
  <script>
511
511
  const covenant = new bsvCovenant.CovenantInterface();
512
512
  const debugInfo = SmartContract.interpretScript(script);
@@ -516,8 +516,8 @@ const contractTx = covenant.createCovenantTransaction({
516
516
 
517
517
  #### 3. **Security First** - Core + Enhanced Security (~1.2MB)
518
518
  ```html
519
- <script src="https://unpkg.com/@smartledger/bsv@6.1.2/bsv.min.js"></script>
520
- <script src="https://unpkg.com/@smartledger/bsv@6.1.2/bsv-security.min.js"></script>
519
+ <script src="https://unpkg.com/@smartledger/bsv@6.2.1/bsv.min.js"></script>
520
+ <script src="https://unpkg.com/@smartledger/bsv@6.2.1/bsv-security.min.js"></script>
521
521
  <script>
522
522
  const verified = bsvSecurity.SmartVerify.verify(signature, hash, publicKey);
523
523
  const enhanced = bsvSecurity.EllipticFixed.createSignature(privateKey, hash);
@@ -526,7 +526,7 @@ const contractTx = covenant.createCovenantTransaction({
526
526
 
527
527
  #### 4. **Everything Bundle** - One File Solution (~1.1MB)
528
528
  ```html
529
- <script src="https://unpkg.com/@smartledger/bsv@6.1.2/bsv.bundle.js"></script>
529
+ <script src="https://unpkg.com/@smartledger/bsv@6.2.1/bsv.bundle.js"></script>
530
530
  <script>
531
531
  // Everything available under bsv namespace
532
532
  const keys = bsv.SmartLedgerBundle.generateKeys();
@@ -834,7 +834,7 @@ const timelockScript = helper.createTimelockScript(
834
834
 
835
835
  See the **[16 Loading Options](#-16-loading-options---choose-your-approach)**
836
836
  table near the top for the full list of bundles with current sizes and
837
- canonical `unpkg.com/@smartledger/bsv@6.1.2/...` URLs.
837
+ canonical `unpkg.com/@smartledger/bsv@6.2.1/...` URLs.
838
838
 
839
839
  ## 🔐 Security
840
840
 
package/SECURITY.md CHANGED
@@ -5,15 +5,19 @@ Thank you for helping keep `@smartledger/bsv` and its users safe.
5
5
  ## Supported Versions
6
6
 
7
7
  Security fixes are applied to the latest major release line. Earlier releases
8
- are not patched; please upgrade. **Versions ≤ 3.4.5 contain three known,
9
- exploitable vulnerabilities in the GDAF credential verification path (see
10
- CHANGELOG `## [4.0.0]`); upgrade to 4.x is strongly recommended.**
8
+ are not patched; please upgrade. **Versions < 6.0.0 contain four CRITICAL
9
+ fail-open signature/verification bugs and a revocation-bypass (fixed in 6.0.0 —
10
+ see CHANGELOG `## [6.0.0]`); upgrading to the latest 6.x is strongly recommended.**
11
+ Requires **Node.js ≥ 20.19** (the audited crypto dependency `@noble/curves@2` is
12
+ ESM-only).
11
13
 
12
14
  | Version | Supported |
13
15
  | ------- | ------------------ |
14
- | 4.x | :white_check_mark: |
15
- | 3.4.x | :x: (contains known credential-verification vulnerabilities; upgrade to 4.x) |
16
- | < 3.4 | :x: |
16
+ | 6.x | :white_check_mark: |
17
+ | < 6.0 | :x: (fail-open verification + revocation-bypass; upgrade to 6.x) |
18
+
19
+ The security model and the adversarial tests that enforce it are documented in
20
+ [`docs/THREAT_MODEL.md`](./docs/THREAT_MODEL.md).
17
21
 
18
22
  ## Reporting a Vulnerability
19
23
 
@@ -58,8 +62,9 @@ to remain anonymous.
58
62
 
59
63
  ## Out of Scope
60
64
 
61
- - Vulnerabilities in development-only dependencies (`webpack 4`, `standard 12`,
62
- `mocha`, `nyc`, `crypto-browserify`, etc.). These never reach installers — the
65
+ - Vulnerabilities in development-only dependencies (`webpack 5`, `esbuild`,
66
+ `standard 12`, `mocha`, `nyc`, `crypto-browserify`, etc.). These never reach
67
+ installers — the
63
68
  published tarball ships no `node_modules` and none are listed under
64
69
  `dependencies`. The remaining `npm audit` findings (currently 17, all
65
70
  dev-only) are either upstream-blocked — `mocha`/`nyc` are already at their
@@ -84,16 +89,38 @@ explicitly. The default `transaction.verify()` / `signature.verify()` /
84
89
  `Message().verify()` paths use BSV's own pure-JS ECDSA in
85
90
  `lib/crypto/ecdsa.js` and are **not** routed through `SmartVerify`.
86
91
 
87
- See the [Security section of the README](./README.md#-security) for the full
88
- "what's in the box" table and usage examples for the opt-in helpers. A
89
- planned 3.5.0 will offer an opt-in flag to route the default verify path
90
- through `SmartVerify` so the protection is on by default for new users.
92
+ **6.0.0 hardening.** Four CRITICAL fail-open bugs — code that read a truthy
93
+ return value (an ECDSA *instance*, a stub `{verified:true}`) as if it meant
94
+ "valid" — were fixed and locked down:
95
+
96
+ - `ECDSA.prototype.verifyBool()` is the safe boolean verify; every security-
97
+ critical call site now reads `.verified` / uses `verifyBool()` and **fails
98
+ closed** (returns `false` or throws, never a chainable object).
99
+ - `test/security/fail_closed_contracts.js` **mechanically enforces** this — it
100
+ feeds each verify path a forged input and asserts rejection as a strict boolean
101
+ or a throw. The CI suite is a merge gate.
102
+
103
+ **Known residual footgun (mitigated).** `ECDSA.prototype.verify()` still returns
104
+ the *instance* (truthy) with the result on `.verified` — a landmine if read as a
105
+ boolean. It is retained for back-compat, typed to make misuse a compile error
106
+ (`verify(): this` vs `verifyBool(): boolean` in `bsv.d.ts`), and pinned by a
107
+ test; it is slated for **removal in the next major**. Prefer `verifyBool()`.
108
+
109
+ See [`docs/THREAT_MODEL.md`](./docs/THREAT_MODEL.md) for the full property-by-
110
+ property security model and the tests that enforce each claim, and the
111
+ [Security section of the README](./README.md#-security) for the opt-in helpers.
91
112
 
92
113
  ## Disclosure History
93
114
 
94
115
  Significant security-relevant changes are documented in
95
116
  [`CHANGELOG.md`](./CHANGELOG.md). Recent entries of note:
96
117
 
118
+ - **6.0.0** — fixed four CRITICAL fail-open verification bugs (the `ECDSA.verify()`
119
+ returns-the-instance trap at three call sites plus a `//TODO` stub), a StatusList2021
120
+ revocation bypass (unverified list bitstring), an ownership-forgery in
121
+ `prepareRightTokenTransfer`, and covenant defects (inverted `OP_SPLIT`/`OP_DROP`;
122
+ non-enforcing "covenants" that reduced to P2PK now throw). Each fix ships an
123
+ adversarial regression asserting the *bad* input is rejected.
97
124
  - **3.4.2 / 3.4.3** — corrected documentation overclaims about which
98
125
  hardening is on by default vs. opt-in.
99
126
  - **3.4.1** — `Transaction.shuffleOutputs()` now draws entropy from