@smartledger/bsv 8.3.1 → 9.1.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 (169) hide show
  1. package/CHANGELOG.md +228 -0
  2. package/README.md +152 -1031
  3. package/STABILITY.md +134 -0
  4. package/bsv-gdaf.min.js +58 -53
  5. package/bsv-ltp.min.js +23 -18
  6. package/bsv-script-helper.min.js +1 -1
  7. package/bsv-smartcontract.min.js +21 -21
  8. package/bsv.bundle.js +58 -53
  9. package/bsv.d.ts +0 -4
  10. package/bsv.min.js +58 -53
  11. package/docs/BRC220_BATCH_LEAF_AMENDMENT.md +82 -7
  12. package/docs/MODULE_REFERENCE_COMPLETE.md +27 -27
  13. package/docs/README.md +2 -1
  14. package/docs/THREAT_MODEL.md +10 -2
  15. package/docs/advanced/UTXO_MANAGER_GUIDE.md +1 -1
  16. package/docs/getting-started/INSTALLATION.md +23 -23
  17. package/docs/getting-started/QUICK_START.md +7 -7
  18. package/docs/migration/FROM_BSV_1_5_6.md +5 -5
  19. package/docs/proposals/10.0.0-package-split.md +131 -0
  20. package/index.js +15 -26
  21. package/lib/block/merkleblock.js +19 -5
  22. package/lib/covenant/helpers.js +34 -35
  23. package/lib/covenant/pushtx.js +2 -2
  24. package/lib/custom-script-helper.js +0 -16
  25. package/lib/hdprivatekey.js +15 -0
  26. package/lib/ordinals/ordlock.js +1 -1
  27. package/lib/script/interpreter.js +109 -1
  28. package/lib/smart_contract/builder.js +14 -0
  29. package/lib/smart_contract/debugger.js +2 -2
  30. package/lib/smart_contract/dsl.js +2 -2
  31. package/lib/smart_contract/index.js +0 -3
  32. package/lib/smart_contract/locks.js +1 -41
  33. package/lib/smart_contract/pels.js +1 -1
  34. package/lib/smart_contract/token.js +1 -1
  35. package/lib/util/deprecate.js +159 -0
  36. package/package.json +19 -82
  37. package/tools/gen-brc220-batch-vector.js +205 -0
  38. package/version.js +1 -1
  39. package/.mocharc.json +0 -5
  40. package/test/address.js +0 -629
  41. package/test/block/block.js +0 -239
  42. package/test/block/blockheader.js +0 -270
  43. package/test/block/merkleblock.js +0 -207
  44. package/test/build/bundle_crypto_shim.js +0 -104
  45. package/test/build/bundle_externals.js +0 -125
  46. package/test/build/bundle_smoke.js +0 -55
  47. package/test/build/esbuild_main.js +0 -65
  48. package/test/build/esm_wrapper.js +0 -73
  49. package/test/build/exports_resolution.js +0 -84
  50. package/test/build/version_sync.js +0 -14
  51. package/test/cli/smoke.js +0 -261
  52. package/test/consensus/base58-vectors.js +0 -120
  53. package/test/consensus/sv-script-vectors.js +0 -81
  54. package/test/consensus/sv-sighash-vectors.js +0 -51
  55. package/test/consensus/sv-tx-vectors.js +0 -48
  56. package/test/credentials-test.js +0 -332
  57. package/test/crypto/backend_selection.js +0 -126
  58. package/test/crypto/bn.js +0 -168
  59. package/test/crypto/ecdsa.js +0 -426
  60. package/test/crypto/elliptic-fixed.js +0 -61
  61. package/test/crypto/hash.browser.js +0 -121
  62. package/test/crypto/hash.js +0 -122
  63. package/test/crypto/point.js +0 -193
  64. package/test/crypto/random.js +0 -105
  65. package/test/crypto/security.js +0 -176
  66. package/test/crypto/shamir.js +0 -177
  67. package/test/crypto/shamir_rngcap.js +0 -29
  68. package/test/crypto/signature.js +0 -399
  69. package/test/data/bip69.json +0 -215
  70. package/test/data/bitcoin-sv/README.md +0 -170
  71. package/test/data/bitcoin-sv/base58_encode_decode.json +0 -14
  72. package/test/data/bitcoin-sv/base58_keys_invalid.json +0 -152
  73. package/test/data/bitcoin-sv/base58_keys_valid.json +0 -452
  74. package/test/data/bitcoin-sv/script_tests.json +0 -2591
  75. package/test/data/bitcoin-sv/sighash.json +0 -1003
  76. package/test/data/bitcoin-sv/tx_invalid.json +0 -285
  77. package/test/data/bitcoin-sv/tx_valid.json +0 -367
  78. package/test/data/bitcoind/base58_keys_invalid.json +0 -152
  79. package/test/data/bitcoind/base58_keys_valid.json +0 -452
  80. package/test/data/bitcoind/blocks.json +0 -27
  81. package/test/data/bitcoind/script_tests.json +0 -2244
  82. package/test/data/bitcoind/sig_canonical.json +0 -7
  83. package/test/data/bitcoind/sig_noncanonical.json +0 -22
  84. package/test/data/bitcoind/tx_invalid.json +0 -177
  85. package/test/data/bitcoind/tx_valid.json +0 -224
  86. package/test/data/blk86756-testnet.dat +0 -0
  87. package/test/data/blk86756-testnet.js +0 -12
  88. package/test/data/blk86756-testnet.json +0 -684
  89. package/test/data/ecdsa.json +0 -230
  90. package/test/data/merkleblocks.js +0 -486
  91. package/test/data/messages.json +0 -22
  92. package/test/data/sighash.json +0 -1004
  93. package/test/data/tx_creation.json +0 -85
  94. package/test/didweb/relationships.js +0 -144
  95. package/test/ecies/bitcore-ecies.js +0 -178
  96. package/test/ecies/electrum-ecies.js +0 -206
  97. package/test/encoding/base58.js +0 -131
  98. package/test/encoding/base58check.js +0 -145
  99. package/test/encoding/bufferreader.js +0 -328
  100. package/test/encoding/bufferwriter.js +0 -160
  101. package/test/encoding/varint.js +0 -104
  102. package/test/gdaf/anchor_no_key_leak.js +0 -146
  103. package/test/gdaf/anchor_spv.js +0 -163
  104. package/test/gdaf/canonicalization.js +0 -106
  105. package/test/gdaf/canonicalize.js +0 -140
  106. package/test/gdaf/zk_prover.js +0 -204
  107. package/test/hdkeys.js +0 -365
  108. package/test/hdprivatekey.js +0 -339
  109. package/test/hdpublickey.js +0 -293
  110. package/test/index.js +0 -16
  111. package/test/ltp/ids.js +0 -74
  112. package/test/ltp/right.js +0 -198
  113. package/test/ltp/verify_failclosed.js +0 -134
  114. package/test/message/message.js +0 -190
  115. package/test/mnemonic/data/fixtures.json +0 -300
  116. package/test/mnemonic/mnemonic.js +0 -277
  117. package/test/mnemonic/mocha.opts +0 -1
  118. package/test/mnemonic/pbkdf2.test.js +0 -43
  119. package/test/networks.js +0 -207
  120. package/test/notaryhash/batch_leaf.js +0 -140
  121. package/test/notaryhash/certificate.js +0 -249
  122. package/test/notaryhash/encoding.js +0 -186
  123. package/test/notaryhash/interop.js +0 -112
  124. package/test/notaryhash/merkle.js +0 -181
  125. package/test/notaryhash/script.js +0 -270
  126. package/test/notaryhash/verify.js +0 -342
  127. package/test/opcode.js +0 -186
  128. package/test/ordinals/bsv20.js +0 -337
  129. package/test/ordinals/inscription.js +0 -319
  130. package/test/ordinals/ordlock.js +0 -613
  131. package/test/privatekey.js +0 -540
  132. package/test/publickey.js +0 -411
  133. package/test/regressions.js +0 -215
  134. package/test/script/chronicle.js +0 -543
  135. package/test/script/defaults.js +0 -160
  136. package/test/script/genesis_limits.js +0 -203
  137. package/test/script/interpreter.js +0 -776
  138. package/test/script/script.js +0 -1259
  139. package/test/script/string_ops.js +0 -88
  140. package/test/security/fail_closed_contracts.js +0 -104
  141. package/test/security/threat_model_coverage.js +0 -31
  142. package/test/smart_contract/covenants.js +0 -245
  143. package/test/smart_contract/dsl_debugger.js +0 -101
  144. package/test/smart_contract/extract_field.js +0 -61
  145. package/test/smart_contract/nonenforcing_guard.js +0 -44
  146. package/test/smart_contract/ordinal_transfer.js +0 -81
  147. package/test/smart_contract/preimage.js +0 -98
  148. package/test/smart_contract/sighash_marketplace.js +0 -108
  149. package/test/smart_contract/token_generalized.js +0 -185
  150. package/test/spv/headerchain.js +0 -86
  151. package/test/spv/merkleproof.js +0 -133
  152. package/test/statuslist/failclosed.js +0 -78
  153. package/test/transaction/deserialize.js +0 -33
  154. package/test/transaction/input/input.js +0 -92
  155. package/test/transaction/input/multisig.js +0 -174
  156. package/test/transaction/input/multisigscripthash.js +0 -111
  157. package/test/transaction/input/publickey.js +0 -68
  158. package/test/transaction/input/publickeyhash.js +0 -59
  159. package/test/transaction/output.js +0 -185
  160. package/test/transaction/sighash.js +0 -91
  161. package/test/transaction/signature.js +0 -127
  162. package/test/transaction/transaction.js +0 -1299
  163. package/test/transaction/unspentoutput.js +0 -97
  164. package/test/types/dts_drift.js +0 -124
  165. package/test/types/surface_honesty.js +0 -102
  166. package/test/util/id.js +0 -72
  167. package/test/util/js.js +0 -76
  168. package/test/util/preconditions.js +0 -79
  169. package/test/vcjwt/interop.js +0 -126
