@smartledger/bsv 9.2.0 → 9.3.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.
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Covenant construction.
3
+ *
4
+ * The default export is `SmartContract.Covenant`; `reconstructP2pkhScript` is
5
+ * exported alongside it at runtime.
6
+ */
7
+ import { SmartContract, Script, PublicKey } from '@smartledger/bsv';
8
+
9
+ declare const covenant: typeof SmartContract.Covenant & {
10
+ /**
11
+ * Rebuild the P2PKH locking script a covenant spends from, for preimage
12
+ * construction.
13
+ */
14
+ reconstructP2pkhScript(publicKey: PublicKey | Buffer | string): Script;
15
+ };
16
+
17
+ export = covenant;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * did:web issuer keys and DID documents.
3
+ *
4
+ * Same surface as `require("@smartledger/bsv").DIDWeb`.
5
+ */
6
+ import { DIDWeb } from '@smartledger/bsv';
7
+ export = DIDWeb;
@@ -29,14 +29,14 @@ testing.
29
29
  Two tiers, to be **priced separately** so the boundary can be drawn against a number
30
30
  rather than before seeing one.
31
31
 
32
- ### Tier 1 — core, 12,268 lines across 33 files
32
+ ### Tier 1 — core, 12,391 lines across 33 files
33
33
 
34
34
  | Module | Lines | Why it matters |
35
35
  | --- | ---: | --- |
36
- | `lib/script/` | 3,751 | Consensus script interpreter. Divergence from the node means accepting a transaction the network rejects, or the reverse. |
36
+ | `lib/script/` | 3,859 | Consensus script interpreter. Divergence from the node means accepting a transaction the network rejects, or the reverse. |
37
37
  | `lib/transaction/` | 2,779 | Sighash construction and signing — both BIP-143 and the Original Transaction Digest Algorithm. |
38
38
  | `lib/crypto/` | 2,519 | ECDSA, nonce derivation, signature encoding, the script-number type. |
39
- | `lib/hdprivatekey.js`, `lib/hdpublickey.js` | 1,168 | BIP-32 derivation, including hardened paths. |
39
+ | `lib/hdprivatekey.js`, `lib/hdpublickey.js` | 1,183 | BIP-32 derivation, including hardened paths. |
40
40
  | `lib/privatekey.js`, `lib/publickey.js` | 843 | Key construction, serialisation, WIF. Recent defects here produced a *different* key without error. |
41
41
  | `lib/address.js` | 543 | Address derivation and network binding. |
42
42
  | `lib/networks.js`, `lib/opcode.js` | 665 | Network parameters and the opcode table, which BSV upgrades have reassigned. |
@@ -58,19 +58,25 @@ is not.
58
58
  | Component | Status | Reason |
59
59
  | --- | --- | --- |
60
60
  | `@noble/curves`, `@noble/hashes`, `@noble/ciphers` | Already audited | The primitives come from the Noble libraries, which **Cure53 has audited and published on**. We do not implement curve or hash arithmetic ourselves. State this explicitly to vendors — otherwise they price work we do not need. |
61
- | `lib/smart_contract/`, `lib/ltp/`, `lib/gdaf/`, `lib/ordinals/`, `lib/block/`, plus 9 further directories and 6 top-level files | Excluded | Application layer, 24,447 lines — 18,600 in the five named modules and 5,847 in the remainder. Written in-house and covered by adversarial tests. Worth a separate engagement; including it here would blur the question in §1. |
61
+ | `lib/smart_contract/`, `lib/ltp/`, `lib/gdaf/`, `lib/ordinals/`, `lib/block/`, plus 9 further directories and 6 top-level files | Excluded | Application layer, 24,769 lines — 18,706 in the five named modules and 6,063 in the remainder. Written in-house and covered by adversarial tests. Worth a separate engagement; including it here would blur the question in §1. |
62
62
 
63
- Totals reconcile against `lib/`, which is 38,322 lines across 130 files:
63
+ Totals reconcile against `lib/`, which is 38,767 lines across 131 files:
64
64
 
