@smartledger/bsv 9.11.1 → 9.11.2

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 CHANGED
@@ -7,6 +7,37 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [9.11.2] - 2026-09-17
11
+
12
+ **A patch: an empty push is no longer lost when a script is written as ASM or as a string.** No API change.
13
+
14
+ ### Fixed — an empty push written with OP_PUSHDATA survives being written as text
15
+
16
+ An empty push encoded with `OP_PUSHDATA1`, `OP_PUSHDATA2` or `OP_PUSHDATA4` (`4c00`, `4d0000`,
17
+ `4e00000000`) was written badly by both text forms:
18
+
19
+ | script `514c0051` | 9.11.1 | now |
20
+ | --- | --- | --- |
21
+ | `toASM()` | `OP_1 OP_1`: the push is gone, so it reads back as `5151`, one stack element fewer | `OP_1 0 OP_1`, read back as `510051` |
22
+ | `toString()` | `OP_1 OP_PUSHDATA1 OP_1`, which `fromString` cannot read | `OP_1 OP_PUSHDATA1 0 0x OP_1`, read back as `514c0051` |
23
+
24
+ ASM writes every push in its minimal form, and the minimal empty push is `OP_0`, so the ASM
25
+ now does what the script does. `toString` keeps the exact encoding.
26
+
27
+ The same fault hid the empty push built by `Script#add(Buffer.alloc(0))`, and so by
28
+ `Script.buildDataOut('')` and `buildSafeDataOut('')`. The chunk serializes to `0x00`, but both
29
+ text forms wrote nothing for it: `buildDataOut('')` is `6a00` and its `toString()` was
30
+ `OP_RETURN`, which reads back as `6a`. It is now `OP_RETURN OP_0` (ASM `OP_RETURN 0`), the text
31
+ `Script.fromHex('6a00')` already produced. Four tests had pinned the invisible form; they now
32
+ assert the text reads back as the script.
33
+
34
+ No reader changes: `fromString` already read `OP_PUSHDATA1 0 0x`. Of 4,000 generated scripts
35
+ mixing both shapes with ordinary pushes and opcodes, the 909 whose text changed all contain an
36
+ empty push, and every one of their new texts reads back exactly; every text 9.11.1 wrote is read
37
+ the same way (8,000 texts).
38
+
39
+ Reported by the scriptmin work (codenlighten/scriptmin#4).
40
+
10
41
  ## [9.11.1] - 2026-09-17
11
42
 
12
43
  **A patch: a script written as ASM or as a string reads back as the same script.** No API change.
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Bitcoin SV library with an interpreter-verified script engine.
4
4
 
5
- [![Version](https://img.shields.io/badge/version-9.11.1-blue.svg)](https://www.npmjs.com/package/@smartledger/bsv)
5
+ [![Version](https://img.shields.io/badge/version-9.11.2-blue.svg)](https://www.npmjs.com/package/@smartledger/bsv)
6
6
  [![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
7
7
  [![Stability](https://img.shields.io/badge/9.x%20stable%20until-2027--09--01-brightgreen.svg)](STABILITY.md)
8
8
 
@@ -155,44 +155,44 @@ const bsv = require('@smartledger/bsv') // 128 modules
155
155
  ### **Core Modules**
156
156
  | Module | Size | Use Case | CDN |
157
157
  |--------|------|----------|-----|
158
- | **bsv.min.js** | 1057KB | Core BSV + SmartContract | `unpkg.com/@smartledger/bsv@9.11.1/bsv.min.js` |
159
- | **bsv.bundle.js** | 1057KB | Everything in one file | `unpkg.com/@smartledger/bsv@9.11.1/bsv.bundle.js` |
158
+ | **bsv.min.js** | 1057KB | Core BSV + SmartContract | `unpkg.com/@smartledger/bsv@9.11.2/bsv.min.js` |
159
+ | **bsv.bundle.js** | 1057KB | Everything in one file | `unpkg.com/@smartledger/bsv@9.11.2/bsv.bundle.js` |
160
160
 
161
161
  ### **W3C Verifiable Credentials**
162
162
  | Module | Size | Use Case | CDN |
163
163
  |--------|------|----------|-----|
164
- | **🟢 bsv-didweb.min.js** | 166KB | **DID:web generation** | `unpkg.com/@smartledger/bsv@9.11.1/bsv-didweb.min.js` |
165
- | **🟢 bsv-vcjwt.min.js** | 166KB | **VC-JWT issue/verify** | `unpkg.com/@smartledger/bsv@9.11.1/bsv-vcjwt.min.js` |
166
- | **🟢 bsv-statuslist.min.js** | 256KB | **StatusList2021 revocation** | `unpkg.com/@smartledger/bsv@9.11.1/bsv-statuslist.min.js` |
167
- | **🟢 bsv-anchor.min.js** | 164KB | **BSV anchoring (hash-only)** | `unpkg.com/@smartledger/bsv@9.11.1/bsv-anchor.min.js` |
164
+ | **🟢 bsv-didweb.min.js** | 166KB | **DID:web generation** | `unpkg.com/@smartledger/bsv@9.11.2/bsv-didweb.min.js` |
165
+ | **🟢 bsv-vcjwt.min.js** | 166KB | **VC-JWT issue/verify** | `unpkg.com/@smartledger/bsv@9.11.2/bsv-vcjwt.min.js` |
166
+ | **🟢 bsv-statuslist.min.js** | 256KB | **StatusList2021 revocation** | `unpkg.com/@smartledger/bsv@9.11.2/bsv-statuslist.min.js` |
167
+ | **🟢 bsv-anchor.min.js** | 164KB | **BSV anchoring (hash-only)** | `unpkg.com/@smartledger/bsv@9.11.2/bsv-anchor.min.js` |
168
168
 
169
169
  ### **Smart Contract & Development**
170
170
  | Module | Size | Use Case | CDN |
171
171
  |--------|------|----------|-----|
172
- | **bsv-smartcontract.min.js** | 141KB | Complete covenant framework | `unpkg.com/@smartledger/bsv@9.11.1/bsv-smartcontract.min.js` |
173
- | **bsv-covenant.min.js** | 35KB | Covenant operations | `unpkg.com/@smartledger/bsv@9.11.1/bsv-covenant.min.js` |
174
- | **bsv-script-helper.min.js** | 33KB | Custom script tools | `unpkg.com/@smartledger/bsv@9.11.1/bsv-script-helper.min.js` |
175
- | **bsv-security.min.js** | 32KB | Security enhancements | `unpkg.com/@smartledger/bsv@9.11.1/bsv-security.min.js` |
172
+ | **bsv-smartcontract.min.js** | 141KB | Complete covenant framework | `unpkg.com/@smartledger/bsv@9.11.2/bsv-smartcontract.min.js` |
173
+ | **bsv-covenant.min.js** | 35KB | Covenant operations | `unpkg.com/@smartledger/bsv@9.11.2/bsv-covenant.min.js` |
174
+ | **bsv-script-helper.min.js** | 33KB | Custom script tools | `unpkg.com/@smartledger/bsv@9.11.2/bsv-script-helper.min.js` |
175
+ | **bsv-security.min.js** | 32KB | Security enhancements | `unpkg.com/@smartledger/bsv@9.11.2/bsv-security.min.js` |
176
176
 
177
177
  ### **Legal & Compliance**
178
178
  | Module | Size | Use Case | CDN |
179
179
  |--------|------|----------|-----|
180
- | **bsv-ltp.min.js** | 541KB | Legal Token Protocol | `unpkg.com/@smartledger/bsv@9.11.1/bsv-ltp.min.js` |
181
- | **bsv-gdaf.min.js** | 1057KB | Digital Identity & Attestation | `unpkg.com/@smartledger/bsv@9.11.1/bsv-gdaf.min.js` |
180
+ | **bsv-ltp.min.js** | 541KB | Legal Token Protocol | `unpkg.com/@smartledger/bsv@9.11.2/bsv-ltp.min.js` |
181
+ | **bsv-gdaf.min.js** | 1057KB | Digital Identity & Attestation | `unpkg.com/@smartledger/bsv@9.11.2/bsv-gdaf.min.js` |
182
182
 
183
183
  ### **Advanced Cryptography**
184
184
  | Module | Size | Use Case | CDN |
185
185
  |--------|------|----------|-----|
186
- | **bsv-shamir.min.js** | 177KB | Threshold Cryptography | `unpkg.com/@smartledger/bsv@9.11.1/bsv-shamir.min.js` |
186
+ | **bsv-shamir.min.js** | 177KB | Threshold Cryptography | `unpkg.com/@smartledger/bsv@9.11.2/bsv-shamir.min.js` |
187
187
 
188
188
  ### **Utilities**
189
189
  | Module | Size | Use Case | CDN |
190
190
  |--------|------|----------|-----|
191
- | **bsv-ecies.min.js** | 137KB | Encryption | `unpkg.com/@smartledger/bsv@9.11.1/bsv-ecies.min.js` |
192
- | **bsv-message.min.js** | 34KB | Message signing | `unpkg.com/@smartledger/bsv@9.11.1/bsv-message.min.js` |
193
- | **bsv-mnemonic.min.js** | 320KB | HD wallets | `unpkg.com/@smartledger/bsv@9.11.1/bsv-mnemonic.min.js` |
191
+ | **bsv-ecies.min.js** | 137KB | Encryption | `unpkg.com/@smartledger/bsv@9.11.2/bsv-ecies.min.js` |
192
+ | **bsv-message.min.js** | 34KB | Message signing | `unpkg.com/@smartledger/bsv@9.11.2/bsv-message.min.js` |
193
+ | **bsv-mnemonic.min.js** | 320KB | HD wallets | `unpkg.com/@smartledger/bsv@9.11.2/bsv-mnemonic.min.js` |
194
194
  ```html
195
- <script src="https://unpkg.com/@smartledger/bsv@9.11.1/bsv.min.js"></script>
195
+ <script src="https://unpkg.com/@smartledger/bsv@9.11.2/bsv.min.js"></script>
196
196
  <script>
197
197
  const key = bsv.PrivateKey.fromRandom()
198
198
  </script>
@@ -240,4 +240,4 @@ MIT
240
240
 
241
241
  ---
242
242
 
243
- **SmartLedger-BSV v9.11.1**
243
+ **SmartLedger-BSV v9.11.2**