@smartledger/bsv 3.4.2 → 3.4.4

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 (88) hide show
  1. package/CHANGELOG.md +336 -0
  2. package/README.md +72 -72
  3. package/SECURITY.md +88 -0
  4. package/bin/cli.js +13 -8
  5. package/bsv-covenant.min.js +4 -4
  6. package/bsv-gdaf.min.js +5 -5
  7. package/bsv-ltp.min.js +7 -7
  8. package/bsv-smartcontract.min.js +5 -5
  9. package/bsv.bundle.js +5 -5
  10. package/bsv.d.ts +486 -9
  11. package/bsv.min.js +5 -5
  12. package/docs/COVENANT_DEVELOPMENT_RESOLVED.md +2 -2
  13. package/docs/MODULE_REFERENCE_COMPLETE.md +61 -58
  14. package/docs/advanced/LEGAL_TOKEN_PROTOCOL.md +3 -3
  15. package/docs/advanced/UTXO_MANAGER_GUIDE.md +1 -1
  16. package/docs/getting-started/INSTALLATION.md +30 -30
  17. package/docs/getting-started/QUICK_START.md +18 -18
  18. package/docs/migration/FROM_BSV_1_5_6.md +16 -10
  19. package/gdaf-entry.js +1 -2
  20. package/index.js +20 -7
  21. package/lib/smart_contract/covenant.js +10 -1
  22. package/lib/smartutxo.js +20 -12
  23. package/lib/transaction/transaction.js +7 -0
  24. package/ltp-entry.js +1 -2
  25. package/package.json +3 -3
  26. package/utilities/blockchain-state.js +32 -23
  27. package/demos/README.md +0 -188
  28. package/demos/architecture_demo.js +0 -247
  29. package/demos/browser-test.html +0 -1208
  30. package/demos/bsv_wallet_demo.js +0 -242
  31. package/demos/complete_ltp_demo.js +0 -511
  32. package/demos/debug_tools_demo.js +0 -87
  33. package/demos/demo_features.js +0 -123
  34. package/demos/easy_interface_demo.js +0 -109
  35. package/demos/ecies_demo.js +0 -182
  36. package/demos/gdaf_demo.js +0 -237
  37. package/demos/ltp_demo.js +0 -361
  38. package/demos/ltp_primitives_demo.js +0 -403
  39. package/demos/message_demo.js +0 -209
  40. package/demos/preimage_separation_demo.js +0 -383
  41. package/demos/script_helper_demo.js +0 -289
  42. package/demos/security_demo.js +0 -287
  43. package/demos/shamir_demo.js +0 -121
  44. package/demos/simple_demo.js +0 -204
  45. package/demos/simple_p2pkh_demo.js +0 -169
  46. package/demos/simple_utxo_preimage_demo.js +0 -196
  47. package/demos/smart_contract_demo.html +0 -1347
  48. package/demos/smart_contract_demo.js +0 -910
  49. package/demos/utxo_generator_demo.js +0 -244
  50. package/demos/validation_pipeline_demo.js +0 -155
  51. package/demos/web3keys.html +0 -740
  52. package/examples/README.md +0 -200
  53. package/examples/basic/transaction-creation.js +0 -534
  54. package/examples/basic/transaction_signature_api_gap.js +0 -178
  55. package/examples/complete_workflow_demo.js +0 -783
  56. package/examples/covenants/advanced_covenant_demo.js +0 -219
  57. package/examples/covenants/covenant_interface_demo.js +0 -270
  58. package/examples/covenants/covenant_manual_signature_resolved.js +0 -212
  59. package/examples/covenants/covenant_signature_template.js +0 -117
  60. package/examples/covenants2/covenant_bidirectional_example.js +0 -262
  61. package/examples/covenants2/covenant_utils_demo.js +0 -120
  62. package/examples/covenants2/preimage_covenant_utils.js +0 -287
  63. package/examples/covenants2/production_integration.js +0 -256
  64. package/examples/data/covenant_utxos.json +0 -28
  65. package/examples/data/utxos.json +0 -26
  66. package/examples/definitive_working_demo.js +0 -261
  67. package/examples/final_working_contracts.js +0 -338
  68. package/examples/legacy/README.md +0 -11
  69. package/examples/legacy/smart_contract_test_integration.js +0 -269
  70. package/examples/legacy/test_builtin_verify.js +0 -117
  71. package/examples/legacy/test_debug_integration.js +0 -71
  72. package/examples/legacy/test_ecdsa_little.js +0 -70
  73. package/examples/legacy/test_shamir.js +0 -221
  74. package/examples/legacy/test_smartverify_der.js +0 -110
  75. package/examples/preimage/README.md +0 -178
  76. package/examples/preimage/extract_preimage_bidirectional.js +0 -421
  77. package/examples/preimage/generate_sample_preimage.js +0 -208
  78. package/examples/preimage/generate_sighash_examples.js +0 -152
  79. package/examples/preimage/parse_preimage.js +0 -117
  80. package/examples/preimage/test_preimage_extractor.js +0 -53
  81. package/examples/preimage/test_varint_extraction.js +0 -95
  82. package/examples/scripts/custom_script_helper_example.js +0 -273
  83. package/examples/scripts/script_interpreter.js +0 -193
  84. package/examples/smart_contract/complete_workflow_demo.js +0 -343
  85. package/examples/smart_contract/covenant_builder_demo.js +0 -176
  86. package/examples/smart_contract/script_testing_integration.js +0 -198
  87. package/examples/smart_contract_templates.js +0 -718
  88. package/examples/working_smart_contracts.js +0 -348
