@smartledger/bsv 9.6.0 → 9.8.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.
@@ -34,12 +34,12 @@ module sounds. That is a deliberate revision: an earlier version of this documen
34
34
  scoped Tier 1 as "the cryptographic core" and would have excluded four of the six real
35
35
  defects this codebase has produced. See §2.1.
36
36
 
37
- ### Tier 1 — 11,247 lines
37
+ ### Tier 1 — 11,384 lines
38
38
 
39
39
  | Module | Lines | Why it matters |
40
40
  | --- | ---: | --- |
41
41
  | `lib/transaction/` | 2,779 | Sighash construction and signing — both BIP-143 and the Original Transaction Digest Algorithm. |
42
- | `lib/script/interpreter.js` | 2,684 | **Scoped to the flag and era surface, not opcode execution.** Consensus-flag selection and defaults, era derivation (Genesis/Chronicle), the limits derived from them, and the semantics of the exported `verify()`. Opcode execution is excluded — see §2.2. |
42
+ | `lib/script/interpreter.js` | 2,821 | **Scoped to the flag and era surface, not opcode execution.** Consensus-flag selection and defaults, era derivation (Genesis/Chronicle), the limits derived from them, and the semantics of the exported `verify()`. Opcode execution is excluded — see §2.2. |
43
43
  | `lib/crypto/` | 2,519 | ECDSA, nonce derivation, signature encoding, the script-number type. **Scope this for an architectural judgement as well as for bugs** — see §2.3. |
44
44
  | `lib/notaryhash/` | 1,436 | BRC-220 signing and verification. Publicly reachable and relied on downstream. |
45
45
  | `lib/privatekey.js`, `lib/publickey.js` | 843 | Key construction, serialisation, WIF. Recent defects here produced a *different* key without error. |
@@ -61,8 +61,10 @@ is not.
61
61
 
62
62
  ### 2.1 Why the boundary moved
63
63
 
64
- Six defects have been found in this codebase and fixed. Four of them were in code the
65
- previous version of this scope **excluded**:
64
+ **Ten** defects have been found in this codebase and fixed. Four were in code the
65
+ previous version of this scope excluded; the four most recent all landed on the
66
+ interpreter's era and flag surface, which is why that surface is scoped and opcode
67
+ execution is not.
66
68
 
67
69
  | Defect | Module | Was it in the old scope? |
68
70
  | --- | --- | --- |
@@ -72,11 +74,24 @@ previous version of this scope **excluded**:
72
74
  | The reachable RFC 8785 canonicalizer was non-conformant while a correct one sat private; three downstream packages copied the wrong one | `lib/util/jcs.js`, `lib/ltp` | partly |
73
75
  | `ECDSA.verify()` returned the instance, so `if (verify())` was always truthy — a fail-open accepting forged signatures | `lib/crypto` | yes |
74
76
  | ECDSA nonce reuse across two signings on one instance, leaking the private key | `lib/crypto` | yes |
77
+ | `OP_BIN2NUM` capped every era at the pre-Genesis 4-byte script number, so covenants holding 21.47 BSV or more were unspendable and every `nLockTime` from 2038 was rejected | `lib/script/interpreter.js` | yes (9.4.0) |
78
+ | `policy().lockUntil()` enforced one of `CheckLockTime`'s three rules: a final `nSequence` voided the lock, and a past timestamp cleared a future height floor | `lib/smart_contract` | yes (9.4.0) |
79
+ | `SIGPUSHONLY`, `LOW_S` and `NULLFAIL` are consensus on BSV and were missing from the default flag word, so `verify()` accepted scripts the network judges invalid | `lib/script/interpreter.js` | yes (9.5.0) |
80
+ | The `CHECKMULTISIG` op count read the static cap, refusing a post-Genesis multisig the line above had just permitted | `lib/script/interpreter.js` | yes (9.6.0) |
81
+ | The stack cap was checked once at the end of the script rather than after every opcode, and was still applied after Genesis removed it | `lib/script/interpreter.js` | yes (9.7.0) |
75
82
 
76
83
  The pattern is not "the primitives are weak". It is that **code making claims about
77
84
  consensus behaviour was wrong about it**, and the tests agreed because they shared the
78
85
  same assumption. Scope has been moved onto that surface.
79
86
 
