@smartledger/bsv 9.1.1 → 9.2.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 +59 -0
- package/README.md +19 -19
- package/bsv-gdaf.min.js +42 -42
- package/bsv-ltp.min.js +28 -28
- package/bsv-smartcontract.min.js +1 -1
- package/bsv.bundle.js +42 -42
- package/bsv.d.ts +53 -3
- package/bsv.min.js +42 -42
- package/docs/MODULE_REFERENCE_COMPLETE.md +27 -27
- package/docs/advanced/UTXO_MANAGER_GUIDE.md +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/index.js +5 -4
- package/index.mjs +1 -0
- package/jcs-entry.d.ts +12 -0
- package/jcs-entry.js +1 -0
- package/lib/ltp/claim.js +105 -14
- package/lib/util/jcs.js +44 -14
- package/package.json +6 -1
- package/version.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,65 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [9.2.0] - 2026-08-25
|
|
11
|
+
|
|
12
|
+
### Added — RFC 8785 canonicalization is now public API
|
|
13
|
+
|
|
14
|
+
`@smartledger/bsv/jcs`, and `bsv.JCS` on the namespace. Both are the implementation
|
|
15
|
+
that has been in `lib/util/jcs.js` since 8.2.0, unchanged in what it produces.
|
|
16
|
+
|
|
17
|
+
It was private: absent from the `exports` map and from `bsv.d.ts`. So the only
|
|
18
|
+
canonicalizer a consumer could reach was `bsv.canonicalizeClaim`, which is not RFC
|
|
19
|
+
8785 — and downstream packages independently reimplemented the non-conformant form,
|
|
20
|
+
because it was the one they could see.
|
|
21
|
+
|
|
22
|
+
Use it for anything hashed or signed that someone else might check:
|
|
23
|
+
|
|
24
|
+
```js
|
|
25
|
+
const JCS = require('@smartledger/bsv/jcs')
|
|
26
|
+
JCS.stringify({ 2: 'two', 10: 'ten' }) // {"10":"ten","2":"two"}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Two behaviours changed, neither reachable by input that previously succeeded:
|
|
30
|
+
circular structures now throw a typed error instead of exhausting the call stack,
|
|
31
|
+
and `bigint` throws instead of falling through to a generic type error. The function
|
|
32
|
+
is now reachable from verifiers, and verifier input is untrusted.
|
|
33
|
+
|
|
34
|
+
### Deprecated — the default canonicalization of LTP claim hashes
|
|
35
|
+
|
|
36
|
+
`LTP.Claim.canonicalize`, `LTP.Claim.hash`, `bsv.canonicalizeClaim` and
|
|
37
|
+
`bsv.hashClaim` take an optional second argument:
|
|
38
|
+
`bsv.LTP.Claim.CANONICALIZATION.JCS` or `.LEGACY`. Omitting it selects `LEGACY`,
|
|
39
|
+
warns once, and keeps working. **The default becomes `JCS` in 10.0.0.**
|
|
40
|
+
|
|
41
|
+
The legacy form sorts keys and then rebuilds the object, which loses the sort: V8
|
|
42
|
+
orders integer-like own properties numerically ahead of string keys whatever order
|
|
43
|
+
they were inserted in.
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
LEGACY {"2":"two","10":"ten"}
|
|
47
|
+
JCS {"10":"ten","2":"two"} RFC 8785, UTF-16 code unit order
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
It is deterministic, so nothing already hashed is wrong and nothing is forgeable —
|
|
51
|
+
signing and verification within this library have always agreed. It is not
|
|
52
|
+
*interoperable*: an RFC 8785 implementation in another language computes a different
|
|
53
|
+
claim hash and rejects a valid one. It only bites when a claim has integer-like keys
|
|
54
|
+
— lot numbers, unit numbers, years — which is why it went unnoticed, and why it
|
|
55
|
+
fails in a counterparty's verifier rather than in our own tests.
|
|
56
|
+
|
|
57
|
+
Per STABILITY.md this is a minor, so the default does not move in 9.x. Pass the
|
|
58
|
+
argument explicitly to pin behaviour across 10.0.0.
|
|
59
|
+
|
|
60
|
+
An unrecognised value throws rather than falling back to `LEGACY`: a typo such as
|
|
61
|
+
`'JCS'` quietly producing differently-hashed claims would recreate the exact failure
|
|
62
|
+
this change exists to remove.
|
|
63
|
+
|
|
64
|
+
`prepareClaimValidation`, `prepareClaimAttestation` and `prepareClaimDispute` emit
|
|
65
|
+
hashes that callers store as identifiers and cannot pass an argument for. Those are
|
|
66
|
+
pinned to `LEGACY` for all of 9.x and do not warn — a notice naming a function the
|
|
67
|
+
caller never called is noise. They move to `JCS` in 10.0.0 as one documented change.
|
|
68
|
+
|
|
10
69
|
## [9.1.1] - 2026-08-24
|
|
11
70
|
|
|
12
71
|
### Fixed — MerkleBlock shared mutable state with its caller
|
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** |
|
|
159
|
-
| **bsv.bundle.js** |
|
|
158
|
+
| **bsv.min.js** | 1042KB | Core BSV + SmartContract | `unpkg.com/@smartledger/bsv@9.2.0/bsv.min.js` |
|
|
159
|
+
| **bsv.bundle.js** | 1042KB | Everything in one file | `unpkg.com/@smartledger/bsv@9.2.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.2.0/bsv-didweb.min.js` |
|
|
165
|
+
| **🟢 bsv-vcjwt.min.js** | 166KB | **VC-JWT issue/verify** | `unpkg.com/@smartledger/bsv@9.2.0/bsv-vcjwt.min.js` |
|
|
166
|
+
| **🟢 bsv-statuslist.min.js** | 256KB | **StatusList2021 revocation** | `unpkg.com/@smartledger/bsv@9.2.0/bsv-statuslist.min.js` |
|
|
167
|
+
| **🟢 bsv-anchor.min.js** | 164KB | **BSV anchoring (hash-only)** | `unpkg.com/@smartledger/bsv@9.2.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** | 140KB | 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** | 140KB | Complete covenant framework | `unpkg.com/@smartledger/bsv@9.2.0/bsv-smartcontract.min.js` |
|
|
173
|
+
| **bsv-covenant.min.js** | 35KB | Covenant operations | `unpkg.com/@smartledger/bsv@9.2.0/bsv-covenant.min.js` |
|
|
174
|
+
| **bsv-script-helper.min.js** | 33KB | Custom script tools | `unpkg.com/@smartledger/bsv@9.2.0/bsv-script-helper.min.js` |
|
|
175
|
+
| **bsv-security.min.js** | 32KB | Security enhancements | `unpkg.com/@smartledger/bsv@9.2.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** |
|
|
180
|
+
| **bsv-ltp.min.js** | 539KB | Legal Token Protocol | `unpkg.com/@smartledger/bsv@9.2.0/bsv-ltp.min.js` |
|
|
181
|
+
| **bsv-gdaf.min.js** | 1042KB | Digital Identity & Attestation | `unpkg.com/@smartledger/bsv@9.2.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.2.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.2.0/bsv-ecies.min.js` |
|
|
192
|
+
| **bsv-message.min.js** | 34KB | Message signing | `unpkg.com/@smartledger/bsv@9.2.0/bsv-message.min.js` |
|
|
193
|
+
| **bsv-mnemonic.min.js** | 320KB | HD wallets | `unpkg.com/@smartledger/bsv@9.2.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.2.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.2.0**
|