@@ -110,10 +110,85 @@ of the three and this is the moment to fix it, before that stops being true.
110
110
 
111
111
  ---
112
112
 
113
- ## Recommended alongside
114
-
115
- Publish a **batch-mode golden vector** with the other test vectors: a small tree — four
116
- proofs, say — with the four `proofHash` values, the resulting root, and the inclusion path
117
- for one leaf. One such vector removes this entire class of ambiguity for every future
118
- implementer, in a way that no amount of prose reliably does. Its absence is why this
119
- document is necessary.
113
+ ## The golden vector, ready to publish
114
+
115
+ Prose does not reliably close this: two implementers read the same sentence and chose
116
+ differently. A vector does. This one is generated by
117
+ `tools/gen-brc220-batch-vector.js`, lives at `test/data/brc220-batch-vector.json`, and is
118
+ checked by `test/notaryhash/batch_vector.js`.
119
+
120
+ **Five leaves, not four.** RFC 6962 splits at the largest power of two *below* `n`, so
121
+ `n = 5` splits 4/1 — a midpoint split would give 2/3 and a different root — and an odd
122
+ count exercises the rule that the last leaf is never duplicated. Those are the two places
123
+ implementations of this tree go wrong, and a power-of-two vector catches neither. It shows
124
+ up in the audit-path lengths: `[3, 3, 3, 3, 1]`.
125
+
126
+ Every input is derived from a labelled preimage rather than chosen, so the file
127
+ regenerates byte-identically and any implementation can rebuild it from scratch:
128
+
129
+ - private key `i` = `SHA-256("BRC-220/batch-vector/key/" + i)`
130
+ - `payloadHash` `i` = `SHA-256("BRC-220/batch-vector/payload/" + i)`
131
+ - `createdAt` `i` = `2026-01-0(i+1)T00:00:00.000Z`
132
+ - `algorithm` = `ECDSA-secp256k1`, `hashAlgorithm` = `SHA-256`, `encoding` = `"raw"`
133
+
134
+ **Signing.** The signer signs the 32-byte `payloadHash` directly — the digest *is* the
135
+ scalar, big-endian. RFC 6979 makes the nonce deterministic, so the signatures, and every
136
+ hash derived from them, reproduce exactly.
137
+
138
+ This matters more than it looks. The signature is inside `canonicalBytes`, which is inside
139
+ `proofHash`, which is the leaf — so the signing convention determines the root. An earlier
140
+ draft of this vector was generated against the byte-reversed convention that
141
+ `@smartledger/bsv` 8.3.0 used when verifying, and produced five signatures that no
142
+ conformant implementation could check (0/5 under `@noble/curves`), together with a root
143
+ nobody else would compute. It was never published. The values below were generated at
144
+ **8.3.1**, and `test/notaryhash/batch_vector.js` now verifies every signature under
145
+ `@noble/curves` as well as under this library, because a generator and a checker that
146
+ share a signer agree with each other whether or not they are right.
147
+
148
+ The five `proofHash` values that result:
149
+
150
+ | leafIndex | proofHash |
151
+ | ---: | --- |
152
+ | 0 | `83f3f73ebc5146b96cce1ee0b6ed4fd251a933a5332fbe5e5ab80da7920fe2c9` |
153
+ | 1 | `29fca10808a3653efbe38abd5f0b926aa09f13bff7847475139a422869729e77` |
154
+ | 2 | `3c44828bea3ca01dfcd5305a839ce02cc1e855f5a7c7028bb4931d42dea3aa2b` |
155
+ | 3 | `0692e22da9b68634e5384bb012324c140c676d2301e078a67f17e335661a9565` |
156
+ | 4 | `1a9c6bc1a6cf8319344ca8c30ca9e9eef8ab3df732748f6be2c824bb84ec0ca9` |
157
+
158
+ **Merkle root (`d = proofHash`, this amendment):**
159
+
160
+ ```
161
+ abb53eb3b2e3530d51685c6813bb85c85892d2f214c2dc504029d071434ac074
162
+ ```
163
+
164
+ The on-chain record tail is therefore `merkleRoot` above followed by
165
+ `u32be(5) = 00000005`. The audit path for leaf 4 — the lone right-hand leaf, and the
166
+ cheapest single value to check a split rule against — is one node:
167
+
168
+ ```
169
+ 060ca4e4bbcb647ab0162bb027cd8f08c1577aaa7069166dd629a3df7e57befd
170
+ ```
171
+
172
+ **Merkle root under the rejected reading (`d = canonicalBytes`):**
173
+
174
+ ```
175
+ 4a59ade74941e4d6ca4b7c9f610e0a01a0c3f24cfa94efe816e53ef85f99e324
176
+ ```
177
+
178
+ That second root is published deliberately. An implementation computing it has made the
179
+ other reading of `d` — which is a sound choice against an ambiguous sentence, not a bug in
180
+ their code — and printing both turns a silent non-interoperability into a one-line
181
+ diagnosis.
182
+
183
+ The stored vector records `canonicalBytes`, `proofHash` and the leaf hash under *both*
184
+ readings for every proof, so an implementer can find which step diverges rather than only
185
+ that the roots differ.
186
+
187
+ ### What this vector is not
188
+
189
+ It is a conformance target produced by `@smartledger/bsv`, not external validation, and it
190
+ does not prove this reading is the one originally intended — the spec does not say. What
191
+ makes it load-bearing is that the tree beneath it is independently anchored: the RFC 6962
192
+ construction is verified against the published Certificate Transparency roots in
193
+ `test/notaryhash/merkle.js`. Given a tree that provably matches RFC 6962, the vector fixes
194
+ the single thing left open.
@@ -55,19 +55,19 @@ Three advanced modules totaling **~2.7MB** of functionality:
55
55
  - **Purpose**: Threshold cryptography for secure secret distribution