87
+ **The four most recent are the sharpest evidence in this document**, because in every
88
+ one the reference corpus passed 1,483/1,483 before the fix and 1,483/1,483 after it,
89
+ with zero false accepts either way. A node vector states its own flags, so no vector
90
+ can say which flags or which era belong in a *default*. Every `OP_BIN2NUM` vector, every
91
+ `SIGPUSHONLY` vector and every `OP_COUNT` vector in that corpus runs pre-Genesis; both
92
+ `STACK_SIZE` vectors end over the cap, which is the one case an end-of-script check does
93
+ see. The mechanism was covered in each case. The selection was not.
94
+
80
95
  ### 2.2 Why `lib/script` shrinks rather than leaves
81
96
 
82
97
  `lib/script` has the strongest external evidence in the repository: 1,483/1,483 of the
@@ -84,10 +99,13 @@ reference node's own consensus vectors, zero false accepts and zero false reject
84
99
  is evidence about **opcode execution**, and re-auditing it by hand is the least
85
100
  productive money in this engagement.
86
101
 
87
- It is not evidence about which flags a caller ends up with. Both consensus defects above
88
- were flag-selection and era-derivation failures reachable through `interpreter.js`, and
89
- no vector covers them because every vector states its own flags. So the interpreter stays
90
- in scope, scoped to that surface, and the remaining 1,175 lines of `lib/script` leave.
102
+ It is not evidence about which flags a caller ends up with. **Seven** of the ten defects
103
+ above were flag-selection or era-derivation failures reachable through `interpreter.js`,
104
+ and no vector covers them because every vector states its own flags. Five of those seven
105
+ were found *after* this boundary was drawn, which is the strongest confirmation of it
106
+ available: the surface predicted to be defect-bearing produced five more, while opcode
107
+ execution produced none. So the interpreter stays in scope, scoped to that surface, and
108
+ the remaining 1,175 lines of `lib/script` leave.
91
109
 
92
110
  ### 2.3 A specific instruction for `lib/crypto`
93
111
 
@@ -115,6 +133,14 @@ the tests were written from the same assumption. A file-by-file review finds non
115
133
  them. Checking a claim against something outside this repository finds all of them —
116
134
  which is exactly how each was eventually caught.
117
135
 
136
+ Two of the ten make the point without needing to be taken on trust. `SIGPUSHONLY` was
137
+ settled by broadcasting to mainnet a transaction that violated it and nothing else, and
138
+ reading the node's reject code: 16 `mandatory-script-verify-flag-failed`, against 64
139
+ `non-mandatory` for `MINIMALDATA` in the same run. And the `lockUntil` defect was found
140
+ by comparing the compiled script against the node's `CheckLockTime`, rule by rule,
141
+ rather than against what the library's own tests expected. Neither answer exists inside
142
+ this repository.
143
+
118
144
  ## 3. Out of scope, and why
119
145
 
120
146
  | Component | Status | Reason |
@@ -124,14 +150,14 @@ which is exactly how each was eventually caught.
124
150
  | `lib/address.js`, `lib/networks.js`, `lib/opcode.js`, `lib/hdprivatekey.js`, `lib/hdpublickey.js` (2,391 lines) | Cut to pay for §2.1 | Formatting, network constants and BIP-32 derivation. No defect has originated here, and `networks.js` in particular defines addressing constants — pubkey hashes, xpub prefixes, ports, DNS seeds — and contains **no consensus-flag logic at all**. |
125
151
  | The rest of the application layer — `lib/gdaf/`, `lib/ltp/`, `lib/ordinals/`, `lib/block/`, `lib/didweb/`, `lib/vcjwt/`, `lib/statuslist/`, most of `lib/smart_contract/`, plus assorted top-level files | Excluded | ~26,000 lines. Worth a separate engagement; including it here would blur the question in §1. Note the parts of it with a demonstrated defect history have been pulled *into* Tier 1 rather than left here — see §2.1. |
126
152
 
127
- Totals reconcile against `lib/`, which is 38,879 lines across 131 files:
153
+ Totals reconcile against `lib/`, which is 39,068 lines across 131 files:
128
154
 
129
155
  ```
130
- tier 1 11,247
156
+ tier 1 11,384
131
157
  tier 2 1,607
132
- excluded 26,025
158
+ excluded 26,077
133
159
  ------
134
- total 38,879
160
+ total 39,068
135
161
  ```
136
162
 
