@smartledger/bsv 9.14.0 → 9.15.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 +97 -0
- package/README.md +19 -19
- package/bsv-gdaf.min.js +29 -29
- package/bsv-ltp.min.js +22 -22
- package/bsv-smartcontract.min.js +1 -1
- package/bsv.bundle.js +29 -29
- package/bsv.d.ts +7 -0
- package/bsv.min.js +29 -29
- package/docs/AUDIT_SCOPE.md +6 -6
- package/docs/MODULE_REFERENCE_COMPLETE.md +27 -27
- package/docs/advanced/UTXO_MANAGER_GUIDE.md +1 -1
- package/docs/audit-rfq/cure53.txt +1 -1
- package/docs/audit-rfq/ncc-group.txt +1 -1
- package/docs/audit-rfq/trail-of-bits.txt +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/lib/script/interpreter.js +93 -24
- package/package.json +1 -1
- package/tools/sv-vector-harness.js +11 -0
- package/version.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,103 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [9.15.0] - 2026-09-29
|
|
11
|
+
|
|
12
|
+
### Security — `LOW_S` masked every STRICTENC signature check, on this library's own default flags
|
|
13
|
+
|
|
14
|
+
`checkSignatureEncoding` chained its three checks with `else if`. The node has three
|
|
15
|
+
independent `if`s. `SCRIPT_VERIFY_LOW_S` is set by both `mainnetFlags()` and
|
|
16
|
+
`currentConsensusFlags()`, so on the default path the LOW_S branch returned and the whole
|
|
17
|
+
STRICTENC block below it never ran. Three signatures the node refuses by name were accepted:
|
|
18
|
+
|
|
19
|
+
| signature | node | this library, before 9.15.0 |
|
|
20
|
+
|---|---|---|
|
|
21
|
+
| undefined hash type | `SIG_HASHTYPE` | **accepted** |
|
|
22
|
+
| no FORKID bit, where FORKID is required | `MUST_USE_FORKID` | **accepted** |
|
|
23
|
+
| Chronicle digest requested outside Chronicle | `ILLEGAL_CHRONICLE` | **accepted** |
|
|
24
|
+
|
|
25
|
+
This is the direction that costs money: a transaction the network rejects was reported valid.
|
|
26
|
+
The third case undoes the guard added for Chronicle — a signature whose type byte sets `0x20`
|
|
27
|
+
is read as asking for the original digest, and refusing it outright is what lets
|
|
28
|
+
`sighash()` route on the bit alone. Anyone verifying third-party transactions with
|
|
29
|
+
`mainnetFlags()` should treat 9.15.0 as a required upgrade.
|
|
30
|
+
|
|
31
|
+
The bug is inherited from the upstream `bsv`/`bitcore-lib` lineage, not introduced here, and
|
|
32
|
+
the node's own 1,483-row corpus cannot see it: not one row pairs `LOW_S` with a hash-type
|
|
33
|
+
expectation. It was found by transcribing `VerifyScript` against the C++ line by line rather
|
|
34
|
+
than reading the one line under repair.
|
|
35
|
+
|
|
36
|
+
### Fixed — Chronicle's malleability relaxations were not applied
|
|
37
|
+
|
|
38
|
+
Chronicle lets a transaction opt into malleability by using a **version above 1**. The node
|
|
39
|
+
then stops applying the rules that exist only to stop a signed transaction being rewritten in
|
|
40
|
+
flight — `EnforceNonMalleability(flags, checker.Version())`, at seven sites
|
|
41
|
+
(`interpreter.cpp` 285, 433, 801, 1493, 1643, 1666 and 2441). This library
|
|
42
|
+
applied all seven regardless, so it **refused transactions the network accepts**, on its own
|
|
43
|
+
default flags, for any transaction with `version > 1`:
|
|
44
|
+
|
|
45
|
+
`LOW_S`, `MINIMALDATA`, `MINIMALIF`, `NULLFAIL` (both `CHECKSIG` and `CHECKMULTISIG`),
|
|
46
|
+
`NULLDUMMY`, `SIGPUSHONLY` and `CLEANSTACK`.
|
|
47
|
+
|
|
48
|
+
The gate reads `SCRIPT_CHRONICLE` — the era of the block being built — not
|
|
49
|
+
`SCRIPT_UTXO_AFTER_CHRONICLE`, the era of the output being spent; Chronicle activated at block
|
|
50
|
+
943,816, so it is set for anything validated against today's chain. Every version at or below 1
|
|
51
|
+
is unaffected, and so is every flag set without Chronicle. Exposed as
|
|
52
|
+
`Interpreter#enforceNonMalleability()`, beside `isAfterGenesis()` and `isAfterChronicle()`.
|
|
53
|
+
|
|
54
|
+
The corpus cannot see this either: all 1,483 of its rows carry transaction version 1.
|
|
55
|
+
|
|
56
|
+
### Fixed — `SIGPUSHONLY` is a rule of an era, not of the flag alone
|
|
57
|
+
|
|
58
|
+
The node applies it post-Genesis, and under Chronicle only to a non-malleable version:
|
|
59
|
+
|
|
60
|
+
```cpp
|
|
61
|
+
if((IsGenesis(flags) && !IsChronicle(flags)) ||
|
|
62
|
+
(IsChronicle(flags) && !IsMalleableTxnVersion(checker.Version())))
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
It also never *sets* the flag outside that window — `InputScriptVerifyFlags` adds it only once
|
|
66
|
+
the block era is post-Genesis. Before Genesis a non-push scriptSig was refused only where P2SH
|
|
67
|
+
demanded it, which this library still does.
|
|
68
|
+
|
|
69
|
+
### Fixed — `CLEANSTACK` required `P2SH` only before Genesis, and the harness was short a rule
|
|
70
|
+
|
|
71
|
+
The node requires the `P2SH` flag alongside `CLEANSTACK` in **every** era, including after
|
|
72
|
+
Genesis removed P2SH. This library carried a post-Genesis carve-out of its own, because the
|
|
73
|
+
corpus appeared to demand one. It does not — the node's harness adds the flag before calling
|
|
74
|
+
`VerifyScript`:
|
|
75
|
+
|
|
76
|
+
```cpp
|
|
77
|
+
if(flags & SCRIPT_VERIFY_CLEANSTACK) flags |= SCRIPT_VERIFY_P2SH; // DoTest
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
so the row naming `CLEANSTACK` alone never reaches that branch. `tools/sv-vector-harness.js`
|
|
81
|
+
was missing the adjustment, which ran that row under a flag set `VerifyScript` refuses
|
|
82
|
+
outright: it failed for the wrong reason and stopped testing clean stacks at all. A vector
|
|
83
|
+
file states the flags a row names, not the ones its runner adds.
|
|
84
|
+
|
|
85
|
+
### Changed — the one behaviour that tightens
|
|
86
|
+
|
|
87
|
+
Everything else here either refuses something the network refuses or accepts something it
|
|
88
|
+
accepts. This is the exception, stated plainly so nobody meets it by surprise: a flag word
|
|
89
|
+
carrying `CLEANSTACK` **without** `P2SH` used to verify after Genesis, and now returns false
|
|
90
|
+
with `SCRIPT_ERR_INVALID_FLAGS`, which is what the node does in every era.
|
|
91
|
+
|
|
92
|
+
It is not reachable through any flag set this library produces — `mainnetFlags()` and
|
|
93
|
+
`currentConsensusFlags()` both include `P2SH` — so only a hand-assembled flag word is
|
|
94
|
+
affected, and the fix is to add `SCRIPT_VERIFY_P2SH`, which is what the node's own test
|
|
95
|
+
harness does. It ships in a minor rather than waiting for the major because the alternative
|
|
96
|
+
is disagreeing with the node about which flag sets are valid; STABILITY.md § Consensus
|
|
97
|
+
tracking is the clause that allows it.
|
|
98
|
+
|
|
99
|
+
### Fixed — `CLEANSTACK` without `P2SH` threw an internal error
|
|
100
|
+
|
|
101
|
+
Those flags come from a caller, so the node names the problem
|
|
102
|
+
(`SCRIPT_ERR_INVALID_FLAGS`) rather than asserting. Throwing turned a verdict into a crash for
|
|
103
|
+
anyone verifying with `CLEANSTACK` alone. A flag set claiming a post-Chronicle UTXO that is not
|
|
104
|
+
post-Genesis is now refused the same way, as the node's `valid_flags` does, instead of being
|
|
105
|
+
evaluated from half an era.
|
|
106
|
+
|
|
10
107
|
## [9.14.0] - 2026-09-29
|
|
11
108
|
|
|
12
109
|
### Added — `minDifficulty`, because a work floor in hashes invites a unit error that fails open
|
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Bitcoin SV library with an interpreter-verified script engine.
|
|
4
4
|
|
|
5
|
-
[](https://www.npmjs.com/package/@smartledger/bsv)
|
|
6
6
|
[](LICENSE)
|
|
7
7
|
[](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** | 1062KB | Core BSV + SmartContract | `unpkg.com/@smartledger/bsv@9.
|
|
159
|
-
| **bsv.bundle.js** | 1062KB | Everything in one file | `unpkg.com/@smartledger/bsv@9.
|
|
158
|
+
| **bsv.min.js** | 1062KB | Core BSV + SmartContract | `unpkg.com/@smartledger/bsv@9.15.0/bsv.min.js` |
|
|
159
|
+
| **bsv.bundle.js** | 1062KB | Everything in one file | `unpkg.com/@smartledger/bsv@9.15.0/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.
|
|
165
|
-
| **🟢 bsv-vcjwt.min.js** | 166KB | **VC-JWT issue/verify** | `unpkg.com/@smartledger/bsv@9.
|
|
166
|
-
| **🟢 bsv-statuslist.min.js** | 256KB | **StatusList2021 revocation** | `unpkg.com/@smartledger/bsv@9.
|
|
167
|
-
| **🟢 bsv-anchor.min.js** | 164KB | **BSV anchoring (hash-only)** | `unpkg.com/@smartledger/bsv@9.
|
|
164
|
+
| **🟢 bsv-didweb.min.js** | 166KB | **DID:web generation** | `unpkg.com/@smartledger/bsv@9.15.0/bsv-didweb.min.js` |
|
|
165
|
+
| **🟢 bsv-vcjwt.min.js** | 166KB | **VC-JWT issue/verify** | `unpkg.com/@smartledger/bsv@9.15.0/bsv-vcjwt.min.js` |
|
|
166
|
+
| **🟢 bsv-statuslist.min.js** | 256KB | **StatusList2021 revocation** | `unpkg.com/@smartledger/bsv@9.15.0/bsv-statuslist.min.js` |
|
|
167
|
+
| **🟢 bsv-anchor.min.js** | 164KB | **BSV anchoring (hash-only)** | `unpkg.com/@smartledger/bsv@9.15.0/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.
|
|
173
|
-
| **bsv-covenant.min.js** | 35KB | Covenant operations | `unpkg.com/@smartledger/bsv@9.
|
|
174
|
-
| **bsv-script-helper.min.js** | 33KB | Custom script tools | `unpkg.com/@smartledger/bsv@9.
|
|
175
|
-
| **bsv-security.min.js** | 32KB | Security enhancements | `unpkg.com/@smartledger/bsv@9.
|
|
172
|
+
| **bsv-smartcontract.min.js** | 141KB | Complete covenant framework | `unpkg.com/@smartledger/bsv@9.15.0/bsv-smartcontract.min.js` |
|
|
173
|
+
| **bsv-covenant.min.js** | 35KB | Covenant operations | `unpkg.com/@smartledger/bsv@9.15.0/bsv-covenant.min.js` |
|
|
174
|
+
| **bsv-script-helper.min.js** | 33KB | Custom script tools | `unpkg.com/@smartledger/bsv@9.15.0/bsv-script-helper.min.js` |
|
|
175
|
+
| **bsv-security.min.js** | 32KB | Security enhancements | `unpkg.com/@smartledger/bsv@9.15.0/bsv-security.min.js` |
|
|
176
176
|
|
|
177
177
|
### **Legal & Compliance**
|
|
178
178
|
| Module | Size | Use Case | CDN |
|
|
179
179
|
|--------|------|----------|-----|
|
|
180
|
-
| **bsv-ltp.min.js** |
|
|
181
|
-
| **bsv-gdaf.min.js** | 1062KB | Digital Identity & Attestation | `unpkg.com/@smartledger/bsv@9.
|
|
180
|
+
| **bsv-ltp.min.js** | 542KB | Legal Token Protocol | `unpkg.com/@smartledger/bsv@9.15.0/bsv-ltp.min.js` |
|
|
181
|
+
| **bsv-gdaf.min.js** | 1062KB | Digital Identity & Attestation | `unpkg.com/@smartledger/bsv@9.15.0/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.
|
|
186
|
+
| **bsv-shamir.min.js** | 177KB | Threshold Cryptography | `unpkg.com/@smartledger/bsv@9.15.0/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.
|
|
192
|
-
| **bsv-message.min.js** | 34KB | Message signing | `unpkg.com/@smartledger/bsv@9.
|
|
193
|
-
| **bsv-mnemonic.min.js** | 320KB | HD wallets | `unpkg.com/@smartledger/bsv@9.
|
|
191
|
+
| **bsv-ecies.min.js** | 137KB | Encryption | `unpkg.com/@smartledger/bsv@9.15.0/bsv-ecies.min.js` |
|
|
192
|
+
| **bsv-message.min.js** | 34KB | Message signing | `unpkg.com/@smartledger/bsv@9.15.0/bsv-message.min.js` |
|
|
193
|
+
| **bsv-mnemonic.min.js** | 320KB | HD wallets | `unpkg.com/@smartledger/bsv@9.15.0/bsv-mnemonic.min.js` |
|
|
194
194
|
```html
|
|
195
|
-
<script src="https://unpkg.com/@smartledger/bsv@9.
|
|
195
|
+
<script src="https://unpkg.com/@smartledger/bsv@9.15.0/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.
|
|
243
|
+
**SmartLedger-BSV v9.15.0**
|