56
56
  - **Use Cases**: Backup keys, multi-party security, key recovery
57
57
  - **Features**: Split secrets into N shares, require M to reconstruct
58
- - **CDN**: `unpkg.com/@smartledger/bsv@8.3.1/bsv-shamir.min.js`
58
+ - **CDN**: `unpkg.com/@smartledger/bsv@9.1.0/bsv-shamir.min.js`
59
59
 
60
60
  #### **🌐 Global Digital Attestation Framework - GDAF (1184KB)**
61
61
  - **Purpose**: W3C Verifiable Credentials and decentralized identity
62
62
  - **Use Cases**: Identity verification, attestations, zero-knowledge proofs
63
63
  - **Features**: DID creation, credential issuance, selective disclosure
64
- - **CDN**: `unpkg.com/@smartledger/bsv@8.3.1/bsv-gdaf.min.js`
64
+ - **CDN**: `unpkg.com/@smartledger/bsv@9.1.0/bsv-gdaf.min.js`
65
65
 
66
66
  #### **⚖️ Legal Token Protocol - LTP (1184KB)**
67
67
  - **Purpose**: Legal compliance framework for tokenized assets
68
68
  - **Use Cases**: Property rights, obligations, compliant tokenization
69
69
  - **Features**: Legal primitives, compliance checking, attestation anchoring
70
- - **CDN**: `unpkg.com/@smartledger/bsv@8.3.1/bsv-ltp.min.js`
70
+ - **CDN**: `unpkg.com/@smartledger/bsv@9.1.0/bsv-ltp.min.js`
71
71
 
72
72
  ### **2. Incorrect File Sizes in Documentation**
73
73
 
@@ -81,18 +81,18 @@ Three advanced modules totaling **~2.7MB** of functionality:
81
81
 
82
82
  | Module | Size | Use Case | CDN Link |
83
83
  |--------|------|----------|----------|
84
- | **bsv.min.js** | 937KB | Core BSV + SmartContract | `unpkg.com/@smartledger/bsv@8.3.1/bsv.min.js` |
85
- | **bsv.bundle.js** | 937KB | Everything in one file | `unpkg.com/@smartledger/bsv@8.3.1/bsv.bundle.js` |
86
- | **bsv-smartcontract.min.js** | 937KB | Covenant development | `unpkg.com/@smartledger/bsv@8.3.1/bsv-smartcontract.min.js` |
87
- | **bsv-covenant.min.js** | 913KB | Covenant operations | `unpkg.com/@smartledger/bsv@8.3.1/bsv-covenant.min.js` |
88
- | **bsv-script-helper.min.js** | 26KB | Custom script tools | `unpkg.com/@smartledger/bsv@8.3.1/bsv-script-helper.min.js` |
89
- | **bsv-security.min.js** | 26KB | Security enhancements (opt-in helpers — see README › Security) | `unpkg.com/@smartledger/bsv@8.3.1/bsv-security.min.js` |
90
- | **bsv-ecies.min.js** | 71KB | Encryption | `unpkg.com/@smartledger/bsv@8.3.1/bsv-ecies.min.js` |
91
- | **bsv-message.min.js** | 26KB | Message signing | `unpkg.com/@smartledger/bsv@8.3.1/bsv-message.min.js` |
92
- | **bsv-mnemonic.min.js** | 681KB | HD wallets | `unpkg.com/@smartledger/bsv@8.3.1/bsv-mnemonic.min.js` |
93
- | **🆕 bsv-shamir.min.js** | 432KB | **Secret sharing** | `unpkg.com/@smartledger/bsv@8.3.1/bsv-shamir.min.js` |
94
- | **🆕 bsv-gdaf.min.js** | 1184KB | **Digital attestation** | `unpkg.com/@smartledger/bsv@8.3.1/bsv-gdaf.min.js` |
95
- | **🆕 bsv-ltp.min.js** | 1184KB | **Legal tokens** | `unpkg.com/@smartledger/bsv@8.3.1/bsv-ltp.min.js` |
84
+ | **bsv.min.js** | 937KB | Core BSV + SmartContract | `unpkg.com/@smartledger/bsv@9.1.0/bsv.min.js` |
85
+ | **bsv.bundle.js** | 937KB | Everything in one file | `unpkg.com/@smartledger/bsv@9.1.0/bsv.bundle.js` |
86
+ | **bsv-smartcontract.min.js** | 937KB | Covenant development | `unpkg.com/@smartledger/bsv@9.1.0/bsv-smartcontract.min.js` |
87
+ | **bsv-covenant.min.js** | 913KB | Covenant operations | `unpkg.com/@smartledger/bsv@9.1.0/bsv-covenant.min.js` |
88
+ | **bsv-script-helper.min.js** | 26KB | Custom script tools | `unpkg.com/@smartledger/bsv@9.1.0/bsv-script-helper.min.js` |
89
+ | **bsv-security.min.js** | 26KB | Security enhancements (opt-in helpers — see README › Security) | `unpkg.com/@smartledger/bsv@9.1.0/bsv-security.min.js` |
90
+ | **bsv-ecies.min.js** | 71KB | Encryption | `unpkg.com/@smartledger/bsv@9.1.0/bsv-ecies.min.js` |
91
+ | **bsv-message.min.js** | 26KB | Message signing | `unpkg.com/@smartledger/bsv@9.1.0/bsv-message.min.js` |
92
+ | **bsv-mnemonic.min.js** | 681KB | HD wallets | `unpkg.com/@smartledger/bsv@9.1.0/bsv-mnemonic.min.js` |
93
+ | **🆕 bsv-shamir.min.js** | 432KB | **Secret sharing** | `unpkg.com/@smartledger/bsv@9.1.0/bsv-shamir.min.js` |
94
+ | **🆕 bsv-gdaf.min.js** | 1184KB | **Digital attestation** | `unpkg.com/@smartledger/bsv@9.1.0/bsv-gdaf.min.js` |
95
+ | **🆕 bsv-ltp.min.js** | 1184KB | **Legal tokens** | `unpkg.com/@smartledger/bsv@9.1.0/bsv-ltp.min.js` |
96
96
 
