@smartledger/bsv 6.1.2 → 6.2.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 +37 -0
- package/README.md +38 -38
- package/SECURITY.md +39 -12
- package/bsv-anchor.min.js +18 -11
- package/bsv-covenant.min.js +2 -48
- package/bsv-didweb.min.js +18 -11
- package/bsv-ecies.min.js +2 -20
- package/bsv-gdaf.min.js +103 -45
- package/bsv-ltp.min.js +103 -45
- package/bsv-message.min.js +3 -10
- package/bsv-mnemonic.min.js +20 -11
- package/bsv-script-helper.min.js +2 -10
- package/bsv-security.min.js +2 -10
- package/bsv-shamir.min.js +20 -11
- package/bsv-smartcontract.min.js +26 -48
- package/bsv-statuslist.min.js +74 -17
- package/bsv-vcjwt.min.js +18 -11
- package/bsv.bundle.js +103 -45
- package/bsv.min.js +103 -45
- package/build/esbuild/empty.js +2 -0
- package/build/esbuild/globals.js +6 -0
- package/build/esbuild.js +129 -0
- package/docs/MODULE_REFERENCE_COMPLETE.md +27 -27
- package/docs/THREAT_MODEL.md +127 -0
- package/docs/advanced/UTXO_MANAGER_GUIDE.md +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/package.json +3 -22
- package/test/build/bundle_smoke.js +55 -0
- package/test/build/esbuild_main.js +65 -0
- package/test/security/threat_model_coverage.js +31 -0
- package/build/webpack.anchor.config.js +0 -15
- package/build/webpack.base.js +0 -125
- package/build/webpack.bundle.config.js +0 -15
- package/build/webpack.config.js +0 -17
- package/build/webpack.covenant.config.js +0 -17
- package/build/webpack.didweb.config.js +0 -15
- package/build/webpack.ecies.config.js +0 -15
- package/build/webpack.gdaf.config.js +0 -15
- package/build/webpack.ltp.config.js +0 -15
- package/build/webpack.message.config.js +0 -15
- package/build/webpack.mnemonic.config.js +0 -15
- package/build/webpack.script-helper.config.js +0 -17
- package/build/webpack.security.config.js +0 -15
- package/build/webpack.shamir.config.js +0 -15
- package/build/webpack.smartcontract.config.js +0 -18
- package/build/webpack.statuslist.config.js +0 -15
- package/build/webpack.vcjwt.config.js +0 -15
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,43 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [6.2.0] - 2026-07-14
|
|
11
|
+
|
|
12
|
+
Build modernization: the browser bundles are now built with **esbuild** (webpack
|
|
13
|
+
removed). No runtime/API change; the bundles are functionally equivalent (and two are
|
|
14
|
+
fixed — see below).
|
|
15
|
+
|
|
16
|
+
### Security / docs (audit-readiness)
|
|
17
|
+
|
|
18
|
+
- **Test-backed threat model** (`docs/THREAT_MODEL.md`): states each security property, its
|
|
19
|
+
trust assumptions, and the adversarial test that enforces it (fail-closed verification,
|
|
20
|
+
covenant/marketplace enforcement, credential C1–C4 binding, revocation-bypass closure, SPV
|
|
21
|
+
inclusion, Shamir non-leak, type honesty). `test/security/threat_model_coverage.js` asserts
|
|
22
|
+
every test the model cites exists, so it can't drift. Honest "known limitations" section
|
|
23
|
+
(unaudited inherited core, the residual `ECDSA.verify()` footgun, no difficulty-retarget
|
|
24
|
+
validation, provenance pending).
|
|
25
|
+
- **`SECURITY.md` refreshed** to 6.x — corrected the stale supported-versions table (was 4.x),
|
|
26
|
+
documented the 6.0.0 fail-open hardening + the residual `verify()` trap, updated build tooling
|
|
27
|
+
and disclosure history.
|
|
28
|
+
|
|
29
|
+
### Build — webpack → esbuild (cutover complete)
|
|
30
|
+
|
|
31
|
+
- **All 16 browser bundles are now built with esbuild** (`build/esbuild.js`; `npm run
|
|
32
|
+
build-all`). The 16 webpack configs + `webpack.base.js` are removed. One config-driven
|
|
33
|
+
builder replicates the two webpack polyfill modes (`full` browserify shims so the browser
|
|
34
|
+
Shamir CSPRNG works; `stub` externalised built-ins) and externalises the bsv root to the
|
|
35
|
+
global `bsv` for the feature bundles. Every bundle is UMD (browser global **and**
|
|
36
|
+
`require()`/AMD). The build needs **no `--openssl-legacy-provider`** and is **byte-identical
|
|
37
|
+
across Node 20 and 22** (the bundle-parity gate stays reliable).
|
|
38
|
+
- Validated: **20/20 Chrome browser-smoke** on `bsv.min.js`, plus an isolated per-bundle load
|
|
39
|
+
smoke asserting all 16 shipped bundles load and expose an API.
|
|
40
|
+
- **Fixed: `bsv-covenant.min.js` / `bsv-smartcontract.min.js` shrank from ~900 KB to
|
|
41
|
+
~30–290 KB.** The old webpack `externals` key never matched the real `require('../..')`, so
|
|
42
|
+
those two wrongly embedded the whole library (yet still referenced the global, so they were
|
|
43
|
+
broken standalone). They are now correctly externalised — load `bsv.min.js` first, as
|
|
44
|
+
intended. All other bundles are functionally equivalent (bytes differ: esbuild vs webpack
|
|
45
|
+
minification).
|
|
46
|
+
|
|
10
47
|
## [6.1.2] - 2026-07-13
|
|
11
48
|
|
|
12
49
|
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.
|
|
190
|
-
| **bsv.bundle.js** | 1149KB | Everything in one file | `unpkg.com/@smartledger/bsv@6.
|
|
189
|
+
| **bsv.min.js** | 1149KB | Core BSV + SmartContract | `unpkg.com/@smartledger/bsv@6.2.0/bsv.min.js` |
|
|
190
|
+
| **bsv.bundle.js** | 1149KB | Everything in one file | `unpkg.com/@smartledger/bsv@6.2.0/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.
|
|
196
|
-
| **🟢 bsv-vcjwt.min.js** | 315KB | **VC-JWT issue/verify** | `unpkg.com/@smartledger/bsv@6.
|
|
197
|
-
| **🟢 bsv-statuslist.min.js** | 415KB | **StatusList2021 revocation** | `unpkg.com/@smartledger/bsv@6.
|
|
198
|
-
| **🟢 bsv-anchor.min.js** | 314KB | **BSV anchoring (hash-only)** | `unpkg.com/@smartledger/bsv@6.
|
|
195
|
+
| **🟢 bsv-didweb.min.js** | 315KB | **DID:web generation** | `unpkg.com/@smartledger/bsv@6.2.0/bsv-didweb.min.js` |
|
|
196
|
+
| **🟢 bsv-vcjwt.min.js** | 315KB | **VC-JWT issue/verify** | `unpkg.com/@smartledger/bsv@6.2.0/bsv-vcjwt.min.js` |
|
|
197
|
+
| **🟢 bsv-statuslist.min.js** | 415KB | **StatusList2021 revocation** | `unpkg.com/@smartledger/bsv@6.2.0/bsv-statuslist.min.js` |
|
|
198
|
+
| **🟢 bsv-anchor.min.js** | 314KB | **BSV anchoring (hash-only)** | `unpkg.com/@smartledger/bsv@6.2.0/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.
|
|
204
|
-
| **bsv-covenant.min.js** | 873KB | Covenant operations | `unpkg.com/@smartledger/bsv@6.
|
|
205
|
-
| **bsv-script-helper.min.js** | 30KB | Custom script tools | `unpkg.com/@smartledger/bsv@6.
|
|
206
|
-
| **bsv-security.min.js** | 30KB | Security enhancements | `unpkg.com/@smartledger/bsv@6.
|
|
203
|
+
| **bsv-smartcontract.min.js** | 873KB | Complete covenant framework | `unpkg.com/@smartledger/bsv@6.2.0/bsv-smartcontract.min.js` |
|
|
204
|
+
| **bsv-covenant.min.js** | 873KB | Covenant operations | `unpkg.com/@smartledger/bsv@6.2.0/bsv-covenant.min.js` |
|
|
205
|
+
| **bsv-script-helper.min.js** | 30KB | Custom script tools | `unpkg.com/@smartledger/bsv@6.2.0/bsv-script-helper.min.js` |
|
|
206
|
+
| **bsv-security.min.js** | 30KB | Security enhancements | `unpkg.com/@smartledger/bsv@6.2.0/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.
|
|
212
|
-
| **bsv-gdaf.min.js** | 1149KB | Digital Identity & Attestation | `unpkg.com/@smartledger/bsv@6.
|
|
211
|
+
| **bsv-ltp.min.js** | 1149KB | Legal Token Protocol | `unpkg.com/@smartledger/bsv@6.2.0/bsv-ltp.min.js` |
|
|
212
|
+
| **bsv-gdaf.min.js** | 1149KB | Digital Identity & Attestation | `unpkg.com/@smartledger/bsv@6.2.0/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.
|
|
217
|
+
| **bsv-shamir.min.js** | 353KB | Threshold Cryptography | `unpkg.com/@smartledger/bsv@6.2.0/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.
|
|
223
|
-
| **bsv-message.min.js** | 30KB | Message signing | `unpkg.com/@smartledger/bsv@6.
|
|
224
|
-
| **bsv-mnemonic.min.js** | 592KB | HD wallets | `unpkg.com/@smartledger/bsv@6.
|
|
222
|
+
| **bsv-ecies.min.js** | 79KB | Encryption | `unpkg.com/@smartledger/bsv@6.2.0/bsv-ecies.min.js` |
|
|
223
|
+
| **bsv-message.min.js** | 30KB | Message signing | `unpkg.com/@smartledger/bsv@6.2.0/bsv-message.min.js` |
|
|
224
|
+
| **bsv-mnemonic.min.js** | 592KB | HD wallets | `unpkg.com/@smartledger/bsv@6.2.0/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.
|
|
235
|
+
<script src="https://unpkg.com/@smartledger/bsv@6.2.0/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.
|
|
336
|
-
<script src="https://unpkg.com/@smartledger/bsv@6.
|
|
335
|
+
<script src="https://unpkg.com/@smartledger/bsv@6.2.0/bsv.min.js"></script>
|
|
336
|
+
<script src="https://unpkg.com/@smartledger/bsv@6.2.0/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.
|
|
346
|
-
<script src="https://unpkg.com/@smartledger/bsv@6.
|
|
347
|
-
<script src="https://unpkg.com/@smartledger/bsv@6.
|
|
345
|
+
<script src="https://unpkg.com/@smartledger/bsv@6.2.0/bsv.min.js"></script>
|
|
346
|
+
<script src="https://unpkg.com/@smartledger/bsv@6.2.0/bsv-covenant.min.js"></script>
|
|
347
|
+
<script src="https://unpkg.com/@smartledger/bsv@6.2.0/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.
|
|
358
|
-
<script src="https://unpkg.com/@smartledger/bsv@6.
|
|
359
|
-
<script src="https://unpkg.com/@smartledger/bsv@6.
|
|
357
|
+
<script src="https://unpkg.com/@smartledger/bsv@6.2.0/bsv.min.js"></script>
|
|
358
|
+
<script src="https://unpkg.com/@smartledger/bsv@6.2.0/bsv-ltp.min.js"></script>
|
|
359
|
+
<script src="https://unpkg.com/@smartledger/bsv@6.2.0/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.
|
|
374
|
-
<script src="https://unpkg.com/@smartledger/bsv@6.
|
|
375
|
-
<script src="https://unpkg.com/@smartledger/bsv@6.
|
|
373
|
+
<script src="https://unpkg.com/@smartledger/bsv@6.2.0/bsv.min.js"></script>
|
|
374
|
+
<script src="https://unpkg.com/@smartledger/bsv@6.2.0/bsv-security.min.js"></script>
|
|
375
|
+
<script src="https://unpkg.com/@smartledger/bsv@6.2.0/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.
|
|
387
|
+
<script src="https://unpkg.com/@smartledger/bsv@6.2.0/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.
|
|
498
|
-
<script src="https://unpkg.com/@smartledger/bsv@6.
|
|
497
|
+
<script src="https://unpkg.com/@smartledger/bsv@6.2.0/bsv.min.js"></script>
|
|
498
|
+
<script src="https://unpkg.com/@smartledger/bsv@6.2.0/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.
|
|
508
|
-
<script src="https://unpkg.com/@smartledger/bsv@6.
|
|
509
|
-
<script src="https://unpkg.com/@smartledger/bsv@6.
|
|
507
|
+
<script src="https://unpkg.com/@smartledger/bsv@6.2.0/bsv.min.js"></script>
|
|
508
|
+
<script src="https://unpkg.com/@smartledger/bsv@6.2.0/bsv-covenant.min.js"></script>
|
|
509
|
+
<script src="https://unpkg.com/@smartledger/bsv@6.2.0/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.
|
|
520
|
-
<script src="https://unpkg.com/@smartledger/bsv@6.
|
|
519
|
+
<script src="https://unpkg.com/@smartledger/bsv@6.2.0/bsv.min.js"></script>
|
|
520
|
+
<script src="https://unpkg.com/@smartledger/bsv@6.2.0/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.
|
|
529
|
+
<script src="https://unpkg.com/@smartledger/bsv@6.2.0/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.
|
|
837
|
+
canonical `unpkg.com/@smartledger/bsv@6.2.0/...` 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
|
|
9
|
-
|
|
10
|
-
CHANGELOG `## [
|
|
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
|
-
|
|
|
15
|
-
|
|
|
16
|
-
|
|
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
|
|
62
|
-
`mocha`, `nyc`, `crypto-browserify`, etc.). These never reach
|
|
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
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
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
|