65
65
  ```
66
- tier 1 12,268
66
+ tier 1 12,391
67
67
  tier 2 1,607
68
- excluded 24,447
68
+ excluded 24,769
69
69
  ------
70
- total 38,322
70
+ total 38,767
71
71
  ```
72
72
 
73
- Core + optional = 13,875.
73
+ Measured 2026-08-28 at `aa551a1`. These figures drift as the library changes — the
74
+ previous set was taken on 2026-08-16 and was 445 lines light by the time it was
75
+ read, most of it in `lib/script/interpreter.js`, which is tier 1 and therefore the
76
+ number a vendor prices against. **Re-run §7 immediately before sending**, and update
77
+ the date above with the commit measured.
78
+
79
+ Core + optional = 13,998.
74
80
 
75
81
  ## 4. What an auditor gets on day one
76
82
 
@@ -133,7 +139,7 @@ seeking a quote for an independent security review of its cryptographic core.
133
139
 
134
140
  Scope, and we would like these priced separately:
135
141
 
136
- Tier 1 — 12,268 lines, 33 files. Script interpreter, sighash and signing,
142
+ Tier 1 — 12,391 lines, 33 files. Script interpreter, sighash and signing,
137
143
  ECDSA and signature encoding, BIP-32 derivation, key and address
138
144
  construction.
139
145
 
@@ -143,7 +149,7 @@ Scope, and we would like these priced separately:
143
149
  JavaScript (CommonJS), Node >= 20.19. The code is public.
144
150
 
145
151
  Explicitly out of scope: elliptic-curve and hash primitives, which are supplied
146
- by the Noble libraries and already audited; and our 24,447-line application
152
+ by the Noble libraries and already audited; and our 24,769-line application
147
153
  layer (credentials, tokens, ordinals), which we would treat as a separate
148
154
  engagement.
149
155
 