97
97
  ## 🎯 **Updated Usage Examples**
98
98
 
@@ -100,22 +100,22 @@ Three advanced modules totaling **~2.7MB** of functionality:
100
100
 
101
101
  #### **1. Basic Development (~963KB)**
102
102
  ```html
103
- <script src="https://unpkg.com/@smartledger/bsv@8.3.1/bsv.min.js"></script>
104
- <script src="https://unpkg.com/@smartledger/bsv@8.3.1/bsv-script-helper.min.js"></script>
103
+ <script src="https://unpkg.com/@smartledger/bsv@9.1.0/bsv.min.js"></script>
104
+ <script src="https://unpkg.com/@smartledger/bsv@9.1.0/bsv-script-helper.min.js"></script>
105
105
  ```
106
106
 
107
107
  #### **2. Smart Contract Development (~2.7MB — each bundle re-embeds core BSV)**
108
108
  ```html
109
- <script src="https://unpkg.com/@smartledger/bsv@8.3.1/bsv.min.js"></script>
110
- <script src="https://unpkg.com/@smartledger/bsv@8.3.1/bsv-covenant.min.js"></script>
111
- <script src="https://unpkg.com/@smartledger/bsv@8.3.1/bsv-smartcontract.min.js"></script>
109
+ <script src="https://unpkg.com/@smartledger/bsv@9.1.0/bsv.min.js"></script>
110
+ <script src="https://unpkg.com/@smartledger/bsv@9.1.0/bsv-covenant.min.js"></script>
111
+ <script src="https://unpkg.com/@smartledger/bsv@9.1.0/bsv-smartcontract.min.js"></script>
112
112
  ```
113
113
 
114
114
  #### **3. 🆕 Legal & Compliance Development (~3.2MB — each bundle re-embeds core BSV)**
115
115
  ```html
116
- <script src="https://unpkg.com/@smartledger/bsv@8.3.1/bsv.min.js"></script>
117
- <script src="https://unpkg.com/@smartledger/bsv@8.3.1/bsv-ltp.min.js"></script>
118
- <script src="https://unpkg.com/@smartledger/bsv@8.3.1/bsv-gdaf.min.js"></script>
116
+ <script src="https://unpkg.com/@smartledger/bsv@9.1.0/bsv.min.js"></script>
117
+ <script src="https://unpkg.com/@smartledger/bsv@9.1.0/bsv-ltp.min.js"></script>
118
+ <script src="https://unpkg.com/@smartledger/bsv@9.1.0/bsv-gdaf.min.js"></script>
119
119
  <script>
120
120
  // Legal Token Protocol
121
121
  const legalToken = bsv.createLegalToken({
@@ -132,9 +132,9 @@ Three advanced modules totaling **~2.7MB** of functionality:
132
132
 
133
133
  #### **4. 🆕 Security & Cryptography (~1.4MB)**
134
134
  ```html
135
- <script src="https://unpkg.com/@smartledger/bsv@8.3.1/bsv.min.js"></script>
136
- <script src="https://unpkg.com/@smartledger/bsv@8.3.1/bsv-security.min.js"></script>
137
- <script src="https://unpkg.com/@smartledger/bsv@8.3.1/bsv-shamir.min.js"></script>
135
+ <script src="https://unpkg.com/@smartledger/bsv@9.1.0/bsv.min.js"></script>
136
+ <script src="https://unpkg.com/@smartledger/bsv@9.1.0/bsv-security.min.js"></script>
137
+ <script src="https://unpkg.com/@smartledger/bsv@9.1.0/bsv-shamir.min.js"></script>
138
138
  <script>
139
139
  // Shamir Secret Sharing
140
140
  const shares = bsv.splitSecret('my_secret_key', 5, 3); // 5 shares, 3 needed
@@ -146,7 +146,7 @@ Three advanced modules totaling **~2.7MB** of functionality:
146
146
 
147
147
  #### **5. Everything Bundle (937KB)**
148
148
  ```html
149
- <script src="https://unpkg.com/@smartledger/bsv@8.3.1/bsv.bundle.js"></script>
149
+ <script src="https://unpkg.com/@smartledger/bsv@9.1.0/bsv.bundle.js"></script>
150
150
  <script>
151
151
  // Everything available immediately
152
152
  const shares = bsv.splitSecret('secret', 5, 3);
package/docs/README.md CHANGED
@@ -138,7 +138,8 @@ const helper = new CustomScriptHelper();
138
138
  const multisig = helper.createMultisigScript([pk1, pk2, pk3], 2);
139
139
 
140
140
  // Timelock script
141
- const timelock = helper.createTimelockScript(publicKey, 750000, 'block');
141
+ // REMOVED in 9.0.0 — OP_CHECKLOCKTIMEVERIFY is a NOP after Genesis, so this
142
+ // enforced nothing on mainnet. There is no supported time-lock primitive.
142
143
  ```
143
144
 
144
145
  ### 📊 BIP143 Preimage Analysis
@@ -108,8 +108,16 @@ Node, or hostile browser extension is out of scope — see `SECURITY.md`).
108
108
  - **No published provenance yet.** Bundles are a reproducible build of source (see §4) but
109
109
  npm provenance attestation is pending a trusted-publisher registration (2FA-gated). This is
110
110
  a *supply-chain verifiability* gap, not a code vulnerability.