137
163
  Measured 2026-08-29 at `a954c27`. These figures drift as the library changes — an
@@ -202,7 +228,7 @@ seeking a quote for an independent security review.
202
228
 
203
229
  Scope, and we would like these priced separately:
204
230
 
205
- Tier 1 — 11,247 lines. Sighash construction and signing; ECDSA, nonce
231
+ Tier 1 — 11,384 lines. Sighash construction and signing; ECDSA, nonce
206
232
  derivation and signature encoding; the consensus-flag and era-derivation
207
233
  surface of the script interpreter; BRC-220 signing and verification;
208
234
  key construction and serialisation; the covenant verification harness and
@@ -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@9.6.0/bsv-shamir.min.js`
58
+ - **CDN**: `unpkg.com/@smartledger/bsv@9.8.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@9.6.0/bsv-gdaf.min.js`
64
+ - **CDN**: `unpkg.com/@smartledger/bsv@9.8.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@9.6.0/bsv-ltp.min.js`
70
+ - **CDN**: `unpkg.com/@smartledger/bsv@9.8.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@9.6.0/bsv.min.js` |
85
- | **bsv.bundle.js** | 937KB | Everything in one file | `unpkg.com/@smartledger/bsv@9.6.0/bsv.bundle.js` |
86
- | **bsv-smartcontract.min.js** | 937KB | Covenant development | `unpkg.com/@smartledger/bsv@9.6.0/bsv-smartcontract.min.js` |
87
- | **bsv-covenant.min.js** | 913KB | Covenant operations | `unpkg.com/@smartledger/bsv@9.6.0/bsv-covenant.min.js` |
88
- | **bsv-script-helper.min.js** | 26KB | Custom script tools | `unpkg.com/@smartledger/bsv@9.6.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.6.0/bsv-security.min.js` |
90
- | **bsv-ecies.min.js** | 71KB | Encryption | `unpkg.com/@smartledger/bsv@9.6.0/bsv-ecies.min.js` |
91
- | **bsv-message.min.js** | 26KB | Message signing | `unpkg.com/@smartledger/bsv@9.6.0/bsv-message.min.js` |
92
- | **bsv-mnemonic.min.js** | 681KB | HD wallets | `unpkg.com/@smartledger/bsv@9.6.0/bsv-mnemonic.min.js` |
93
- | **🆕 bsv-shamir.min.js** | 432KB | **Secret sharing** | `unpkg.com/@smartledger/bsv@9.6.0/bsv-shamir.min.js` |
94
- | **🆕 bsv-gdaf.min.js** | 1184KB | **Digital attestation** | `unpkg.com/@smartledger/bsv@9.6.0/bsv-gdaf.min.js` |
95
- | **🆕 bsv-ltp.min.js** | 1184KB | **Legal tokens** | `unpkg.com/@smartledger/bsv@9.6.0/bsv-ltp.min.js` |
84
+ | **bsv.min.js** | 937KB | Core BSV + SmartContract | `unpkg.com/@smartledger/bsv@9.8.0/bsv.min.js` |
85
+ | **bsv.bundle.js** | 937KB | Everything in one file | `unpkg.com/@smartledger/bsv@9.8.0/bsv.bundle.js` |
86
+ | **bsv-smartcontract.min.js** | 937KB | Covenant development | `unpkg.com/@smartledger/bsv@9.8.0/bsv-smartcontract.min.js` |
87
+ | **bsv-covenant.min.js** | 913KB | Covenant operations | `unpkg.com/@smartledger/bsv@9.8.0/bsv-covenant.min.js` |
88
+ | **bsv-script-helper.min.js** | 26KB | Custom script tools | `unpkg.com/@smartledger/bsv@9.8.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.8.0/bsv-security.min.js` |
90
+ | **bsv-ecies.min.js** | 71KB | Encryption | `unpkg.com/@smartledger/bsv@9.8.0/bsv-ecies.min.js` |
91
+ | **bsv-message.min.js** | 26KB | Message signing | `unpkg.com/@smartledger/bsv@9.8.0/bsv-message.min.js` |
92
+ | **bsv-mnemonic.min.js** | 681KB | HD wallets | `unpkg.com/@smartledger/bsv@9.8.0/bsv-mnemonic.min.js` |
93
+ | **🆕 bsv-shamir.min.js** | 432KB | **Secret sharing** | `unpkg.com/@smartledger/bsv@9.8.0/bsv-shamir.min.js` |
94
+ | **🆕 bsv-gdaf.min.js** | 1184KB | **Digital attestation** | `unpkg.com/@smartledger/bsv@9.8.0/bsv-gdaf.min.js` |
95
+ | **🆕 bsv-ltp.min.js** | 1184KB | **Legal tokens** | `unpkg.com/@smartledger/bsv@9.8.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@9.6.0/bsv.min.js"></script>
104
- <script src="https://unpkg.com/@smartledger/bsv@9.6.0/bsv-script-helper.min.js"></script>
103
+ <script src="https://unpkg.com/@smartledger/bsv@9.8.0/bsv.min.js"></script>
104
+ <script src="https://unpkg.com/@smartledger/bsv@9.8.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@9.6.0/bsv.min.js"></script>
110
- <script src="https://unpkg.com/@smartledger/bsv@9.6.0/bsv-covenant.min.js"></script>
111
- <script src="https://unpkg.com/@smartledger/bsv@9.6.0/bsv-smartcontract.min.js"></script>
109
+ <script src="https://unpkg.com/@smartledger/bsv@9.8.0/bsv.min.js"></script>
110
+ <script src="https://unpkg.com/@smartledger/bsv@9.8.0/bsv-covenant.min.js"></script>
111
+ <script src="https://unpkg.com/@smartledger/bsv@9.8.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@9.6.0/bsv.min.js"></script>
117
- <script src="https://unpkg.com/@smartledger/bsv@9.6.0/bsv-ltp.min.js"></script>
118
- <script src="https://unpkg.com/@smartledger/bsv@9.6.0/bsv-gdaf.min.js"></script>
116
+ <script src="https://unpkg.com/@smartledger/bsv@9.8.0/bsv.min.js"></script>
117
+ <script src="https://unpkg.com/@smartledger/bsv@9.8.0/bsv-ltp.min.js"></script>
118
+ <script src="https://unpkg.com/@smartledger/bsv@9.8.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@9.6.0/bsv.min.js"></script>
136
- <script src="https://unpkg.com/@smartledger/bsv@9.6.0/bsv-security.min.js"></script>
137
- <script src="https://unpkg.com/@smartledger/bsv@9.6.0/bsv-shamir.min.js"></script>
135
+ <script src="https://unpkg.com/@smartledger/bsv@9.8.0/bsv.min.js"></script>
136
+ <script src="https://unpkg.com/@smartledger/bsv@9.8.0/bsv-security.min.js"></script>
137
+ <script src="https://unpkg.com/@smartledger/bsv@9.8.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@9.6.0/bsv.bundle.js"></script>
149
+ <script src="https://unpkg.com/@smartledger/bsv@9.8.0/bsv.bundle.js"></script>
150
150
  <script>