@@ -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.2.0/bsv-shamir.min.js`
58
+ - **CDN**: `unpkg.com/@smartledger/bsv@9.3.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.2.0/bsv-gdaf.min.js`
64
+ - **CDN**: `unpkg.com/@smartledger/bsv@9.3.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.2.0/bsv-ltp.min.js`
70
+ - **CDN**: `unpkg.com/@smartledger/bsv@9.3.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.2.0/bsv.min.js` |
85
- | **bsv.bundle.js** | 937KB | Everything in one file | `unpkg.com/@smartledger/bsv@9.2.0/bsv.bundle.js` |
86
- | **bsv-smartcontract.min.js** | 937KB | Covenant development | `unpkg.com/@smartledger/bsv@9.2.0/bsv-smartcontract.min.js` |
87
- | **bsv-covenant.min.js** | 913KB | Covenant operations | `unpkg.com/@smartledger/bsv@9.2.0/bsv-covenant.min.js` |
88
- | **bsv-script-helper.min.js** | 26KB | Custom script tools | `unpkg.com/@smartledger/bsv@9.2.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.2.0/bsv-security.min.js` |
90
- | **bsv-ecies.min.js** | 71KB | Encryption | `unpkg.com/@smartledger/bsv@9.2.0/bsv-ecies.min.js` |
91
- | **bsv-message.min.js** | 26KB | Message signing | `unpkg.com/@smartledger/bsv@9.2.0/bsv-message.min.js` |
92
- | **bsv-mnemonic.min.js** | 681KB | HD wallets | `unpkg.com/@smartledger/bsv@9.2.0/bsv-mnemonic.min.js` |
93
- | **🆕 bsv-shamir.min.js** | 432KB | **Secret sharing** | `unpkg.com/@smartledger/bsv@9.2.0/bsv-shamir.min.js` |
94
- | **🆕 bsv-gdaf.min.js** | 1184KB | **Digital attestation** | `unpkg.com/@smartledger/bsv@9.2.0/bsv-gdaf.min.js` |
95
- | **🆕 bsv-ltp.min.js** | 1184KB | **Legal tokens** | `unpkg.com/@smartledger/bsv@9.2.0/bsv-ltp.min.js` |
84
+ | **bsv.min.js** | 937KB | Core BSV + SmartContract | `unpkg.com/@smartledger/bsv@9.3.0/bsv.min.js` |
85
+ | **bsv.bundle.js** | 937KB | Everything in one file | `unpkg.com/@smartledger/bsv@9.3.0/bsv.bundle.js` |
86
+ | **bsv-smartcontract.min.js** | 937KB | Covenant development | `unpkg.com/@smartledger/bsv@9.3.0/bsv-smartcontract.min.js` |
87
+ | **bsv-covenant.min.js** | 913KB | Covenant operations | `unpkg.com/@smartledger/bsv@9.3.0/bsv-covenant.min.js` |
88
+ | **bsv-script-helper.min.js** | 26KB | Custom script tools | `unpkg.com/@smartledger/bsv@9.3.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.3.0/bsv-security.min.js` |
90
+ | **bsv-ecies.min.js** | 71KB | Encryption | `unpkg.com/@smartledger/bsv@9.3.0/bsv-ecies.min.js` |
91
+ | **bsv-message.min.js** | 26KB | Message signing | `unpkg.com/@smartledger/bsv@9.3.0/bsv-message.min.js` |
92
+ | **bsv-mnemonic.min.js** | 681KB | HD wallets | `unpkg.com/@smartledger/bsv@9.3.0/bsv-mnemonic.min.js` |
93
+ | **🆕 bsv-shamir.min.js** | 432KB | **Secret sharing** | `unpkg.com/@smartledger/bsv@9.3.0/bsv-shamir.min.js` |
94
+ | **🆕 bsv-gdaf.min.js** | 1184KB | **Digital attestation** | `unpkg.com/@smartledger/bsv@9.3.0/bsv-gdaf.min.js` |
95
+ | **🆕 bsv-ltp.min.js** | 1184KB | **Legal tokens** | `unpkg.com/@smartledger/bsv@9.3.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.2.0/bsv.min.js"></script>
104
- <script src="https://unpkg.com/@smartledger/bsv@9.2.0/bsv-script-helper.min.js"></script>
103
+ <script src="https://unpkg.com/@smartledger/bsv@9.3.0/bsv.min.js"></script>
104
+ <script src="https://unpkg.com/@smartledger/bsv@9.3.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.2.0/bsv.min.js"></script>
110
- <script src="https://unpkg.com/@smartledger/bsv@9.2.0/bsv-covenant.min.js"></script>
111
- <script src="https://unpkg.com/@smartledger/bsv@9.2.0/bsv-smartcontract.min.js"></script>
109
+ <script src="https://unpkg.com/@smartledger/bsv@9.3.0/bsv.min.js"></script>
110
+ <script src="https://unpkg.com/@smartledger/bsv@9.3.0/bsv-covenant.min.js"></script>
111
+ <script src="https://unpkg.com/@smartledger/bsv@9.3.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.2.0/bsv.min.js"></script>
117
- <script src="https://unpkg.com/@smartledger/bsv@9.2.0/bsv-ltp.min.js"></script>
118
- <script src="https://unpkg.com/@smartledger/bsv@9.2.0/bsv-gdaf.min.js"></script>
116
+ <script src="https://unpkg.com/@smartledger/bsv@9.3.0/bsv.min.js"></script>
117
+ <script src="https://unpkg.com/@smartledger/bsv@9.3.0/bsv-ltp.min.js"></script>
118
+ <script src="https://unpkg.com/@smartledger/bsv@9.3.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.2.0/bsv.min.js"></script>
136
- <script src="https://unpkg.com/@smartledger/bsv@9.2.0/bsv-security.min.js"></script>
137
- <script src="https://unpkg.com/@smartledger/bsv@9.2.0/bsv-shamir.min.js"></script>
135
+ <script src="https://unpkg.com/@smartledger/bsv@9.3.0/bsv.min.js"></script>
136
+ <script src="https://unpkg.com/@smartledger/bsv@9.3.0/bsv-security.min.js"></script>
137
+ <script src="https://unpkg.com/@smartledger/bsv@9.3.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.2.0/bsv.bundle.js"></script>
149
+ <script src="https://unpkg.com/@smartledger/bsv@9.3.0/bsv.bundle.js"></script>
150
150
  <script>