111
- - **Genesis limits.** Covenant scripts require post-Genesis limits (`SmartContract.enableGenesis()`);
112
- the guarantees assume a post-Genesis BSV node.
111
+ - **CLTV time locks removed (9.0.0).** `Locks.timeLockCLTV`, `Locks.htlc` and
112
+ `CustomScriptHelper.createTimelockScript` were gated by `OP_CHECKLOCKTIMEVERIFY`,
113
+ which Genesis reverted to an upgradable NOP for outputs created after it. They
114
+ enforced **nothing** on mainnet — the coins were spendable immediately — yet the
115
+ library's own tests asserted the lock held, because the covenant harness verified
116
+ under flags missing the era bits. That is the §1 failure mode found in our own code,
117
+ and the reason the API was deleted rather than documented: a time lock that does not
118
+ lock has no safe use. There is no supported time-lock primitive in this library.
119
+ - **Consensus era.** Covenant guarantees assume current BSV mainnet; the harness verifies
120
+ under `Interpreter.mainnetFlags()` with no opt-in required (8.4.0+).
113
121
 
114
122
  ## 4. Supply chain / reproducible builds
115
123
 
@@ -722,7 +722,7 @@ interface UTXO {
722
722
  <html>
723
723
  <head>
724
724
  <title>UTXO Manager Demo</title>
725
- <script src="https://cdn.jsdelivr.net/npm/@smartledger/bsv@8.3.1/bsv.min.js"></script>
725
+ <script src="https://cdn.jsdelivr.net/npm/@smartledger/bsv@9.1.0/bsv.min.js"></script>
726
726
  </head>
727
727
  <body>
728
728
  <script>
@@ -48,7 +48,7 @@ const tx: Transaction = new Transaction();
48
48
  #### **Core Library Only (937KB)**
49
49
  For basic Bitcoin SV operations:
50
50
  ```html
51
- <script src="https://unpkg.com/@smartledger/bsv@8.3.1/bsv.min.js"></script>
51
+ <script src="https://unpkg.com/@smartledger/bsv@9.1.0/bsv.min.js"></script>
52
52
  <script>
53
53
  const privateKey = new bsv.PrivateKey();
54
54
  const address = privateKey.toAddress();
@@ -58,7 +58,7 @@ For basic Bitcoin SV operations:
58
58
  #### **Complete Bundle (937KB)**
59
59
  Everything in one file:
60
60
  ```html
61
- <script src="https://unpkg.com/@smartledger/bsv@8.3.1/bsv.bundle.js"></script>
61
+ <script src="https://unpkg.com/@smartledger/bsv@9.1.0/bsv.bundle.js"></script>
62
62
  <script>
63
63
  // All features available immediately
64
64
  const shares = bsv.splitSecret('secret', 5, 3);
@@ -71,9 +71,9 @@ Everything in one file:
71
71
 
72
72
  #### **Smart Contract Development (~2.7MB total — each bundle is self-contained and re-embeds core BSV)**
73
73
  ```html
74
- <script src="https://unpkg.com/@smartledger/bsv@8.3.1/bsv.min.js"></script>
75
- <script src="https://unpkg.com/@smartledger/bsv@8.3.1/bsv-covenant.min.js"></script>
76
- <script src="https://unpkg.com/@smartledger/bsv@8.3.1/bsv-smartcontract.min.js"></script>
74
+ <script src="https://unpkg.com/@smartledger/bsv@9.1.0/bsv.min.js"></script>
75
+ <script src="https://unpkg.com/@smartledger/bsv@9.1.0/bsv-covenant.min.js"></script>
76
+ <script src="https://unpkg.com/@smartledger/bsv@9.1.0/bsv-smartcontract.min.js"></script>
77
77
  <script>
78
78
  const covenant = bsv.SmartContract.createCovenantBuilder()
79
79
  .extractField('amount').push(50000).greaterThanOrEqual().build();
@@ -82,9 +82,9 @@ Everything in one file:
82
82
 
83
83
  #### **Legal & Identity Development (~3.2MB total — each bundle is self-contained and re-embeds core BSV)**
84
84
  ```html
85
- <script src="https://unpkg.com/@smartledger/bsv@8.3.1/bsv.min.js"></script>
86
- <script src="https://unpkg.com/@smartledger/bsv@8.3.1/bsv-ltp.min.js"></script>
87
- <script src="https://unpkg.com/@smartledger/bsv@8.3.1/bsv-gdaf.min.js"></script>
85
+ <script src="https://unpkg.com/@smartledger/bsv@9.1.0/bsv.min.js"></script>
86
+ <script src="https://unpkg.com/@smartledger/bsv@9.1.0/bsv-ltp.min.js"></script>
87
+ <script src="https://unpkg.com/@smartledger/bsv@9.1.0/bsv-gdaf.min.js"></script>
88
88
  <script>
89
89
  // Legal Token Protocol
90
90
  const propertyToken = bsv.createPropertyToken({
@@ -98,9 +98,9 @@ Everything in one file:
98
98
 
99
99
  #### **Security & Cryptography (~1.4MB total — each bundle is self-contained and re-embeds core BSV)**
100
100
  ```html
101
- <script src="https://unpkg.com/@smartledger/bsv@8.3.1/bsv.min.js"></script>
102
- <script src="https://unpkg.com/@smartledger/bsv@8.3.1/bsv-security.min.js"></script>
103
- <script src="https://unpkg.com/@smartledger/bsv@8.3.1/bsv-shamir.min.js"></script>
101
+ <script src="https://unpkg.com/@smartledger/bsv@9.1.0/bsv.min.js"></script>
102
+ <script src="https://unpkg.com/@smartledger/bsv@9.1.0/bsv-security.min.js"></script>
103
+ <script src="https://unpkg.com/@smartledger/bsv@9.1.0/bsv-shamir.min.js"></script>
104
104
  <script>
105
105
  // Threshold Cryptography
106
106
  const shares = bsv.splitSecret('my_secret_key', 5, 3);
@@ -114,18 +114,18 @@ Everything in one file:
114
114
 
115
115
  | Module | Size | Purpose | CDN Link |
116
116
  |--------|------|---------|----------|
117
- | **bsv.min.js** | 937KB | Core BSV + SmartContract | `unpkg.com/@smartledger/bsv@8.3.1/bsv.min.js` |
118
- | **bsv.bundle.js** | 937KB | Everything in one file | `unpkg.com/@smartledger/bsv@8.3.1/bsv.bundle.js` |
119
- | **bsv-smartcontract.min.js** | 937KB | Complete covenant framework | `unpkg.com/@smartledger/bsv@8.3.1/bsv-smartcontract.min.js` |
120
- | **bsv-ltp.min.js** | 1184KB | **Legal Token Protocol** | `unpkg.com/@smartledger/bsv@8.3.1/bsv-ltp.min.js` |
121
- | **bsv-gdaf.min.js** | 1184KB | **Digital Identity & Attestation** | `unpkg.com/@smartledger/bsv@8.3.1/bsv-gdaf.min.js` |
122
- | **bsv-shamir.min.js** | 432KB | **Threshold Cryptography** | `unpkg.com/@smartledger/bsv@8.3.1/bsv-shamir.min.js` |
123
- | **bsv-security.min.js** | 26KB | Security enhancements (opt-in helpers — see README › Security) | `unpkg.com/@smartledger/bsv@8.3.1/bsv-security.min.js` |
124
- | **bsv-mnemonic.min.js** | 681KB | HD wallets | `unpkg.com/@smartledger/bsv@8.3.1/bsv-mnemonic.min.js` |
125
- | **bsv-ecies.min.js** | 71KB | Encryption | `unpkg.com/@smartledger/bsv@8.3.1/bsv-ecies.min.js` |
126
- | **bsv-covenant.min.js** | 913KB | Covenant operations | `unpkg.com/@smartledger/bsv@8.3.1/bsv-covenant.min.js` |
127
- | **bsv-script-helper.min.js** | 26KB | Custom script tools | `unpkg.com/@smartledger/bsv@8.3.1/bsv-script-helper.min.js` |
128
- | **bsv-message.min.js** | 26KB | Message signing | `unpkg.com/@smartledger/bsv@8.3.1/bsv-message.min.js` |
117
+ | **bsv.min.js** | 937KB | Core BSV + SmartContract | `unpkg.com/@smartledger/bsv@9.1.0/bsv.min.js` |
118
+ | **bsv.bundle.js** | 937KB | Everything in one file | `unpkg.com/@smartledger/bsv@9.1.0/bsv.bundle.js` |
119
+ | **bsv-smartcontract.min.js** | 937KB | Complete covenant framework | `unpkg.com/@smartledger/bsv@9.1.0/bsv-smartcontract.min.js` |
120
+ | **bsv-ltp.min.js** | 1184KB | **Legal Token Protocol** | `unpkg.com/@smartledger/bsv@9.1.0/bsv-ltp.min.js` |
121
+ | **bsv-gdaf.min.js** | 1184KB | **Digital Identity & Attestation** | `unpkg.com/@smartledger/bsv@9.1.0/bsv-gdaf.min.js` |
122
+ | **bsv-shamir.min.js** | 432KB | **Threshold Cryptography** | `unpkg.com/@smartledger/bsv@9.1.0/bsv-shamir.min.js` |
123
+ | **bsv-security.min.js** | 26KB | Security enhancements (opt-in helpers — see README › Security) | `unpkg.com/@smartledger/bsv@9.1.0/bsv-security.min.js` |
124
+ | **bsv-mnemonic.min.js** | 681KB | HD wallets | `unpkg.com/@smartledger/bsv@9.1.0/bsv-mnemonic.min.js` |
125
+ | **bsv-ecies.min.js** | 71KB | Encryption | `unpkg.com/@smartledger/bsv@9.1.0/bsv-ecies.min.js` |
126
+ | **bsv-covenant.min.js** | 913KB | Covenant operations | `unpkg.com/@smartledger/bsv@9.1.0/bsv-covenant.min.js` |
127
+ | **bsv-script-helper.min.js** | 26KB | Custom script tools | `unpkg.com/@smartledger/bsv@9.1.0/bsv-script-helper.min.js` |
128
+ | **bsv-message.min.js** | 26KB | Message signing | `unpkg.com/@smartledger/bsv@9.1.0/bsv-message.min.js` |
129
129
 
130
130
  ## ⚙️ **Development Environment Setup**
131
131
 
@@ -14,10 +14,10 @@ npm install @smartledger/bsv
14
14
  ### Browser CDN (Instant)
15
15
  ```html
16
16
  <!-- Core library (937KB) -->
17
- <script src="https://unpkg.com/@smartledger/bsv@8.3.1/bsv.min.js"></script>
17
+ <script src="https://unpkg.com/@smartledger/bsv@9.1.0/bsv.min.js"></script>
18
18
 
19
19
  <!-- Everything included (937KB) -->
20
- <script src="https://unpkg.com/@smartledger/bsv@8.3.1/bsv.bundle.js"></script>
20
+ <script src="https://unpkg.com/@smartledger/bsv@9.1.0/bsv.bundle.js"></script>
21
21
  ```
22
22
 
23
23
  ## 💰 **Your First Transaction (60 seconds)**
@@ -127,19 +127,19 @@ SmartLedger-BSV offers 12 different loading options - use only what you need:
127
127
 
128
128
  ```html
129
129
  <!-- Core BSV only (937KB) -->
130
- <script src="https://unpkg.com/@smartledger/bsv@8.3.1/bsv.min.js"></script>
130
+ <script src="https://unpkg.com/@smartledger/bsv@9.1.0/bsv.min.js"></script>
131
131
 
132
132
  <!-- Smart contracts (937KB) -->
133
- <script src="https://unpkg.com/@smartledger/bsv@8.3.1/bsv-smartcontract.min.js"></script>
133
+ <script src="https://unpkg.com/@smartledger/bsv@9.1.0/bsv-smartcontract.min.js"></script>
134
134
 
135
135
  <!-- Legal tokens (1.16MB) -->
136
- <script src="https://unpkg.com/@smartledger/bsv@8.3.1/bsv-ltp.min.js"></script>
136
+ <script src="https://unpkg.com/@smartledger/bsv@9.1.0/bsv-ltp.min.js"></script>
137
137
 
138
138
  <!-- Digital identity (1.16MB) -->
139
- <script src="https://unpkg.com/@smartledger/bsv@8.3.1/bsv-gdaf.min.js"></script>
139
+ <script src="https://unpkg.com/@smartledger/bsv@9.1.0/bsv-gdaf.min.js"></script>
140
140
 
141
141
  <!-- Everything (937KB) -->
142
- <script src="https://unpkg.com/@smartledger/bsv@8.3.1/bsv.bundle.js"></script>
142
+ <script src="https://unpkg.com/@smartledger/bsv@9.1.0/bsv.bundle.js"></script>
143
143
  ```
144
144
 
145
145
  ## ⚡ **Key Advantages**
@@ -159,17 +159,17 @@ const recovered = bsv.reconstructSecret([shares[0], shares[2], shares[4]]);
159
159
  ### **New Modular Options**
160
160
  ```html
161
161
  <!-- Core compatibility (same size as bsv@1.5.6) -->
162
- <script src="https://unpkg.com/@smartledger/bsv@8.3.1/bsv.min.js"></script>
162
+ <script src="https://unpkg.com/@smartledger/bsv@9.1.0/bsv.min.js"></script>
163
163
 
164
164
  <!-- Add smart contracts when ready -->
165
- <script src="https://unpkg.com/@smartledger/bsv@8.3.1/bsv-smartcontract.min.js"></script>
165
+ <script src="https://unpkg.com/@smartledger/bsv@9.1.0/bsv-smartcontract.min.js"></script>
166
166
 
167
167
  <!-- Add advanced features as needed -->
168
- <script src="https://unpkg.com/@smartledger/bsv@8.3.1/bsv-ltp.min.js"></script>
169
- <script src="https://unpkg.com/@smartledger/bsv@8.3.1/bsv-gdaf.min.js"></script>
168
+ <script src="https://unpkg.com/@smartledger/bsv@9.1.0/bsv-ltp.min.js"></script>
169
+ <script src="https://unpkg.com/@smartledger/bsv@9.1.0/bsv-gdaf.min.js"></script>
170
170
 
171
171
  <!-- Everything in one file -->
172
- <script src="https://unpkg.com/@smartledger/bsv@8.3.1/bsv.bundle.js"></script>
172
+ <script src="https://unpkg.com/@smartledger/bsv@9.1.0/bsv.bundle.js"></script>
173
173
  ```
174
174
 
175
175
  ## 🔍 **Testing Your Migration**
@@ -0,0 +1,131 @@
1
+ # Proposal: split the package for 10.0.0
2
+
3
+ Status: draft, for discussion. Nothing here ships in 9.x.
4
+
5
+ ## The problem, measured
6
+
7
+ `@smartledger/bsv` is currently a Bitcoin library, a W3C VC-JWT toolkit, a
8
+ DID:web resolver, a legal-token protocol and an attestation framework in one
9
+ install. The cost is paid by everyone, including the majority who want one of
10
+ those things.
11
+
12
+ Requiring the root to get `Script`:
13
+
14
+ | | modules | time | heap |
15
+ |---|---|---|---|
16
+ | `require('@smartledger/bsv')` | 129 | 270ms | 12.7MB |
17
+ | `require('@smartledger/bsv/lib/script')` | 24 | 106ms | — |
18
+
19
+ Per subsystem, loaded alone:
20
+
21
+ | subsystem | modules |
22
+ |---|---|
23
+ | `lib/script` | 24 |
24
+ | `lib/transaction` | 40 |
25
+ | `lib/covenant` | 43 |
26
+ | `lib/ltp` | 48 |
27
+ | `lib/smart_contract` | 62 |
28
+ | `lib/gdaf` | 65 |
29
+
30
+ Two things make this worse than the numbers suggest:
31
+
32
+ 1. **Nothing tree-shakes.** `index.mjs` is a named-export wrapper over the CJS
33
+ build, so a bundler that sees `import { Script }` still pulls GDAF and LTP
34
+ into the browser bundle. The subpaths in `exports` are the only escape, and
35
+ they are not what the README teaches.
36
+ 2. **The npm listing has to describe all of it.** A BSV script developer
37
+ searching npm reads a description that leads with legal tokens and
38
+ credentials. The audience most likely to adopt is the one least addressed.
39
+
40
+ The subpath exports already work and already carry the fix. What is missing is
41
+ that the *default* path is the expensive one.
42
+
43
+ ## Shape
44
+
45
+ Five packages, one repository, published together.
46
+
47
+ | package | contains | approx modules |
48
+ |---|---|---|
49
+ | `@smartledger/bsv-core` | keys, addresses, script, transaction, block, SPV, crypto, encoding | ~45 |
50
+ | `@smartledger/bsv-script` | `SmartContract`, covenants, OP_PUSH_TX, PELS, ordinals, NotaryHash, script helper | ~62 |
51
+ | `@smartledger/bsv-crypto` | ECIES, Message, Mnemonic, Shamir | ~30 |
52
+ | `@smartledger/bsv-vc` | DID:web, VC-JWT, StatusList, GDAF, Anchor | ~65 |
53
+ | `@smartledger/bsv-ltp` | Legal Token Protocol | ~48 |
54
+ | `@smartledger/bsv` | **meta-package**: depends on all five, re-exports everything | unchanged |
55
+
56
+ The meta-package is the whole compatibility story. `require('@smartledger/bsv')`
57
+ keeps returning exactly what it returns today, including the ~74 flat
58
+ convenience functions (`createDID`, `prepareRightToken`, …) that currently sit
59
+ at top level. Nobody's install moves.
60
+
61
+ ## Sequencing
62
+
63
+ The split is a breaking change for anyone who deep-requires `lib/**`, and it
64
+ cannot share a release with a stability promise. It also must not become the
65
+ seventh major in a year. So:
66
+
67
+ **9.x (now → 2027-09-01)** — nothing changes. Optionally, the new packages are
68
+ published *additively* during this window: `bsv-core` and `bsv-script` go out as
69
+ real packages, `@smartledger/bsv` starts depending on them internally, and its
70
+ public surface is unchanged. Consumers who want the small thing can adopt early;
71
+ consumers who do nothing notice nothing. The API surface guard
72
+ (`test/api_surface.js`) proves the surface held.
73
+
74
+ **10.0.0 (2027-09 or later)** — the meta-package remains and keeps working. What
75
+ breaks is only:
76
+
77
+ - deep requires past the declared `exports` (already excluded by STABILITY.md)
78
+ - the three near-duplicate ~1041KB bundles, if they are dropped in the same
79
+ release
80
+
81
+ **Never** — removing the meta-package. It costs almost nothing to maintain once
82
+ the split exists, and removing it would strand every existing install for no
83
+ benefit.
84
+
85
+ ## What this fixes that subpaths alone do not
86
+
87
+ Subpath exports already let a careful consumer load 24 modules instead of 129.
88
+ Three things they cannot fix:
89
+
90
+ 1. **The default.** Most consumers write `require('@smartledger/bsv')` because
91
+ that is what the README shows. Making the small package a separate install
92
+ makes the cheap path the obvious one.
93
+ 2. **npm positioning.** A package can only have one description and one keyword
94
+ set. `bsv-script` can say "OP_PUSH_TX covenants and an interpreter-verified
95
+ script engine" without competing with credentials for the same 15 keywords.
96
+ 3. **Tree-shaking.** Separate packages can ship real ESM with `sideEffects:
97
+ false`, which the current CJS-wrapper cannot.
98
+
99
+ ## Open questions
100
+
101
+ - **Do `bsv-core` and `bsv-script` merge?** The script engine is the
102
+ differentiator and splitting it from `Transaction` may be an artificial line —
103
+ a covenant author needs both. Merging gives one ~62-module package that is
104
+ still less than half the current root. I lean toward merging.
105
+ - **Version alignment.** Lockstep versioning across all six is simplest to
106
+ reason about and wastes version numbers on packages that did not change.
107
+ Independent versioning is more honest and much harder to support. Lockstep
108
+ is probably right for a team this size.
109
+ - **The three ~1041KB bundles.** `bsv.min.js`, `bsv.bundle.js` and
110
+ `bsv-gdaf.min.js` are byte-comparable supersets. They are documented CDN
111
+ entries, so removing them breaks floating `@latest` URLs — which is why they
112
+ survive 9.x untouched. 10.0.0 is the moment to consolidate, with the old names
113
+ kept as redirects for one major if the CDN allows it.
114
+ - **Does the credential CLI move?** `bin/cli.js` is mostly credential
115
+ workflows. It probably belongs with `bsv-vc`, which means the meta-package
116
+ either loses the `smartledger-bsv` binary or keeps a thin shim.
117
+
118
+ ## What would make this a bad idea
119
+
120
+ Worth stating plainly, because the answer might be no.
121
+
122
+ Six packages is six release processes, six changelogs and a lockfile matrix, for
123
+ a maintainer count in the low single digits. If the credentials and LTP
124
+ subsystems have real users who install the root package deliberately — not
125
+ incidentally — then the current arrangement is serving them and the only genuine
126
+ problem is npm positioning, which a rewritten description already improved.
127
+
128
+ Before committing to this, the number worth having is **how many installs use
129
+ only the Bitcoin surface**. If that is most of them, split. If the install base
130
+ is genuinely using credentials alongside Bitcoin primitives, keep one package,
131
+ fix the ESM wrapper so it tree-shakes, and stop there.
package/index.js CHANGED
@@ -105,6 +105,11 @@ bsv.encoding.Varint = require('./lib/encoding/varint')
105
105
  bsv.util = {}
106
106
  bsv.util.js = require('./lib/util/js')
107
107
  bsv.util.preconditions = require('./lib/util/preconditions')
108
+ // Exposed so the deprecation notices have an off switch that does not require an
109
+ // environment variable. STABILITY.md documents BSV_NO_DEPRECATION_WARNINGS=1, which a
110
+ // browser consumer cannot set; without a programmatic control they had no way to
111
+ // silence a notice at all. `fired()` also lets tooling read what a run triggered.
112
+ bsv.util.deprecate = require('./lib/util/deprecate')
108
113
 
109
114
  // errors thrown by the library
110
115
  bsv.errors = require('./lib/errors')
@@ -172,34 +177,18 @@ try {
172
177
  // Node.js specific tools (advanced development tools)
173
178
  if (typeof window === 'undefined' && typeof require === 'function') {
174
179
  try {
175
- // bsv.SmartUTXO is a development-only file-backed UTXO simulator.
176
- // It writes to node_modules/@smartledger/bsv/utilities/blockchain-state.json,
177
- // races on shared filesystem state across processes, and only ships with
178
- // an empty seed (the 3.3 MB dev fixture is npmignored). Exposing it on
179
- // the main `bsv` namespace creates a real footgun for anyone who assumes
180
- // a production UTXO manager.
180
+ // bsv.SmartUTXO was REMOVED in 9.0.0. It is a development-only file-backed UTXO
181
+ // simulator: it writes to node_modules/@smartledger/bsv/utilities/blockchain-state.json,
182
+ // races on shared filesystem state across processes, and ships with an empty seed.
183
+ // On the main namespace it read as a production UTXO manager, which it never was.
184
+ //
185
+ // Soft-deprecated in 4.0.1 with removal promised for 6.0.0, then shipped through
186
+ // 6.x, 7.x and 8.x still warning about a removal that never came. The module itself
187
+ // is unchanged and still available by direct import:
181
188
  //
182
- // Soft-deprecated in v4.0.1: the symbol is preserved (no semver break)
183
- // but access surfaces a one-shot warning. Direct import remains:
184
189
  // require('@smartledger/bsv/lib/smartutxo')
185
- // The symbol will be removed in v6.0.0.
186
- var _SmartUTXO
187
- var _SmartUTXOWarned = false
188
- Object.defineProperty(bsv, 'SmartUTXO', {
189
- configurable: true,
190
- enumerable: true,
191
- get: function () {
192
- if (!_SmartUTXOWarned && !(process.env && process.env.BSV_HIDE_DEPRECATIONS)) {
193
- _SmartUTXOWarned = true
194
- console.warn('[bsv] bsv.SmartUTXO is a development-only simulator and is deprecated; ' +
195
- 'it will be removed in v6.0.0. Import directly: ' +
196
- "require('@smartledger/bsv/lib/smartutxo'). " +
197
- 'Set BSV_HIDE_DEPRECATIONS=1 to silence this warning.')
198
- }
199
- if (!_SmartUTXO) _SmartUTXO = require('./lib/smartutxo')
200
- return _SmartUTXO
201
- }
202
- })
190
+ //
191
+ // which is exactly what the deprecation warning told callers to do since 4.0.1.
203
192
 
204
193
  bsv.SmartMiner = require('./lib/smartminer')
205
194
  bsv.CustomScriptHelper = require('./lib/custom-script-helper')
@@ -8,6 +8,7 @@ var Hash = require('../crypto/hash')
8
8
  var Transaction = require('../transaction')
9
9
  var errors = require('../errors')
10
10
  var $ = require('../util/preconditions')
11
+ var deprecate = require('../util/deprecate')
11
12
 
12
13
  /**
13
14
  * Instantiate a MerkleBlock from a Buffer, JSON object, or Object with
@@ -148,14 +149,27 @@ MerkleBlock.prototype.validMerkleTree = function validMerkleTree () {
148
149
  }
149
150
 
150
151
  /**
151
- * WARNING: This method is deprecated. Use filteredTxsHash instead.
152
+ * @deprecated Misspelling of `filteredTxsHash` (the `e` is missing). Identical
153
+ * behaviour; this delegates.
154
+ *
155
+ * It threw rather than delegating, which made a typo fix a breaking change for
156
+ * anyone who had written the typo. Restoring it costs nothing: the name is
157
+ * unambiguous, there is exactly one thing it can mean, and no caller can be
158
+ * harmed by getting what they asked for. Contrast `HDPrivateKey#derive`, which
159
+ * keeps throwing because its replacements return DIFFERENT keys.
152
160
  *
153
- * Return a list of all the txs hash that match the filter
154
161
  * @returns {Array} - txs hash that match the filter
155
162
  */
156
- MerkleBlock.prototype.filterdTxsHash = function filterdTxsHash () {
157
- throw new Error('filterdTxsHash has been deprecated. use filteredTxsHash.')
158
- }
163
+ MerkleBlock.prototype.filterdTxsHash = deprecate.fn(
164
+ function filterdTxsHash () { return this.filteredTxsHash() },
165
+ {
166
+ what: 'MerkleBlock#filterdTxsHash',
167
+ since: '9.1.0',
168
+ removeIn: '10.0.0',
169
+ use: 'MerkleBlock#filteredTxsHash',
170
+ why: 'the name is a misspelling'
171
+ }
172
+ )
159
173
 
160
174
  /**
161
175
  * Return a list of all the txs hash that match the filter