151
151
  // Everything available immediately
152
152
  const shares = bsv.splitSecret('secret', 5, 3);
@@ -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@9.6.0/bsv.min.js"></script>
725
+ <script src="https://cdn.jsdelivr.net/npm/@smartledger/bsv@9.8.0/bsv.min.js"></script>
726
726
  </head>
727
727
  <body>
728
728
  <script>
@@ -15,9 +15,11 @@ seeking a quote for an independent security review of its cryptographic core.
15
15
 
16
16
  Scope, and we would like these priced separately:
17
17
 
18
- Tier 1 — 12,391 lines, 33 files. Script interpreter, sighash and signing,
19
- ECDSA and signature encoding, BIP-32 derivation, key and address
20
- construction.
18
+ Tier 1 — 11,384 lines. Sighash construction and signing; ECDSA, nonce
19
+ derivation and signature encoding; the consensus-flag and era surface of the
20
+ script interpreter; BRC-220 signing; the covenant verification harness; RFC
21
+ 8785 canonicalization; and the covenant-facing entrypoints of the smart
22
+ contract module.
21
23
 
22
24
  Tier 2 — 1,607 lines. BIP-39 mnemonics, ECIES, and the Base58Check/varint
23
25
  decoding surface.
@@ -25,18 +27,30 @@ Scope, and we would like these priced separately:
25
27
  JavaScript (CommonJS), Node >= 20.19. The code is public.
26
28
 
27
29
  Explicitly out of scope: elliptic-curve and hash primitives, which are supplied