package/CHANGELOG.md CHANGED
@@ -5,6 +5,342 @@ All notable changes to SmartLedger-BSV will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [3.4.4] - 2026-05-25
9
+
10
+ ### Fixed
11
+
12
+ - **TypeScript types now actually load for `@smartledger/bsv` consumers.**
13
+ Two pre-existing bugs combined to silently leave TS users with `any`:
14
+ `package.json` had no `"types"` field, and `bsv.d.ts` declared
15
+ `module 'bsv'` instead of `module '@smartledger/bsv'`. Added the `types:`
16
+ field and renamed the ambient module declaration. Existing TS consumers
17
+ who were previously seeing `any` for every `bsv.*` will now get real
18
+ autocomplete and type errors — surface API unchanged, but any code that
19
+ was implicitly relying on `any` to silence a real type error will need
20
+ to be fixed.
21
+
22
+ - **`smartledger-bsv vc verify` actually works now.** The CLI's DID resolver
23
+ returned the raw JWKS file content (`{ keys: [...] }`), but
24
+ `lib/vcjwt/verifyVcJwt` expects the documented resolver shape
25
+ `{ jwks: { keys: [...] } }`. So every `npx smartledger-bsv vc verify`
26
+ call advertised in the README's quickstart would fail with "Failed to
27
+ resolve issuer DID" — including the one in the very first `Quick Start`
28
+ block at `README.md:25-53`. `bin/cli.js` now wraps the result correctly.
29
+ Caught by the new `test/cli/smoke.js` (Task #9 below).
30
+
31
+ - **CLI version string is no longer hardcoded.** `bin/cli.js` used to
32
+ print `SmartLedger BSV CLI v3.4.0` regardless of the actual package
33
+ version (and had no `--version` flag at all). It now reads from
34
+ `package.json` and supports `--version` / `-v` / `--help` / `-h`.
35
+
36
+ - **Library is now silent by default.** Two long-standing modules printed
37
+ on every consumer-side `require`/bundle-load: `lib/smartutxo.js` emitted
38
+ `SmartUTXO: Running in browser mode - some features may be limited`
39
+ plus 11 informational `console.log` calls (`📖 Loaded existing
40
+ blockchain state`, `💾 Saved blockchain state with N UTXOs`, etc.), and
41
+ `utilities/blockchain-state.js` added another `BlockchainState: Running
42
+ in browser mode` warn plus ~15 narration logs that fired on every
43
+ `SmartUTXO` method call. All of these are now gated behind the same
44
+ `BSV_DEBUG` flag the rest of the codebase has used since 3.4.1:
45
+ set `BSV_DEBUG=1` (Node) or `window.BSV_DEBUG = true` (browser) to
46
+ surface the diagnostics. `console.error` calls for genuine
47
+ storage/IO failures are unchanged — errors stay loud. A small fix to
48
+ `lib/smart_contract/covenant.js` does the same for the
49
+ `File system operations not available in browser environment` warn
50
+ that `.save()` emitted at call time. Verified: `require('./index.js')`
51
+ in Node is now completely silent; `require('./bsv-ltp.min.js')` /
52
+ `bsv-gdaf.min.js` / `bsv-anchor.min.js` are silent after rebuild
53
+ (will rebuild for the rest at release time via `prepublishOnly`).
54
+
55
+ - **Broken installs now fail loudly in Node instead of silently degrading.**
56
+ `index.js` previously wrapped the eager `require('bn.js')` /
57
+ `require('bs58')` / `require('elliptic')` calls in a single try/catch that
58
+ emitted `console.warn('Some dependencies may not be available in browser
59
+ environment')` and continued — so a missing runtime dep in Node (broken
60
+ `npm install`, deleted `node_modules`, container-build mistake) would let
61
+ the library load partially and then explode with a confusing
62
+ `TypeError: Cannot read properties of undefined` deep in `lib/crypto/bn.js`.
63
+ The block now hard-requires those three deps in Node (declared in
64
+ `package.json` `dependencies`, so they MUST be installed) and only
65
+ tolerates absence in browser context where the bundler is expected to
66
+ inline or polyfill them. `Buffer` and the internal `lib/util/_` continue
67
+ to be loaded the same way they always were.
68
+
69
+ - **`Transaction._clearSignatures()` no longer throws on custom-script inputs.**
70
+ When a transaction contained an input whose locking script wasn't one of the
71
+ four auto-recognized standard types (P2PKH, P2PK, bare-multisig, P2SH-multisig),
72
+ `_fromNonP2SH` falls through to the base `Input` class. Any subsequent
73
+ `Transaction` mutation that triggers `_clearSignatures` — `.fee()`, `.change()`,
74
+ adding another input, etc. — then threw `AbstractMethodInvoked: Input#clearSignatures`.
75
+ This bug existed in the upstream bsv@1.5.6 lineage and impacted users of
76
+ covenant and custom-script flows specifically. `transaction.js:_clearSignatures`
77
+ now skips inputs that haven't overridden the base method, matching the
78
+ guard-by-method-identity pattern already used for `isFullySigned` and
79
+ `isValidSignature`. The base `Input.prototype.clearSignatures` still throws
80
+ when called directly, so the original abstract-method contract is preserved.
81
+ Regression tests added in `test/transaction/transaction.js`.
82
+
83
+ ### Added
84
+
85
+ - **`test/cli/smoke.js` — end-to-end smoke test for `bin/cli.js`.** Exercises
86
+ every subcommand the README markets as the on-ramp (`didweb init`,
87
+ `vc issue`, `vc verify`, `status create` / `set` / `check`,
88
+ `anchor hash` / `build`) inside an isolated temp dir per test (13
89
+ tests, ~580ms total). Surfaced two pre-existing CLI bugs in the
90
+ process (resolver shape, hardcoded version — both fixed above). Also
91
+ available as `npm run test:cli`, and wired into the hygiene job of
92
+ `ci.yml`.
93
+
94
+ - **`.github/workflows/ci.yml` — minimal CI** that runs on push/PR to main
95
+ and is designed to catch the exact bug classes shipped in v3.4.0–v3.4.3.
96
+ Three jobs:
97
+ 1. **hygiene** (strict) — fails the build if README/docs contain stale
98
+ `unpkg.com/@smartledger/bsv@X.Y.Z/...` URLs that don't match
99
+ `package.json` version; if any `files:` array entry doesn't resolve
100
+ to a path on disk (globs expanded); if `bsv.d.ts` fails to compile
101
+ against a TS smoke file under `--strict`; or if `npm pack --dry-run`
102
+ output is missing any of `SECURITY.md` / `CHANGELOG.md` / `LICENSE`
103
+ / `README.md` / `bsv.d.ts` / `bsv.min.js`.
104
+ 2. **build** (strict) — runs `npm run build-all` and verifies all 16
105
+ advertised bundles land on disk; checks that `bsv-ltp.min.js` and
106
+ `bsv-gdaf.min.js` are not byte-identical (regression guard for the
107
+ v3.4.4 entry-placeholder fix); UMD-loads each credential bundle and
108
+ verifies its expected exports are accessible.
109
+ 3. **tests** (advisory) — runs `npm test` and `npm run lint` on Node
110
+ 18/20/22, but with `continue-on-error: true`. Will be gated strictly
111
+ after the 25 pre-existing mocha failures and standard@12 lint
112
+ baseline are cleaned up in 3.5.0 (see "Planned for 3.5.0" below).
113
+
114
+ - **`bsv.d.ts` now covers the v3.3+ surface.** The legacy type defs (forked
115
+ from the original moneybutton/bsv types) only described the bitcore-lineage
116
+ core: Transaction, Address, Script, PrivateKey, etc. Everything added in
117
+ v3.3.x and v3.4.x — `DIDWeb`, `VcJwt`, `StatusList`, `Anchor`, `GDAF`, `LTP`
118
+ (class + 60+ top-level `prepare*` and `create*` convenience wrappers),
119
+ `SmartContract` (Covenant, Preimage, SIGHASH, Builder, UTXOGenerator,
120
+ ScriptTester, CovenantBuilder, StackExaminer, ScriptInterpreter, plus
121
+ `scriptToASM`/`asmToScript`/etc.), `SmartVerify`, `EllipticFixed`, `Shamir`
122
+ (with `splitSecret`/`reconstructSecret`/`validateShare` convenience
123
+ wrappers), `BrowserUTXOManager`, and the `SmartLedger` metadata namespace
124
+ — was missing. Added with pragmatic signatures (JWK-typed where shapes are
125
+ stable; `object` / `any` where the runtime takes opaque W3C/JSON
126
+ payloads). Verified by compiling a smoke-test file that exercises every
127
+ new module against `tsc --noEmit` and `tsc --noEmit --strict` (both pass).
128
+
129
+ ### Changed (tarball hygiene)
130
+
131
+ - **`demos/` and `examples/` no longer ship in the npm tarball.** Removed
132
+ from `package.json` `files:` (they're still in the GitHub repo). Reduces
133
+ unpacked size from 11.8 MB → 11.1 MB and file count from 268 → 206
134
+ (≈23% fewer files in every consumer's `node_modules`). Rationale: Node
135
+ consumers `require('@smartledger/bsv')` and never browse those
136
+ directories; CDN consumers fetch `.min.js` files directly and never see
137
+ the tarball. `docs/` is still included — it's actively maintained,
138
+ small (0.39 MB), and useful for users grepping `node_modules` for
139
+ reference material.
140
+ - **13 relative README links to `examples/`, `demos/`, and `tests/`
141
+ rewritten to absolute GitHub URLs** so they keep resolving for anyone
142
+ reading the post-install README from inside `node_modules`. Same final
143
+ destination, just doesn't depend on the directory shipping locally.
144
+ - **CI now enforces an anti-bloat ceiling**: the hygiene job fails if the
145
+ tarball exceeds 250 files or 14 MB unpacked. Baseline after this
146
+ release: 206 files / 11.1 MB — gives ~25% headroom for normal growth.
147
+
148
+ ### Changed (documentation honesty, continued)
149
+
150
+ Further sweep of the same stale-URL bug class fixed in 3.4.2/3.4.3, plus a
151
+ companion `SECURITY.md` and a fix to two long-standing entry-file placeholders.
152
+
153
+ - **README.md**: bumped 20 stale `unpkg.com/@smartledger/bsv@3.4.1/...` and
154
+ `@3.3.4/...` CDN URLs (plus the version badge and install commands) to
155
+ `@3.4.3`. The two historical "v3.4.1 (bugfix)" prose references at the top
156
+ of the file were left intact — they accurately describe what that specific
157
+ release shipped.
158
+ - **`docs/`**: bumped 67 more stale CDN/install URLs that the 3.4.3 sweep
159
+ missed (`@3.4.2`, `@3.3.4`, `@3.1.1`) across `MODULE_REFERENCE_COMPLETE.md`,
160
+ `getting-started/INSTALLATION.md`, `getting-started/QUICK_START.md`,
161
+ `migration/FROM_BSV_1_5_6.md`, `advanced/UTXO_MANAGER_GUIDE.md`, and
162
+ `COVENANT_DEVELOPMENT_RESOLVED.md`.
163
+ - **Bundle sizes corrected** in `README.md` (loading-strategy section and
164
+ use-case table at lines 277–791), `docs/getting-started/INSTALLATION.md`,
165
+ `docs/getting-started/QUICK_START.md`, and `docs/MODULE_REFERENCE_COMPLETE.md`.
166
+ The largest drifts (silent for several releases): `bsv-covenant.min.js`
167
+ shown as 32KB in `docs/` was actually 913KB (28× off); `bsv-ltp.min.js` /
168
+ `bsv-gdaf.min.js` shown as 817KB / 604KB were both 1184KB after the
169
+ 3.4.x rebuilds. README's main loading-options table (lines 138–173) was
170
+ already accurate and was not touched. Subtotals for "load multiple
171
+ bundles together" rows now reflect that each standalone bundle re-embeds
172
+ core BSV — the previous subtotals undercounted by ignoring that overlap.
173
+ - **`SECURITY.md`** added. `package.json` `files:` had listed it since 3.4.0
174
+ but the file did not exist, so npm was silently skipping the entry (same
175
+ class of bug 3.4.1 cleaned up for the other seven dead `files:` entries).
176
+ Uses the GitHub-recognized `## Supported Versions` / `## Reporting a
177
+ Vulnerability` format, points at GitHub Security Advisories +
178
+ `hello@smartledger.technology`, and restates the same opt-in vs.
179
+ default-path posture as README §Security so it can't drift.
180
+ - **`ltp-entry.js` and `gdaf-entry.js`** were placeholders that re-exported
181
+ `lib/smart_contract`. The webpack configs built `bsv-ltp.min.js` and
182
+ `bsv-gdaf.min.js` (1.2 MB each) from these placeholders, so the UMD
183
+ `window.bsvLTP` and `window.bsvGDAF` globals advertised in the README as
184
+ "Legal Token Protocol" and "Digital Identity & Attestation" actually
185
+ exposed the smart-contract module — and the two bundles were byte-identical.
186
+ The entries now point at `./lib/ltp` and `./lib/gdaf` respectively, so the
187
+ bundles expose the `LTP` and `GDAF` classes the README documents. CDN
188
+ consumers who were calling `window.bsvLTP.<smart_contract_method>` will need
189
+ to switch to `bsv-smartcontract.min.js` or use the unbundled `@smartledger/bsv`
190
+ package — the previous behavior was not what was advertised.
191
+
192
+ ### Notes
193
+
194
+ - No public API changes beyond the LTP/GDAF UMD bundle export shape correction
195
+ noted above. All Node.js `require('@smartledger/bsv').LTP` /
196
+ `require('@smartledger/bsv').GDAF` call sites continue to resolve to the
197
+ same `lib/ltp` / `lib/gdaf` modules they always did.
198
+
199
+ ---
200
+
201
+ ## Planned for 3.5.0 — toolchain upgrade
202
+
203
+ Originally promised in 3.4.1's "Notes":
204
+
205
+ > Dev-only vulnerabilities remain in `webpack 4` / `standard 12` / `mocha 8`;
206
+ > a toolchain upgrade is planned for 3.5.0 to address them without breaking
207
+ > downstream bundler integrations.
208
+
209
+ This is the fleshed-out plan for that release. **It does not affect 3.4.x
210
+ runtime behavior; it's a build/test/lint stack migration.** Tracking it here
211
+ in `[Unreleased]` keeps the commitment auditable from the changelog rather
212
+ than a side document.
213
+
214
+ ### Audit baseline (as of v3.4.3)
215
+
216
+ `npm audit` reports **15 high / 9 moderate / 10 low**. All but two are
217
+ strictly dev-chain (webpack 4 / mocha 8 / nyc 14 / standard 12 transitives):
218
+
219
+ - The lone direct runtime entry is **`bn.js` (moderate)** — pinned at
220
+ `=4.11.9` because `elliptic@6.6.1` requires bn.js 4.x. A direct bump to
221
+ `bn.js@5.x` is not safe in isolation; see "Runtime dependency decisions"
222
+ below.
223
+ - **`elliptic` appears in the low list** but is already at upstream's latest
224
+ (6.6.1). The advisory comes via webpack 4's obsolete
225
+ `node-libs-browser → crypto-browserify → browserify-sign → elliptic`
226
+ polyfill chain, which webpack 5 deletes entirely. So bumping webpack to 5
227
+ drops this advisory automatically, no code change required.
228
+
229
+ ### Tooling target versions
230
+
231
+ | Tool | Current | Target | Why |
232
+ | --- | --- | --- | --- |
233
+ | `webpack` | `4.29.3` | `^5.100` | Eliminates the entire `node-libs-browser` polyfill chain (= source of most HIGH vulns), supports modern asset modules, fixes `terser-webpack-plugin` advisory |
234
+ | `webpack-cli` | `^3.3.12` | `^5` or `^6` | Matched to webpack 5; webpack-cli 7 also works but tightens validation |
235
+ | `mocha` | `^8.4.0` | `^10.x` | Mocha 11 requires Node 18+; 10 supports Node 14+. Picking 10 keeps a wider engines window |
236
+ | `nyc` | `^14.1.1` | `^17` or migrate to `c8` | nyc 17 is Node 14+ compatible. Alternative: drop nyc for `c8` (lighter, uses native V8 coverage) |
237
+ | `sinon` | `7.2.3` | `^17.x` | sinon 18+ requires Node 18+. 17 covers Node 14+ |
238
+ | `chai` | `4.2.0` | `4.5.x` (LTS) | **Stay on chai 4.x.** chai 5+ went ESM-only — switching means rewriting `require('chai')` everywhere or migrating the test suite to ESM. Not worth bundling into a toolchain release. |
239
+ | `standard` | `12.0.1` | `^17` or replace | standard 17 uses ESLint 8 (now stale itself); standard 18+ requires Node 18. Open question: stay on `standard`, or move to `eslint@9` + flat config + a smaller rule set. See "Linter decision" below. |
240
+ | `brfs` | `2.0.1` | `2.0.2` | Trivial patch bump |
241
+
242
+ ### Runtime dependency decisions (keep / bump / shim)
243
+
244
+ | Dep | Pin | Latest | Decision |
245
+ | --- | --- | --- | --- |
246
+ | `elliptic` | `6.6.1` | `6.6.1` | **Keep.** Already current. |
247
+ | `bn.js` | `=4.11.9` | `5.2.3` | **Keep at 4.x.** Bumping breaks elliptic; the moderate vuln (constant-time concern in some older 4.x) is mitigated by callers in `lib/crypto/`. Add a comment in `package.json` pinning rationale. |
248
+ | `bs58` | `=4.0.1` | `6.0.0` | **Keep at 4.x.** `bs58@5+` is ESM-only and would force a CJS→ESM migration of `lib/encoding/base58.js`. Out of scope for 3.5.0. |
249
+ | `inherits` | `2.0.3` | `2.0.4` | **Bump to 2.0.4.** Trivial. |
250
+ | `unorm` | `1.4.1` | `1.6.0` | **Bump to 1.6.0.** Non-breaking. |
251
+ | `aes-js` | `^3.1.2` | `3.1.2` | **No change.** |
252
+ | `clone-deep` | `^4.0.1` | `4.0.1` | **No change.** |
253
+ | `hash.js` | `^1.1.7` | `1.1.7` | **No change.** |
254
+
255
+ ### Required code / config changes
256
+
257
+ 1. **`build/webpack.*.config.js` (12 files).** webpack 5 removes the
258
+ automatic Node polyfills that webpack 4 silently injects. Concrete
259
+ touches needed:
260
+ - Add `resolve.fallback` entries for `buffer`, `crypto`, `stream`,
261
+ `process` (or use `node-polyfill-webpack-plugin`).
262
+ - Add `buffer`, `process`, `stream-browserify`, `crypto-browserify`
263
+ (or modern equivalents) as **dev**-deps so the fallbacks resolve.
264
+ - `output.library` ideally migrates from string to object form
265
+ (`{ name: 'bsvFoo', type: 'umd' }`) — webpack 5 still accepts the
266
+ string form but warns.
267
+ - `globalObject: 'this'` should become `globalObject: 'globalThis'`
268
+ (cleaner; matches modern targets).
269
+ - Drop `NODE_OPTIONS="--openssl-legacy-provider"` from all 16 `npm run
270
+ build-*` scripts — that workaround exists *because* webpack 4 pins
271
+ legacy OpenSSL APIs. webpack 5 doesn't need it.
272
+
273
+ 2. **`test/mocha.opts` → `.mocharc.cjs` (or `mocha` field in package.json).**
274
+ Mocha 8 already emits a deprecation warning for `mocha.opts`; mocha 10
275
+ removes support entirely. Migrate the existing two flags
276
+ (`--recursive`, `--timeout 5000`) and add `--reporter spec`.
277
+
278
+ 3. **`engines` field in `package.json`.** No engines is declared today.
279
+ For 3.5.0 add `"engines": { "node": ">=14" }` (or `>=18` if we also
280
+ adopt mocha 11 / sinon 18 / standard 18). Current consumer test
281
+ environments span Node 14–22, so `>=14` is the safer choice.
282
+
283
+ 4. **`@types/node` peer dep or dev-dep.** With the typing fix in 3.4.4,
284
+ `bsv.d.ts` formally depends on Node types (`/// <reference types="node" />`).
285
+ Add `"peerDependencies": { "@types/node": "*" }` (optional) or document
286
+ in README that TS consumers need `@types/node` installed.
287
+
288
+ 5. **Linter decision (open question).**
289
+ Option A — Stay on `standard@17`: 1-line bump, ~1 day to fix new lint
290
+ errors. Risk: standard's own toolchain is aging.
291
+ Option B — Migrate to ESLint flat config (`eslint.config.js`) with a
292
+ custom rule set. More work, but unblocks long-term flexibility and the
293
+ newer rule engine.
294
+ **Recommendation:** A for 3.5.0, defer B to 3.6.0.
295
+
296
+ ### Risk ranking and rollout order
297
+
298
+ Each step should be its own PR, validated against the full `test/` suite
299
+ (120+ mocha tests passed in 3.4.4) and a `npm pack --dry-run` size diff.
300
+
301
+ 1. **Low risk:** `inherits` / `unorm` patch bumps, `brfs 2.0.1 → 2.0.2`,
302
+ add `engines` field, migrate `mocha.opts → .mocharc.cjs`.
303
+ 2. **Medium risk:** mocha 8 → 10, nyc 14 → 17, sinon 7 → 17, standard
304
+ 12 → 17. Test suite may have lint/test syntax regressions.
305
+ 3. **Higher risk:** webpack 4 → 5. This is the bundle-shape change;
306
+ downstream CDN consumers will see different file bytes. Plan a beta
307
+ release (`3.5.0-beta.1`) on npm before the GA bump so integrators can
308
+ validate.
309
+ 4. **Out of scope, deferred:** `bn.js 4 → 5`, `bs58 4 → 6`, `chai 4 → 5`,
310
+ linter overhaul. These all imply CJS→ESM or coordinated upstream
311
+ changes and warrant a separate 3.6.0 effort.
312
+
313
+ ### Pre-release validation checklist
314
+
315
+ Before publishing `3.5.0`:
316
+
317
+ - `npm test` passes (Node 18, 20, 22).
318
+ - `npm run build-all` succeeds without `NODE_OPTIONS` workaround.
319
+ - All 16 bundles built and:
320
+ - sized within 5% of 3.4.x equivalents (or sizes updated in README/docs);
321
+ - smoke-tested in a browser via `tests/*.html` against the unpkg URL;
322
+ - UMD globals (`window.bsv`, `bsvLTP`, `bsvGDAF`, etc.) resolve correctly.
323
+ - `npm audit` shows zero high/critical, ≤ 5 moderate (any remaining moderates
324
+ documented in CHANGELOG with mitigation).
325
+ - `tsc --noEmit --strict` against `bsv.d.ts` + smoke file still passes.
326
+ - Tag `3.5.0-beta.1` on npm for at least 7 days to let integrators report
327
+ bundle regressions before GA.
328
+
329
+ ## [3.4.3] - 2026-05-18
330
+
331
+ ### Changed (documentation honesty, continued)
332
+
333
+ Companion to 3.4.2. The README was corrected in 3.4.2 but several shipped docs in `docs/` still contained the same overclaims and stale `@3.3.4` CDN URLs that would 404 for users upgrading from 3.4.0+.
334
+
335
+ - **`docs/migration/FROM_BSV_1_5_6.md`**: replaced "Now with hardened elliptic curves" comment on `new bsv.PrivateKey()` and the "Enhanced Security under the hood" framing with accurate "standard API behaves identically; opt-in hardening helpers available — call `bsv.SmartVerify.smartVerify()` explicitly" wording.
336
+ - **`docs/getting-started/QUICK_START.md`**: replaced "Elliptic curve hardening - Enhanced cryptographic security" bullet with accurate description of the opt-in helpers + pinned-dependency facts.
337
+ - **`docs/advanced/LEGAL_TOKEN_PROTOCOL.md`**: corrected three places that claimed LTP tokens are "signed with hardened crypto" / "enhanced elliptic curves". Token signing uses BSV's standard ECDSA path; `SmartVerify` is opt-in for verification.
338
+ - **`docs/MODULE_REFERENCE_COMPLETE.md`** and **`docs/getting-started/INSTALLATION.md`**: bumped 15+ stale `unpkg.com/@smartledger/bsv@3.3.4/...` URLs to `@3.4.2` (those URLs were 404'ing for anyone copy-pasting from these guides); corrected `bsv-security.min.js` size from `290KB` to `26KB` (10× off); labeled "opt-in helpers" with link to the canonical Security section in README.
339
+
340
+ ### Notes
341
+
342
+ - No code or bundle behavior changes. This is a docs-only correction; bundles are rebuilt purely because the version string is embedded.
343
+
8
344
  ## [3.4.2] - 2026-05-18
9
345
 
10
346
  ### Changed (documentation honesty)