151
151
  // Everything available immediately
152
152
  const shares = bsv.splitSecret('secret', 5, 3);
@@ -0,0 +1,159 @@
1
+ # Envelope fields in `buildInscription` — handoff
2
+
3
+ **Commit:** `0242542` `feat(ordinals): write envelope fields, and refuse the ones that unbind`
4
+ **Touched:** `lib/ordinals/inscription.js`, `test/ordinals/inscription.js` — nothing else.
5
+ **Suite:** 4768 passing, 0 failing.
6
+ **Date:** 29 August 2026
7
+
8
+ This landed in your repo from the OrdinalSource side. It is finished and tested,
9
+ but it is **not releasable as-is** — see *What I did not touch*, which is the
10
+ part that needs you.
11
+
12
+ ---
13
+
14
+ ## What it does
15
+
16
+ `buildInscription` wrote the content type and the body and stopped. Tag 5 —
17
+ `metadata`, the spec's own home for an object's own record — could not be
18
+ written at all, and neither could any other field.
19
+
20
+ That mattered beyond convenience. The only way to produce one was to assemble
21
+ envelope bytes by hand, which is the most dangerous thing an integrator can do
22
+ on this stack: the bytes are permanent, already paid for, and nothing local
23
+ reports a mistake, because a builder agreeing with its own parser proves only
24
+ that they agree.
25
+
26
+ ```js
27
+ bsv.Ordinals.buildInscription({
28
+ address: owner,
29
+ contentType: 'image/jpeg',
30
+ content: image,
31
+ fields: { 5: manifest, 21: thumbnail }
32
+ })
33
+ ```
34
+
35
+ Fields are emitted between the content type and the body, in **ascending tag
36
+ order** so the same input always produces the same bytes. Order carries no
37
+ meaning to a parser before the body opens; reproducibility does.
38
+
39
+ ## What it refuses, and why each one is silent otherwise
40
+
41
+ | Refused | Why it cannot be a warning |
42
+ | --- | --- |
43
+ | **Tag 0** | Opens the body. Everything after it *is* the body, so a field there does not fail — it silently becomes part of the file, and the inscription still looks fine. |
44
+ | **Tag 1** | Is the content type. A second one declares it twice. |
45
+ | **Unrecognized even tag** | The spec requires such an inscription to be "displayed as unbound, that is, without a location". It is indexed nowhere, permanently, and nothing local reports it. |
46
+ | Negative / non-integer tag | Not expressible as a script number. |
47
+ | Empty field value | Inscribes a zero-length field permanently for no reason. |
48
+
49
+ Build time is the last moment any of these is catchable before the money is
50
+ spent, which is why they throw rather than warn.
51
+
52
+ ## The design decision most worth your review
53
+
54
+ `allowUnknownEvenFields` exists, and I went back and forth on it.
55
+
56
+ My first instinct was a hard wall — never emit an unrecognized even tag, no
57
+ exceptions. I changed my mind. The set of named tags grows as the protocol does,
58
+ so a library that can *never* be overridden eventually becomes both wrong and
59
+ unbypassable, and the workaround it forces — hand-assembled envelope bytes — is
60
+ considerably more dangerous than the thing the check prevents.
61
+
62
+ So it throws by default and can be overridden by a flag long enough that nobody
63
+ passes it by accident. If you disagree, this is the knob to turn; the reasoning
64
+ is in the JSDoc on `assertTagIsSafe` so it can be argued with rather than
65
+ guessed at.
66
+
67
+ ## Byte-level details, since they are easy to get wrong
68
+
69
+ - Tags **1–16** are emitted as their opcodes; anything larger as a **minimal
70
+ data push**. `OP_16` is the largest numeric opcode, so tag 21 has no opcode
71
+ form at all.
72
+ - An indexer reads the resulting **stack element**, so `OP_5` and a one-byte
73
+ push of `0x05` are the same tag. The distinction still matters, because a data
74
+ push of a small number is non-minimal and non-minimal pushes are non-standard.
75
+ - Script numbers carry sign in the high bit of the last byte, so a tag ending
76
+ `>= 0x80` is zero-padded or it reads back **negative**.
77
+
78
+ ## What was verified
79
+
80
+ Round-tripped through `@smartledger/ordinals` — a **separate** implementation,
81
+ not this library's own parser:
82
+
83
+ ```
84
+ fields written : { 5: manifest, 21: thumbnail }
85
+ keys read back : ["01", "05", "15", ""] content-type, 5, 21, body
86
+ values : intact
87
+ warnings : [] errors: [] valid: true
88
+ ```
89
+
90
+ All five refusals fire with their own messages, and the override builds while
91
+ the independent parser correctly warns about the result.
92
+
93
+ ---
94
+
95
+ ## What I did not touch — this is the part that needs you
96
+
97
+ **`CHANGELOG.md`, `version.js` and `package.json` all have uncommitted changes
98
+ in the working tree** — the TypeScript-declarations work, `types-test/`,
99
+ `scripts/check-types.js` and the `9.3.0` bump. Staging any of those to write a
100
+ changelog entry would have swept up half-finished work that is not mine.
101
+
102
+ So the feature is committed with **no changelog entry and no version**, which is
103
+ deliberate and needs closing out. Two options:
104
+
105
+ 1. **Fold into 9.3.0.** It is already a minor bump and is not published yet
106
+ (npm `latest` is 9.2.0). Cleanest, if the declarations work ships with it.
107
+ 2. **Hold for 9.4.0**, if you would rather 9.3.0 stay exactly what you scoped.
108
+
109
+ Ready to paste under whichever heading you choose:
110
+
111
+ ```markdown
112
+ ### Added — `buildInscription` can write envelope fields
113
+
114
+ `fields` takes tag numbers to values and emits them between the content type and
115
+ the body, in ascending tag order so identical input always produces identical
116
+ bytes. Tag 5 is `metadata`, the spec's own home for an object's own record; it
117
+ previously could not be written at all, so the only way to produce one was to
118
+ assemble envelope bytes by hand.
119
+
120
+ Three tags are refused at build time because each is silent afterwards. Tag 0
121
+ opens the body, so a field there does not fail — it becomes part of the file.
122
+ Tag 1 is the content type, and a second one declares it twice. An unrecognized
123
+ EVEN tag costs the inscription its location everywhere: the spec requires such
124
+ an inscription to be treated as unbound. Odd tags are ignored by an indexer that
125
+ does not know them, which is why the spec says it is okay to be odd.
126
+
127
+ `allowUnknownEvenFields` overrides the last of those. It exists because the
128
+ named tag set grows with the protocol, and a library that could never be
129
+ overridden would eventually be wrong AND unbypassable — sending people back to
130
+ hand-assembled bytes, which is worse than what the check prevents.
131
+
132
+ Tags 1..16 are emitted as opcodes and anything larger as a minimal data push,
133
+ since OP_16 is the largest numeric opcode. Script numbers carry sign in the high
134
+ bit of the last byte, so a tag ending >= 0x80 is zero-padded rather than read
135
+ back negative.
136
+ ```
137
+
138
+ ## Related, already shipped
139
+
140
+ `@smartledger/ordinals@0.1.6` went to npm the same day, fixing a matching blind
141
+ spot on the reading side: its parity check opened with `if (key.length !== 2)
142
+ return null`, so it only ever inspected single-byte tags. Tag 10 warned; tag
143
+ 258 — `0x02 0x01`, even and unrecognized — did not, while a conformant indexer
144
+ still unbound the inscription.
145
+
146
+ Worth knowing here because the two are the same rule from opposite ends: this
147
+ library now refuses to *write* the hazard, and that one now reports it when it
148
+ *reads* one. Parity is settled by the least significant byte, which little-endian
149
+ puts first, so the rule holds at any tag width.
150
+
151
+ ## Not investigated, flagged only
152
+
153
+ `test/smart_contract/ordinal_transfer.js` and `covenants.js` could not be run
154
+ from an installed copy of the package — they need dev dependencies that are not
155
+ in the published tarball. That is fine for you here in the repo, but it means a
156
+ consumer cannot independently confirm that covenants verify under mainnet flags.
157
+ Given 9.0.0 disclosed that they previously verified under *pre-Genesis* flags
158
+ while the network would have behaved differently, that is a claim worth having
159
+ independently checkable.
@@ -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.2.0/bsv.min.js"></script>
725
+ <script src="https://cdn.jsdelivr.net/npm/@smartledger/bsv@9.3.0/bsv.min.js"></script>
726
726
  </head>