28
- by the Noble libraries and already audited; and our 24,769-line application
29
- layer (credentials, tokens, ordinals), which we would treat as a separate
30
- engagement.
30
+ by the Noble libraries and already audited; opcode EXECUTION in the script
31
+ interpreter, which passes 1,483 of 1,483 of the reference node's own consensus
32
+ vectors with zero false accepts and zero false rejects; and the remaining
33
+ 26,077-line application layer (credentials, tokens, ordinals), which we would
34
+ treat as a separate engagement.
35
+
36
+ Note the shape of that first exclusion, because it is what we want priced. The
37
+ node's vectors each state their own flags, so they say nothing about which flags
38
+ or which consensus era a caller ends up with by DEFAULT. Every consensus defect
39
+ we have found has been in that selection rather than in the execution — the
40
+ corpus passed 1,483/1,483 before each fix and after it.
31
41
 
32
42
  Context that should shorten discovery: the core is inherited from bitcore and
33
43
  has been fixed reactively but never independently reviewed. We can provide a
34
44
  test-backed threat model, a 452-case behavioural conformance corpus that a
35
45
  second independent implementation agrees with, and a documented history of the
36
- defects we have found ourselves.
37
-
38
- The failure mode we most want examined is code that reports a check as passed
39
- without performing it — several of our own findings have had that shape.
46
+ ten defects we have found and fixed ourselves, with the module each was in.
47
+
48
+ The failure mode we most want examined is an exported security claim, its
49
+ default, and the test asserting it being wrong together, because all three were
50
+ written from the same assumption. Every one of our ten findings has had that
51
+ shape, and a file-by-file review would have found none of them. We would like
52
+ the statement of work to require checking claims against an independent oracle
53
+ or specification rather than against this repository's own tests.
40
54
 
41
55
  Could you indicate availability, an approximate cost range, and what you would
42
56
  need from us to firm that up?
@@ -15,9 +15,11 @@ seeking a quote for an independent security review of its cryptographic core.
15
15
 
16
16
  Scope, and we would like these priced separately:
17
17
 
18
- Tier 1 — 12,391 lines, 33 files. Script interpreter, sighash and signing,
19
- ECDSA and signature encoding, BIP-32 derivation, key and address
20
- construction.
18
+ Tier 1 — 11,384 lines. Sighash construction and signing; ECDSA, nonce
19
+ derivation and signature encoding; the consensus-flag and era surface of the
20
+ script interpreter; BRC-220 signing; the covenant verification harness; RFC
21
+ 8785 canonicalization; and the covenant-facing entrypoints of the smart
22
+ contract module.
21
23
 
22
24
  Tier 2 — 1,607 lines. BIP-39 mnemonics, ECIES, and the Base58Check/varint
23
25
  decoding surface.
@@ -25,18 +27,30 @@ Scope, and we would like these priced separately:
25
27
  JavaScript (CommonJS), Node >= 20.19. The code is public.
26
28
 
27
29
  Explicitly out of scope: elliptic-curve and hash primitives, which are supplied
28
- by the Noble libraries and already audited; and our 24,769-line application
29
- layer (credentials, tokens, ordinals), which we would treat as a separate
30
- engagement.
30
+ by the Noble libraries and already audited; opcode EXECUTION in the script
31
+ interpreter, which passes 1,483 of 1,483 of the reference node's own consensus
32
+ vectors with zero false accepts and zero false rejects; and the remaining
33
+ 26,077-line application layer (credentials, tokens, ordinals), which we would
34
+ treat as a separate engagement.
35
+
36
+ Note the shape of that first exclusion, because it is what we want priced. The
37
+ node's vectors each state their own flags, so they say nothing about which flags
38
+ or which consensus era a caller ends up with by DEFAULT. Every consensus defect
39
+ we have found has been in that selection rather than in the execution — the
40
+ corpus passed 1,483/1,483 before each fix and after it.
31
41
 
32
42
  Context that should shorten discovery: the core is inherited from bitcore and
33
43
  has been fixed reactively but never independently reviewed. We can provide a
34
44
  test-backed threat model, a 452-case behavioural conformance corpus that a
35
45
  second independent implementation agrees with, and a documented history of the
