@smartledger/bsv 5.1.0 → 5.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 +24 -0
- package/README.md +40 -40
- package/bsv-covenant.min.js +14 -6
- package/bsv-ecies.min.js +13 -5
- package/bsv-gdaf.min.js +18 -10
- package/bsv-ltp.min.js +18 -10
- package/bsv-smartcontract.min.js +18 -10
- package/bsv.bundle.js +18 -10
- package/bsv.min.js +18 -10
- 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/lib/ecies/bitcore-ecies.js +53 -82
- package/lib/ecies/electrum-ecies.js +33 -73
- package/package.json +4 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,30 @@ All notable changes to SmartLedger-BSV will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [5.2.0] - 2026-06-15
|
|
9
|
+
|
|
10
|
+
First migration of bsv's cryptography to the audited `@noble` suite (ECIES).
|
|
11
|
+
No API or wire-format change.
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
|
|
15
|
+
- **ECIES crypto primitives migrated to the audited `@noble` suite.** Both ECIES
|
|
16
|
+
variants — the default Electrum BIE1 (`bsv.ECIES`) and the legacy Bitcore
|
|
17
|
+
ECIES (`bsv.ECIES.bitcoreECIES`) — now use `@noble/curves` (secp256k1 ECDH),
|
|
18
|
+
`@noble/hashes` (SHA-512/SHA-256/HMAC) and `@noble/ciphers` (AES-CBC) instead
|
|
19
|
+
of `elliptic` + `aes-js` for their cryptographic operations. The `@noble`
|
|
20
|
+
libraries are audited, constant-time and dependency-free.
|
|
21
|
+
- **No API or wire-format change.** Ciphertexts are byte-identical to prior
|
|
22
|
+
versions and interoperate in both directions — locked by the existing golden
|
|
23
|
+
known-answer vectors in `test/ecies/{bitcore,electrum}-ecies.js`, which now
|
|
24
|
+
run against the `@noble` implementation.
|
|
25
|
+
- This is the first piece of bsv's crypto to move to `@noble`; `elliptic`/
|
|
26
|
+
`bn.js` remain for signing/keys (a future migration). Enabled by the
|
|
27
|
+
webpack 5 build (5.1.0), which — unlike webpack 4 — can bundle `@noble`'s
|
|
28
|
+
BigInt-based code.
|
|
29
|
+
- `@noble/curves`, `@noble/hashes`, `@noble/ciphers` added as (pinned)
|
|
30
|
+
dependencies. `bsv-ecies.min.js` grows ~76KB → ~79KB.
|
|
31
|
+
|
|
8
32
|
## [5.1.0] - 2026-06-15
|
|
9
33
|
|
|
10
34
|
Build-tooling modernization. **No source or API changes** — the published
|
package/README.md
CHANGED
|
@@ -72,7 +72,7 @@ const ok = SC.verifyScript(unlockScript, lockingScript, tx, inputIndex, satoshis
|
|
|
72
72
|
|
|
73
73
|
```bash
|
|
74
74
|
# Install SmartLedger BSV v5.0.0
|
|
75
|
-
npm install @smartledger/bsv@5.
|
|
75
|
+
npm install @smartledger/bsv@5.2.0
|
|
76
76
|
|
|
77
77
|
# Initialize DID:web issuer (generates ES256 keys)
|
|
78
78
|
npx smartledger-bsv didweb init --domain example.com --alg ES256
|
|
@@ -181,42 +181,42 @@ console.log('Status:', status) // 'revoked'
|
|
|
181
181
|
### **Core Modules**
|
|
182
182
|
| Module | Size | Use Case | CDN |
|
|
183
183
|
|--------|------|----------|-----|
|
|
184
|
-
| **bsv.min.js** |
|
|
185
|
-
| **bsv.bundle.js** |
|
|
184
|
+
| **bsv.min.js** | 1270KB | Core BSV + SmartContract | `unpkg.com/@smartledger/bsv@5.2.0/bsv.min.js` |
|
|
185
|
+
| **bsv.bundle.js** | 1270KB | Everything in one file | `unpkg.com/@smartledger/bsv@5.2.0/bsv.bundle.js` |
|
|
186
186
|
|
|
187
187
|
### **W3C Verifiable Credentials**
|
|
188
188
|
| Module | Size | Use Case | CDN |
|
|
189
189
|
|--------|------|----------|-----|
|
|
190
|
-
| **🟢 bsv-didweb.min.js** | 453KB | **DID:web generation** | `unpkg.com/@smartledger/bsv@5.
|
|
191
|
-
| **🟢 bsv-vcjwt.min.js** | 454KB | **VC-JWT issue/verify** | `unpkg.com/@smartledger/bsv@5.
|
|
192
|
-
| **🟢 bsv-statuslist.min.js** | 553KB | **StatusList2021 revocation** | `unpkg.com/@smartledger/bsv@5.
|
|
193
|
-
| **🟢 bsv-anchor.min.js** | 452KB | **BSV anchoring (hash-only)** | `unpkg.com/@smartledger/bsv@5.
|
|
190
|
+
| **🟢 bsv-didweb.min.js** | 453KB | **DID:web generation** | `unpkg.com/@smartledger/bsv@5.2.0/bsv-didweb.min.js` |
|
|
191
|
+
| **🟢 bsv-vcjwt.min.js** | 454KB | **VC-JWT issue/verify** | `unpkg.com/@smartledger/bsv@5.2.0/bsv-vcjwt.min.js` |
|
|
192
|
+
| **🟢 bsv-statuslist.min.js** | 553KB | **StatusList2021 revocation** | `unpkg.com/@smartledger/bsv@5.2.0/bsv-statuslist.min.js` |
|
|
193
|
+
| **🟢 bsv-anchor.min.js** | 452KB | **BSV anchoring (hash-only)** | `unpkg.com/@smartledger/bsv@5.2.0/bsv-anchor.min.js` |
|
|
194
194
|
|
|
195
195
|
### **Smart Contract & Development**
|
|
196
196
|
| Module | Size | Use Case | CDN |
|
|
197
197
|
|--------|------|----------|-----|
|
|
198
|
-
| **bsv-smartcontract.min.js** |
|
|
199
|
-
| **bsv-covenant.min.js** |
|
|
200
|
-
| **bsv-script-helper.min.js** | 30KB | Custom script tools | `unpkg.com/@smartledger/bsv@5.
|
|
201
|
-
| **bsv-security.min.js** | 30KB | Security enhancements | `unpkg.com/@smartledger/bsv@5.
|
|
198
|
+
| **bsv-smartcontract.min.js** | 943KB | Complete covenant framework | `unpkg.com/@smartledger/bsv@5.2.0/bsv-smartcontract.min.js` |
|
|
199
|
+
| **bsv-covenant.min.js** | 943KB | Covenant operations | `unpkg.com/@smartledger/bsv@5.2.0/bsv-covenant.min.js` |
|
|
200
|
+
| **bsv-script-helper.min.js** | 30KB | Custom script tools | `unpkg.com/@smartledger/bsv@5.2.0/bsv-script-helper.min.js` |
|
|
201
|
+
| **bsv-security.min.js** | 30KB | Security enhancements | `unpkg.com/@smartledger/bsv@5.2.0/bsv-security.min.js` |
|
|
202
202
|
|
|
203
203
|
### **Legal & Compliance**
|
|
204
204
|
| Module | Size | Use Case | CDN |
|
|
205
205
|
|--------|------|----------|-----|
|
|
206
|
-
| **bsv-ltp.min.js** |
|
|
207
|
-
| **bsv-gdaf.min.js** |
|
|
206
|
+
| **bsv-ltp.min.js** | 1270KB | Legal Token Protocol | `unpkg.com/@smartledger/bsv@5.2.0/bsv-ltp.min.js` |
|
|
207
|
+
| **bsv-gdaf.min.js** | 1270KB | Digital Identity & Attestation | `unpkg.com/@smartledger/bsv@5.2.0/bsv-gdaf.min.js` |
|
|
208
208
|
|
|
209
209
|
### **Advanced Cryptography**
|
|
210
210
|
| Module | Size | Use Case | CDN |
|
|
211
211
|
|--------|------|----------|-----|
|
|
212
|
-
| **bsv-shamir.min.js** | 476KB | Threshold Cryptography | `unpkg.com/@smartledger/bsv@5.
|
|
212
|
+
| **bsv-shamir.min.js** | 476KB | Threshold Cryptography | `unpkg.com/@smartledger/bsv@5.2.0/bsv-shamir.min.js` |
|
|
213
213
|
|
|
214
214
|
### **Utilities**
|
|
215
215
|
| Module | Size | Use Case | CDN |
|
|
216
216
|
|--------|------|----------|-----|
|
|
217
|
-
| **bsv-ecies.min.js** |
|
|
218
|
-
| **bsv-message.min.js** | 30KB | Message signing | `unpkg.com/@smartledger/bsv@5.
|
|
219
|
-
| **bsv-mnemonic.min.js** | 715KB | HD wallets | `unpkg.com/@smartledger/bsv@5.
|
|
217
|
+
| **bsv-ecies.min.js** | 79KB | Encryption | `unpkg.com/@smartledger/bsv@5.2.0/bsv-ecies.min.js` |
|
|
218
|
+
| **bsv-message.min.js** | 30KB | Message signing | `unpkg.com/@smartledger/bsv@5.2.0/bsv-message.min.js` |
|
|
219
|
+
| **bsv-mnemonic.min.js** | 715KB | HD wallets | `unpkg.com/@smartledger/bsv@5.2.0/bsv-mnemonic.min.js` |
|
|
220
220
|
|
|
221
221
|
## ⚡ **2-Minute Quick Start**
|
|
222
222
|
|
|
@@ -227,7 +227,7 @@ Get started with Bitcoin SV development in under 2 minutes:
|
|
|
227
227
|
npm install @smartledger/bsv
|
|
228
228
|
|
|
229
229
|
# Or include in HTML
|
|
230
|
-
<script src="https://unpkg.com/@smartledger/bsv@5.
|
|
230
|
+
<script src="https://unpkg.com/@smartledger/bsv@5.2.0/bsv.min.js"></script>
|
|
231
231
|
```
|
|
232
232
|
|
|
233
233
|
> **🔒 v5.0.0 (production hardening — has breaking changes):** Shamir secret
|
|
@@ -327,8 +327,8 @@ const covenant = bsv.SmartContract.createCovenantBuilder()
|
|
|
327
327
|
|
|
328
328
|
### 🔧 **Basic Development** (~1.3MB total)
|
|
329
329
|
```html
|
|
330
|
-
<script src="https://unpkg.com/@smartledger/bsv@5.
|
|
331
|
-
<script src="https://unpkg.com/@smartledger/bsv@5.
|
|
330
|
+
<script src="https://unpkg.com/@smartledger/bsv@5.2.0/bsv.min.js"></script>
|
|
331
|
+
<script src="https://unpkg.com/@smartledger/bsv@5.2.0/bsv-script-helper.min.js"></script>
|
|
332
332
|
<script>
|
|
333
333
|
const privateKey = new bsv.PrivateKey();
|
|
334
334
|
const utxos = new bsv.SmartContract.UTXOGenerator().createRealUTXOs(2, 100000);
|
|
@@ -337,9 +337,9 @@ const covenant = bsv.SmartContract.createCovenantBuilder()
|
|
|
337
337
|
|
|
338
338
|
### 🔒 **Smart Contract Development** (~3.1MB total — each bundle re-embeds core BSV)
|
|
339
339
|
```html
|
|
340
|
-
<script src="https://unpkg.com/@smartledger/bsv@5.
|
|
341
|
-
<script src="https://unpkg.com/@smartledger/bsv@5.
|
|
342
|
-
<script src="https://unpkg.com/@smartledger/bsv@5.
|
|
340
|
+
<script src="https://unpkg.com/@smartledger/bsv@5.2.0/bsv.min.js"></script>
|
|
341
|
+
<script src="https://unpkg.com/@smartledger/bsv@5.2.0/bsv-covenant.min.js"></script>
|
|
342
|
+
<script src="https://unpkg.com/@smartledger/bsv@5.2.0/bsv-smartcontract.min.js"></script>
|
|
343
343
|
<script>
|
|
344
344
|
const covenant = bsv.SmartContract.createCovenantBuilder()
|
|
345
345
|
.extractField('amount').push(50000).greaterThanOrEqual().verify().build();
|
|
@@ -349,9 +349,9 @@ const covenant = bsv.SmartContract.createCovenantBuilder()
|
|
|
349
349
|
|
|
350
350
|
### 🆕 **Legal & Identity Development** (~3.7MB total — each bundle re-embeds core BSV)
|
|
351
351
|
```html
|
|
352
|
-
<script src="https://unpkg.com/@smartledger/bsv@5.
|
|
353
|
-
<script src="https://unpkg.com/@smartledger/bsv@5.
|
|
354
|
-
<script src="https://unpkg.com/@smartledger/bsv@5.
|
|
352
|
+
<script src="https://unpkg.com/@smartledger/bsv@5.2.0/bsv.min.js"></script>
|
|
353
|
+
<script src="https://unpkg.com/@smartledger/bsv@5.2.0/bsv-ltp.min.js"></script>
|
|
354
|
+
<script src="https://unpkg.com/@smartledger/bsv@5.2.0/bsv-gdaf.min.js"></script>
|
|
355
355
|
<script>
|
|
356
356
|
// Legal Token Protocol
|
|
357
357
|
const propertyToken = bsv.createPropertyToken({
|
|
@@ -365,9 +365,9 @@ const covenant = bsv.SmartContract.createCovenantBuilder()
|
|
|
365
365
|
|
|
366
366
|
### 🆕 **Security & Cryptography** (~1.7MB total)
|
|
367
367
|
```html
|
|
368
|
-
<script src="https://unpkg.com/@smartledger/bsv@5.
|
|
369
|
-
<script src="https://unpkg.com/@smartledger/bsv@5.
|
|
370
|
-
<script src="https://unpkg.com/@smartledger/bsv@5.
|
|
368
|
+
<script src="https://unpkg.com/@smartledger/bsv@5.2.0/bsv.min.js"></script>
|
|
369
|
+
<script src="https://unpkg.com/@smartledger/bsv@5.2.0/bsv-security.min.js"></script>
|
|
370
|
+
<script src="https://unpkg.com/@smartledger/bsv@5.2.0/bsv-shamir.min.js"></script>
|
|
371
371
|
<script>
|
|
372
372
|
// Threshold Cryptography
|
|
373
373
|
const shares = bsv.splitSecret('my_secret_key', 5, 3); // 5 shares, 3 needed
|
|
@@ -379,7 +379,7 @@ const covenant = bsv.SmartContract.createCovenantBuilder()
|
|
|
379
379
|
|
|
380
380
|
### 🎯 **Everything Bundle** (~1.3MB)
|
|
381
381
|
```html
|
|
382
|
-
<script src="https://unpkg.com/@smartledger/bsv@5.
|
|
382
|
+
<script src="https://unpkg.com/@smartledger/bsv@5.2.0/bsv.bundle.js"></script>
|
|
383
383
|
<script>
|
|
384
384
|
// Everything available immediately
|
|
385
385
|
const shares = bsv.splitSecret('secret', 5, 3); // Shamir Secret Sharing
|
|
@@ -412,7 +412,7 @@ const covenant = bsv.SmartContract.createCovenantBuilder()
|
|
|
412
412
|
- � **PUSHTX Integration**: nChain techniques for advanced covenant patterns → [PUSHTX Insights](docs/pushtx-key-insights.md)
|
|
413
413
|
|
|
414
414
|
### 📦 **Flexible Architecture**
|
|
415
|
-
- 📦 **16 Modular Options**: Load only what you need (30KB to
|
|
415
|
+
- 📦 **16 Modular Options**: Load only what you need (30KB to 1270KB) → [Loading Strategy](#-16-loading-options---choose-your-approach)
|
|
416
416
|
- 📦 **Standalone Modules**: Independent legal, identity, and crypto modules → [Standalone Test](https://github.com/codenlighten/smartledger-bsv/blob/main/tests/standalone-modules-test.html)
|
|
417
417
|
- 📦 **Complete Bundle**: Everything in one file for convenience → [Bundle Demo](https://github.com/codenlighten/smartledger-bsv/blob/main/tests/bundle-demo.html)
|
|
418
418
|
- 📦 **CDN Ready**: All modules available via unpkg and jsDelivr
|
|
@@ -488,8 +488,8 @@ const contractTx = covenant.createCovenantTransaction({
|
|
|
488
488
|
|
|
489
489
|
#### 1. **Minimal Setup** - Core + Script Helper (~1.3MB)
|
|
490
490
|
```html
|
|
491
|
-
<script src="https://unpkg.com/@smartledger/bsv@5.
|
|
492
|
-
<script src="https://unpkg.com/@smartledger/bsv@5.
|
|
491
|
+
<script src="https://unpkg.com/@smartledger/bsv@5.2.0/bsv.min.js"></script>
|
|
492
|
+
<script src="https://unpkg.com/@smartledger/bsv@5.2.0/bsv-script-helper.min.js"></script>
|
|
493
493
|
<script>
|
|
494
494
|
const tx = new bsv.Transaction();
|
|
495
495
|
const sig = bsvScriptHelper.createSignature(tx, privateKey, 0, script, satoshis);
|
|
@@ -498,9 +498,9 @@ const contractTx = covenant.createCovenantTransaction({
|
|
|
498
498
|
|
|
499
499
|
#### 2. **DeFi Development** - Core + Covenants + Debug (~3.1MB — each bundle re-embeds core BSV)
|
|
500
500
|
```html
|
|
501
|
-
<script src="https://unpkg.com/@smartledger/bsv@5.
|
|
502
|
-
<script src="https://unpkg.com/@smartledger/bsv@5.
|
|
503
|
-
<script src="https://unpkg.com/@smartledger/bsv@5.
|
|
501
|
+
<script src="https://unpkg.com/@smartledger/bsv@5.2.0/bsv.min.js"></script>
|
|
502
|
+
<script src="https://unpkg.com/@smartledger/bsv@5.2.0/bsv-covenant.min.js"></script>
|
|
503
|
+
<script src="https://unpkg.com/@smartledger/bsv@5.2.0/bsv-smartcontract.min.js"></script>
|
|
504
504
|
<script>
|
|
505
505
|
const covenant = new bsvCovenant.CovenantInterface();
|
|
506
506
|
const debugInfo = SmartContract.interpretScript(script);
|
|
@@ -510,8 +510,8 @@ const contractTx = covenant.createCovenantTransaction({
|
|
|
510
510
|
|
|
511
511
|
#### 3. **Security First** - Core + Enhanced Security (~1.3MB)
|
|
512
512
|
```html
|
|
513
|
-
<script src="https://unpkg.com/@smartledger/bsv@5.
|
|
514
|
-
<script src="https://unpkg.com/@smartledger/bsv@5.
|
|
513
|
+
<script src="https://unpkg.com/@smartledger/bsv@5.2.0/bsv.min.js"></script>
|
|
514
|
+
<script src="https://unpkg.com/@smartledger/bsv@5.2.0/bsv-security.min.js"></script>
|
|
515
515
|
<script>
|
|
516
516
|
const verified = bsvSecurity.SmartVerify.verify(signature, hash, publicKey);
|
|
517
517
|
const enhanced = bsvSecurity.EllipticFixed.createSignature(privateKey, hash);
|
|
@@ -520,7 +520,7 @@ const contractTx = covenant.createCovenantTransaction({
|
|
|
520
520
|
|
|
521
521
|
#### 4. **Everything Bundle** - One File Solution (~1.3MB)
|
|
522
522
|
```html
|
|
523
|
-
<script src="https://unpkg.com/@smartledger/bsv@5.
|
|
523
|
+
<script src="https://unpkg.com/@smartledger/bsv@5.2.0/bsv.bundle.js"></script>
|
|
524
524
|
<script>
|
|
525
525
|
// Everything available under bsv namespace
|
|
526
526
|
const keys = bsv.SmartLedgerBundle.generateKeys();
|
|
@@ -809,7 +809,7 @@ const timelockScript = helper.createTimelockScript(
|
|
|
809
809
|
|
|
810
810
|
See the **[16 Loading Options](#-16-loading-options---choose-your-approach)**
|
|
811
811
|
table near the top for the full list of bundles with current sizes and
|
|
812
|
-
canonical `unpkg.com/@smartledger/bsv@5.
|
|
812
|
+
canonical `unpkg.com/@smartledger/bsv@5.2.0/...` URLs.
|
|
813
813
|
|
|
814
814
|
## 🔐 Security
|
|
815
815
|
|