727
727
  <body>
728
728
  <script>
@@ -0,0 +1,41 @@
1
+ # Audit RFQ — ready to send
2
+
3
+ Three per-vendor copies of the enquiry in [`../AUDIT_SCOPE.md`](../AUDIT_SCOPE.md) §6.
4
+
5
+ | File | Vendor | Route |
6
+ | --- | --- | --- |
7
+ | `cure53.txt` | Cure53 | `mail@cure53.de` |
8
+ | `ncc-group.txt` | NCC Group — Cryptography Services | enquiry form |
9
+ | `trail-of-bits.txt` | Trail of Bits | contact form |
10
+
11
+ **Verify each route on the vendor's own site before sending.** They are recorded here
12
+ as the commonly published ones, not as confirmed current addresses.
13
+
14
+ ## What differs between them
15
+
16
+ Only the greeting. The scope section — everything from *"We maintain
17
+ @smartledger/bsv"* to the sign-off — is byte-identical in all three, checked by hash:
18
+
19
+ ```
20
+ cure53 78cfa6aba956d1ed
21
+ ncc-group 78cfa6aba956d1ed
22
+ trail-of-bits 78cfa6aba956d1ed
23
+ ```
24
+
25
+ That is the point of `AUDIT_SCOPE.md`: every vendor prices the same thing, so the
26
+ spread in how they scope it back is informative. The one-sentence opener is drawn
27
+ from the vendor rationale in §5 and changes nothing priced — delete it if you would
28
+ rather they all receive identical text.
29
+
30
+ ## Regenerating
31
+
32
+ These are generated from `AUDIT_SCOPE.md` §6, never hand-written, so the figures
33
+ cannot drift between the scope document and what a vendor receives. If you edit the
34
+ enquiry text, regenerate rather than editing these files.
35
+
36
+ **Before sending, re-run §7 of `AUDIT_SCOPE.md`.** The figures are measured at a
37
+ commit and go stale: the previous set was 445 lines light after twelve days, most of
38
+ it in `lib/script/interpreter.js`, which is tier 1 and therefore the number a vendor
39
+ quotes against. Current figures were measured 2026-08-28 at `aa551a1`.
40
+
41
+ Reply address in all three: `support@smartledger.technology`.
@@ -0,0 +1,49 @@
1
+ To: Cure53
2
+ Route: mail@cure53.de — verify on cure53.de before sending
3
+ Reply-to: support@smartledger.technology
4
+
5
+ Subject: Audit enquiry — BSV cryptographic library core (~13k LOC JavaScript)
6
+
7
+ Hello,
8
+
9
+ We are approaching you first because you audited the Noble libraries our
10
+ primitives come from, so the layer beneath this code is already familiar to
11
+ you.
12
+
13
+ We maintain @smartledger/bsv, a Bitcoin SV library published on npm. We are
14
+ seeking a quote for an independent security review of its cryptographic core.
15
+
16
+ Scope, and we would like these priced separately:
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.
21
+
22
+ Tier 2 — 1,607 lines. BIP-39 mnemonics, ECIES, and the Base58Check/varint
23
+ decoding surface.
24
+
25
+ JavaScript (CommonJS), Node >= 20.19. The code is public.
26
+
27
+ 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.
31
+
32
+ Context that should shorten discovery: the core is inherited from bitcore and
33
+ has been fixed reactively but never independently reviewed. We can provide a
34
+ test-backed threat model, a 452-case behavioural conformance corpus that a
35
+ 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.
40
+
41
+ Could you indicate availability, an approximate cost range, and what you would
42
+ need from us to firm that up?
43
+
44
+ Repository: https://github.com/codenlighten/smartledger-bsv
45
+ Package: https://www.npmjs.com/package/@smartledger/bsv
46
+
47
+ Thank you,
48
+ SmartLedger Technology
49
+ support@smartledger.technology
@@ -0,0 +1,49 @@
1
+ To: NCC Group — Cryptography Services
2
+ Route: nccgroup.com — Cryptography Services enquiry (verify route)
3
+ Reply-to: support@smartledger.technology
4
+
5
+ Subject: Audit enquiry — BSV cryptographic library core (~13k LOC JavaScript)
6
+
7
+ Hello,
8
+
9
+ We are approaching your Cryptography Services team specifically rather than
10
+ a general assurance engagement, because the sighash construction and key-
11
+ derivation portions are the parts we are least able to review ourselves.
12
+
13
+ We maintain @smartledger/bsv, a Bitcoin SV library published on npm. We are
14
+ seeking a quote for an independent security review of its cryptographic core.
15
+
16
+ Scope, and we would like these priced separately:
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.
21
+
22
+ Tier 2 — 1,607 lines. BIP-39 mnemonics, ECIES, and the Base58Check/varint
23
+ decoding surface.
24
+
25
+ JavaScript (CommonJS), Node >= 20.19. The code is public.
26
+
27
+ 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.
31
+
32
+ Context that should shorten discovery: the core is inherited from bitcore and
33
+ has been fixed reactively but never independently reviewed. We can provide a
34
+ test-backed threat model, a 452-case behavioural conformance corpus that a
35
+ 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.
40
+
41
+ Could you indicate availability, an approximate cost range, and what you would
42
+ need from us to firm that up?
43
+
44
+ Repository: https://github.com/codenlighten/smartledger-bsv
45
+ Package: https://www.npmjs.com/package/@smartledger/bsv
46
+
47
+ Thank you,
48
+ SmartLedger Technology
49
+ support@smartledger.technology
@@ -0,0 +1,49 @@
1
+ To: Trail of Bits
2
+ Route: Contact form on trailofbits.com — verify current route
3
+ Reply-to: support@smartledger.technology
4
+
5
+ Subject: Audit enquiry — BSV cryptographic library core (~13k LOC JavaScript)
6
+
7
+ Hello,
8
+
9
+ We are approaching you for the exploit-oriented methodology in particular:
10
+ the failure mode described below — a check reported as passed without being
11
+ performed — is the one our own findings keep taking.
12
+
13
+ We maintain @smartledger/bsv, a Bitcoin SV library published on npm. We are
14
+ seeking a quote for an independent security review of its cryptographic core.
15
+
16
+ Scope, and we would like these priced separately:
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.
21
+
22
+ Tier 2 — 1,607 lines. BIP-39 mnemonics, ECIES, and the Base58Check/varint
23
+ decoding surface.
24
+
25
+ JavaScript (CommonJS), Node >= 20.19. The code is public.
26
+
27
+ 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.
31
+
32
+ Context that should shorten discovery: the core is inherited from bitcore and
33
+ has been fixed reactively but never independently reviewed. We can provide a
34
+ test-backed threat model, a 452-case behavioural conformance corpus that a
35
+ 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.
40
+
41
+ Could you indicate availability, an approximate cost range, and what you would
42
+ need from us to firm that up?
43
+
44
+ Repository: https://github.com/codenlighten/smartledger-bsv
45
+ Package: https://www.npmjs.com/package/@smartledger/bsv
46
+
47
+ Thank you,
48
+ SmartLedger Technology
49
+ support@smartledger.technology