36
- defects we have found ourselves.
37
-
38
- The failure mode we most want examined is code that reports a check as passed
39
- without performing it — several of our own findings have had that shape.
46
+ ten defects we have found and fixed ourselves, with the module each was in.
47
+
48
+ The failure mode we most want examined is an exported security claim, its
49
+ default, and the test asserting it being wrong together, because all three were
50
+ written from the same assumption. Every one of our ten findings has had that
51
+ shape, and a file-by-file review would have found none of them. We would like
52
+ the statement of work to require checking claims against an independent oracle
53
+ or specification rather than against this repository's own tests.
40
54
 
41
55
  Could you indicate availability, an approximate cost range, and what you would
42
56
  need from us to firm that up?
@@ -15,9 +15,11 @@ seeking a quote for an independent security review of its cryptographic core.
15
15
 
16
16
  Scope, and we would like these priced separately:
17
17
 
18
- Tier 1 — 12,391 lines, 33 files. Script interpreter, sighash and signing,
19
- ECDSA and signature encoding, BIP-32 derivation, key and address
20
- construction.
18
+ Tier 1 — 11,384 lines. Sighash construction and signing; ECDSA, nonce
19
+ derivation and signature encoding; the consensus-flag and era surface of the
20
+ script interpreter; BRC-220 signing; the covenant verification harness; RFC
21
+ 8785 canonicalization; and the covenant-facing entrypoints of the smart
22
+ contract module.
21
23
 
22
24
  Tier 2 — 1,607 lines. BIP-39 mnemonics, ECIES, and the Base58Check/varint
23
25
  decoding surface.
@@ -25,18 +27,30 @@ Scope, and we would like these priced separately:
25
27
  JavaScript (CommonJS), Node >= 20.19. The code is public.
26
28
 
27
29
  Explicitly out of scope: elliptic-curve and hash primitives, which are supplied
28
- by the Noble libraries and already audited; and our 24,769-line application
29
- layer (credentials, tokens, ordinals), which we would treat as a separate
30
- engagement.
30
+ by the Noble libraries and already audited; opcode EXECUTION in the script
31
+ interpreter, which passes 1,483 of 1,483 of the reference node's own consensus
32
+ vectors with zero false accepts and zero false rejects; and the remaining
33
+ 26,077-line application layer (credentials, tokens, ordinals), which we would
34
+ treat as a separate engagement.
35
+
36
+ Note the shape of that first exclusion, because it is what we want priced. The
37
+ node's vectors each state their own flags, so they say nothing about which flags
38
+ or which consensus era a caller ends up with by DEFAULT. Every consensus defect
39
+ we have found has been in that selection rather than in the execution — the
40
+ corpus passed 1,483/1,483 before each fix and after it.
31
41
 
32
42
  Context that should shorten discovery: the core is inherited from bitcore and
33
43
  has been fixed reactively but never independently reviewed. We can provide a
34
44
  test-backed threat model, a 452-case behavioural conformance corpus that a
35
45
  second independent implementation agrees with, and a documented history of the
36
- defects we have found ourselves.
37
-
38
- The failure mode we most want examined is code that reports a check as passed
39
- without performing it — several of our own findings have had that shape.
46
+ ten defects we have found and fixed ourselves, with the module each was in.
47
+
48
+ The failure mode we most want examined is an exported security claim, its
49
+ default, and the test asserting it being wrong together, because all three were
50
+ written from the same assumption. Every one of our ten findings has had that
51
+ shape, and a file-by-file review would have found none of them. We would like
52
+ the statement of work to require checking claims against an independent oracle
53
+ or specification rather than against this repository's own tests.
40
54
 
41
55
  Could you indicate availability, an approximate cost range, and what you would
42
56
  need from us to firm that up?
@@ -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@9.6.0/bsv.min.js"></script>
51
+ <script src="https://unpkg.com/@smartledger/bsv@9.8.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@9.6.0/bsv.bundle.js"></script>
61
+ <script src="https://unpkg.com/@smartledger/bsv@9.8.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@9.6.0/bsv.min.js"></script>
75
- <script src="https://unpkg.com/@smartledger/bsv@9.6.0/bsv-covenant.min.js"></script>
76
- <script src="https://unpkg.com/@smartledger/bsv@9.6.0/bsv-smartcontract.min.js"></script>
74
+ <script src="https://unpkg.com/@smartledger/bsv@9.8.0/bsv.min.js"></script>
75
+ <script src="https://unpkg.com/@smartledger/bsv@9.8.0/bsv-covenant.min.js"></script>
76
+ <script src="https://unpkg.com/@smartledger/bsv@9.8.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@9.6.0/bsv.min.js"></script>
86
- <script src="https://unpkg.com/@smartledger/bsv@9.6.0/bsv-ltp.min.js"></script>
87
- <script src="https://unpkg.com/@smartledger/bsv@9.6.0/bsv-gdaf.min.js"></script>
85
+ <script src="https://unpkg.com/@smartledger/bsv@9.8.0/bsv.min.js"></script>
86
+ <script src="https://unpkg.com/@smartledger/bsv@9.8.0/bsv-ltp.min.js"></script>
87
+ <script src="https://unpkg.com/@smartledger/bsv@9.8.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@9.6.0/bsv.min.js"></script>
102
- <script src="https://unpkg.com/@smartledger/bsv@9.6.0/bsv-security.min.js"></script>
103
- <script src="https://unpkg.com/@smartledger/bsv@9.6.0/bsv-shamir.min.js"></script>
101
+ <script src="https://unpkg.com/@smartledger/bsv@9.8.0/bsv.min.js"></script>
102
+ <script src="https://unpkg.com/@smartledger/bsv@9.8.0/bsv-security.min.js"></script>
103
+ <script src="https://unpkg.com/@smartledger/bsv@9.8.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@9.6.0/bsv.min.js` |
118
- | **bsv.bundle.js** | 937KB | Everything in one file | `unpkg.com/@smartledger/bsv@9.6.0/bsv.bundle.js` |
119
- | **bsv-smartcontract.min.js** | 937KB | Complete covenant framework | `unpkg.com/@smartledger/bsv@9.6.0/bsv-smartcontract.min.js` |
120
- | **bsv-ltp.min.js** | 1184KB | **Legal Token Protocol** | `unpkg.com/@smartledger/bsv@9.6.0/bsv-ltp.min.js` |
121
- | **bsv-gdaf.min.js** | 1184KB | **Digital Identity & Attestation** | `unpkg.com/@smartledger/bsv@9.6.0/bsv-gdaf.min.js` |
122
- | **bsv-shamir.min.js** | 432KB | **Threshold Cryptography** | `unpkg.com/@smartledger/bsv@9.6.0/bsv-shamir.min.js` |
123
- | **bsv-security.min.js** | 26KB | Security enhancements (opt-in helpers — see README › Security) | `unpkg.com/@smartledger/bsv@9.6.0/bsv-security.min.js` |
124
- | **bsv-mnemonic.min.js** | 681KB | HD wallets | `unpkg.com/@smartledger/bsv@9.6.0/bsv-mnemonic.min.js` |
125
- | **bsv-ecies.min.js** | 71KB | Encryption | `unpkg.com/@smartledger/bsv@9.6.0/bsv-ecies.min.js` |
126
- | **bsv-covenant.min.js** | 913KB | Covenant operations | `unpkg.com/@smartledger/bsv@9.6.0/bsv-covenant.min.js` |
127
- | **bsv-script-helper.min.js** | 26KB | Custom script tools | `unpkg.com/@smartledger/bsv@9.6.0/bsv-script-helper.min.js` |
128
- | **bsv-message.min.js** | 26KB | Message signing | `unpkg.com/@smartledger/bsv@9.6.0/bsv-message.min.js` |
117
+ | **bsv.min.js** | 937KB | Core BSV + SmartContract | `unpkg.com/@smartledger/bsv@9.8.0/bsv.min.js` |
118
+ | **bsv.bundle.js** | 937KB | Everything in one file | `unpkg.com/@smartledger/bsv@9.8.0/bsv.bundle.js` |
119
+ | **bsv-smartcontract.min.js** | 937KB | Complete covenant framework | `unpkg.com/@smartledger/bsv@9.8.0/bsv-smartcontract.min.js` |
120
+ | **bsv-ltp.min.js** | 1184KB | **Legal Token Protocol** | `unpkg.com/@smartledger/bsv@9.8.0/bsv-ltp.min.js` |
121
+ | **bsv-gdaf.min.js** | 1184KB | **Digital Identity & Attestation** | `unpkg.com/@smartledger/bsv@9.8.0/bsv-gdaf.min.js` |
122
+ | **bsv-shamir.min.js** | 432KB | **Threshold Cryptography** | `unpkg.com/@smartledger/bsv@9.8.0/bsv-shamir.min.js` |
123
+ | **bsv-security.min.js** | 26KB | Security enhancements (opt-in helpers — see README › Security) | `unpkg.com/@smartledger/bsv@9.8.0/bsv-security.min.js` |
124
+ | **bsv-mnemonic.min.js** | 681KB | HD wallets | `unpkg.com/@smartledger/bsv@9.8.0/bsv-mnemonic.min.js` |
125
+ | **bsv-ecies.min.js** | 71KB | Encryption | `unpkg.com/@smartledger/bsv@9.8.0/bsv-ecies.min.js` |
126
+ | **bsv-covenant.min.js** | 913KB | Covenant operations | `unpkg.com/@smartledger/bsv@9.8.0/bsv-covenant.min.js` |
127
+ | **bsv-script-helper.min.js** | 26KB | Custom script tools | `unpkg.com/@smartledger/bsv@9.8.0/bsv-script-helper.min.js` |
128
+ | **bsv-message.min.js** | 26KB | Message signing | `unpkg.com/@smartledger/bsv@9.8.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@9.6.0/bsv.min.js"></script>
17
+ <script src="https://unpkg.com/@smartledger/bsv@9.8.0/bsv.min.js"></script>
18
18
 
19
19
  <!-- Everything included (937KB) -->
20
- <script src="https://unpkg.com/@smartledger/bsv@9.6.0/bsv.bundle.js"></script>
20
+ <script src="https://unpkg.com/@smartledger/bsv@9.8.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@9.6.0/bsv.min.js"></script>
130
+ <script src="https://unpkg.com/@smartledger/bsv@9.8.0/bsv.min.js"></script>
131
131
 
132
132
  <!-- Smart contracts (937KB) -->
133
- <script src="https://unpkg.com/@smartledger/bsv@9.6.0/bsv-smartcontract.min.js"></script>
133
+ <script src="https://unpkg.com/@smartledger/bsv@9.8.0/bsv-smartcontract.min.js"></script>
134
134
 
135
135
  <!-- Legal tokens (1.16MB) -->
136
- <script src="https://unpkg.com/@smartledger/bsv@9.6.0/bsv-ltp.min.js"></script>
136
+ <script src="https://unpkg.com/@smartledger/bsv@9.8.0/bsv-ltp.min.js"></script>
137
137
 
138
138
  <!-- Digital identity (1.16MB) -->
139
- <script src="https://unpkg.com/@smartledger/bsv@9.6.0/bsv-gdaf.min.js"></script>
139
+ <script src="https://unpkg.com/@smartledger/bsv@9.8.0/bsv-gdaf.min.js"></script>
140
140
 
141
141
  <!-- Everything (937KB) -->
142
- <script src="https://unpkg.com/@smartledger/bsv@9.6.0/bsv.bundle.js"></script>
142
+ <script src="https://unpkg.com/@smartledger/bsv@9.8.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@9.6.0/bsv.min.js"></script>
162
+ <script src="https://unpkg.com/@smartledger/bsv@9.8.0/bsv.min.js"></script>
163
163
 
164
164
  <!-- Add smart contracts when ready -->
165
- <script src="https://unpkg.com/@smartledger/bsv@9.6.0/bsv-smartcontract.min.js"></script>
165
+ <script src="https://unpkg.com/@smartledger/bsv@9.8.0/bsv-smartcontract.min.js"></script>
166
166
 
167
167
  <!-- Add advanced features as needed -->
168
- <script src="https://unpkg.com/@smartledger/bsv@9.6.0/bsv-ltp.min.js"></script>
169
- <script src="https://unpkg.com/@smartledger/bsv@9.6.0/bsv-gdaf.min.js"></script>
168
+ <script src="https://unpkg.com/@smartledger/bsv@9.8.0/bsv-ltp.min.js"></script>
169
+ <script src="https://unpkg.com/@smartledger/bsv@9.8.0/bsv-gdaf.min.js"></script>
170
170
 
171
171
  <!-- Everything in one file -->
172
- <script src="https://unpkg.com/@smartledger/bsv@9.6.0/bsv.bundle.js"></script>
172
+ <script src="https://unpkg.com/@smartledger/bsv@9.8.0/bsv.bundle.js"></script>
173
173
  ```
174
174
 
175
175
  ## 🔍 **Testing Your Migration**