@smartledger/bsv 3.4.4 → 3.4.5
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 +46 -0
- package/README.md +40 -40
- package/bsv-covenant.min.js +4 -4
- package/bsv-gdaf.min.js +4 -4
- package/bsv-ltp.min.js +4 -4
- package/bsv-smartcontract.min.js +3 -3
- package/bsv.bundle.js +3 -3
- package/bsv.min.js +3 -3
- package/docs/COVENANT_DEVELOPMENT_RESOLVED.md +2 -2
- package/docs/MODULE_REFERENCE_COMPLETE.md +27 -27
- package/docs/advanced/UTXO_MANAGER_GUIDE.md +1 -1
- package/docs/getting-started/INSTALLATION.md +25 -25
- package/docs/getting-started/QUICK_START.md +7 -7
- package/docs/migration/FROM_BSV_1_5_6.md +5 -5
- package/lib/script/script.js +19 -0
- package/lib/transaction/input/publickeyhash.js +6 -1
- package/lib/transaction/transaction.js +5 -1
- package/package.json +1 -1
|
@@ -136,9 +136,9 @@ node custom_script_signature_test.js
|
|
|
136
136
|
## 📦 Installation
|
|
137
137
|
|
|
138
138
|
```bash
|
|
139
|
-
npm install smartledger-bsv@3.4.
|
|
139
|
+
npm install smartledger-bsv@3.4.5
|
|
140
140
|
# or
|
|
141
|
-
npm install @smartledger/bsv@3.4.
|
|
141
|
+
npm install @smartledger/bsv@3.4.5
|
|
142
142
|
```
|
|
143
143
|
|
|
144
144
|
## ✅ Verification Results
|
|
@@ -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@3.4.
|
|
58
|
+
- **CDN**: `unpkg.com/@smartledger/bsv@3.4.5/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@3.4.
|
|
64
|
+
- **CDN**: `unpkg.com/@smartledger/bsv@3.4.5/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@3.4.
|
|
70
|
+
- **CDN**: `unpkg.com/@smartledger/bsv@3.4.5/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@3.4.
|
|
85
|
-
| **bsv.bundle.js** | 937KB | Everything in one file | `unpkg.com/@smartledger/bsv@3.4.
|
|
86
|
-
| **bsv-smartcontract.min.js** | 937KB | Covenant development | `unpkg.com/@smartledger/bsv@3.4.
|
|
87
|
-
| **bsv-covenant.min.js** | 913KB | Covenant operations | `unpkg.com/@smartledger/bsv@3.4.
|
|
88
|
-
| **bsv-script-helper.min.js** | 26KB | Custom script tools | `unpkg.com/@smartledger/bsv@3.4.
|
|
89
|
-
| **bsv-security.min.js** | 26KB | Security enhancements (opt-in helpers — see README › Security) | `unpkg.com/@smartledger/bsv@3.4.
|
|
90
|
-
| **bsv-ecies.min.js** | 71KB | Encryption | `unpkg.com/@smartledger/bsv@3.4.
|
|
91
|
-
| **bsv-message.min.js** | 26KB | Message signing | `unpkg.com/@smartledger/bsv@3.4.
|
|
92
|
-
| **bsv-mnemonic.min.js** | 681KB | HD wallets | `unpkg.com/@smartledger/bsv@3.4.
|
|
93
|
-
| **🆕 bsv-shamir.min.js** | 432KB | **Secret sharing** | `unpkg.com/@smartledger/bsv@3.4.
|
|
94
|
-
| **🆕 bsv-gdaf.min.js** | 1184KB | **Digital attestation** | `unpkg.com/@smartledger/bsv@3.4.
|
|
95
|
-
| **🆕 bsv-ltp.min.js** | 1184KB | **Legal tokens** | `unpkg.com/@smartledger/bsv@3.4.
|
|
84
|
+
| **bsv.min.js** | 937KB | Core BSV + SmartContract | `unpkg.com/@smartledger/bsv@3.4.5/bsv.min.js` |
|
|
85
|
+
| **bsv.bundle.js** | 937KB | Everything in one file | `unpkg.com/@smartledger/bsv@3.4.5/bsv.bundle.js` |
|
|
86
|
+
| **bsv-smartcontract.min.js** | 937KB | Covenant development | `unpkg.com/@smartledger/bsv@3.4.5/bsv-smartcontract.min.js` |
|
|
87
|
+
| **bsv-covenant.min.js** | 913KB | Covenant operations | `unpkg.com/@smartledger/bsv@3.4.5/bsv-covenant.min.js` |
|
|
88
|
+
| **bsv-script-helper.min.js** | 26KB | Custom script tools | `unpkg.com/@smartledger/bsv@3.4.5/bsv-script-helper.min.js` |
|
|
89
|
+
| **bsv-security.min.js** | 26KB | Security enhancements (opt-in helpers — see README › Security) | `unpkg.com/@smartledger/bsv@3.4.5/bsv-security.min.js` |
|
|
90
|
+
| **bsv-ecies.min.js** | 71KB | Encryption | `unpkg.com/@smartledger/bsv@3.4.5/bsv-ecies.min.js` |
|
|
91
|
+
| **bsv-message.min.js** | 26KB | Message signing | `unpkg.com/@smartledger/bsv@3.4.5/bsv-message.min.js` |
|
|
92
|
+
| **bsv-mnemonic.min.js** | 681KB | HD wallets | `unpkg.com/@smartledger/bsv@3.4.5/bsv-mnemonic.min.js` |
|
|
93
|
+
| **🆕 bsv-shamir.min.js** | 432KB | **Secret sharing** | `unpkg.com/@smartledger/bsv@3.4.5/bsv-shamir.min.js` |
|
|
94
|
+
| **🆕 bsv-gdaf.min.js** | 1184KB | **Digital attestation** | `unpkg.com/@smartledger/bsv@3.4.5/bsv-gdaf.min.js` |
|
|
95
|
+
| **🆕 bsv-ltp.min.js** | 1184KB | **Legal tokens** | `unpkg.com/@smartledger/bsv@3.4.5/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@3.4.
|
|
104
|
-
<script src="https://unpkg.com/@smartledger/bsv@3.4.
|
|
103
|
+
<script src="https://unpkg.com/@smartledger/bsv@3.4.5/bsv.min.js"></script>
|
|
104
|
+
<script src="https://unpkg.com/@smartledger/bsv@3.4.5/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@3.4.
|
|
110
|
-
<script src="https://unpkg.com/@smartledger/bsv@3.4.
|
|
111
|
-
<script src="https://unpkg.com/@smartledger/bsv@3.4.
|
|
109
|
+
<script src="https://unpkg.com/@smartledger/bsv@3.4.5/bsv.min.js"></script>
|
|
110
|
+
<script src="https://unpkg.com/@smartledger/bsv@3.4.5/bsv-covenant.min.js"></script>
|
|
111
|
+
<script src="https://unpkg.com/@smartledger/bsv@3.4.5/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@3.4.
|
|
117
|
-
<script src="https://unpkg.com/@smartledger/bsv@3.4.
|
|
118
|
-
<script src="https://unpkg.com/@smartledger/bsv@3.4.
|
|
116
|
+
<script src="https://unpkg.com/@smartledger/bsv@3.4.5/bsv.min.js"></script>
|
|
117
|
+
<script src="https://unpkg.com/@smartledger/bsv@3.4.5/bsv-ltp.min.js"></script>
|
|
118
|
+
<script src="https://unpkg.com/@smartledger/bsv@3.4.5/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@3.4.
|
|
136
|
-
<script src="https://unpkg.com/@smartledger/bsv@3.4.
|
|
137
|
-
<script src="https://unpkg.com/@smartledger/bsv@3.4.
|
|
135
|
+
<script src="https://unpkg.com/@smartledger/bsv@3.4.5/bsv.min.js"></script>
|
|
136
|
+
<script src="https://unpkg.com/@smartledger/bsv@3.4.5/bsv-security.min.js"></script>
|
|
137
|
+
<script src="https://unpkg.com/@smartledger/bsv@3.4.5/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@3.4.
|
|
149
|
+
<script src="https://unpkg.com/@smartledger/bsv@3.4.5/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@3.4.
|
|
725
|
+
<script src="https://cdn.jsdelivr.net/npm/@smartledger/bsv@3.4.5/bsv.min.js"></script>
|
|
726
726
|
</head>
|
|
727
727
|
<body>
|
|
728
728
|
<script>
|
|
@@ -12,10 +12,10 @@ SmartLedger-BSV offers multiple installation methods to suit different developme
|
|
|
12
12
|
npm install @smartledger/bsv
|
|
13
13
|
|
|
14
14
|
# Install specific version
|
|
15
|
-
npm install @smartledger/bsv@3.4.
|
|
15
|
+
npm install @smartledger/bsv@3.4.5
|
|
16
16
|
|
|
17
17
|
# Install with exact version lock
|
|
18
|
-
npm install --save-exact @smartledger/bsv@3.4.
|
|
18
|
+
npm install --save-exact @smartledger/bsv@3.4.5
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
### **Usage in Node.js**
|
|
@@ -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@3.4.
|
|
51
|
+
<script src="https://unpkg.com/@smartledger/bsv@3.4.5/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@3.4.
|
|
61
|
+
<script src="https://unpkg.com/@smartledger/bsv@3.4.5/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@3.4.
|
|
75
|
-
<script src="https://unpkg.com/@smartledger/bsv@3.4.
|
|
76
|
-
<script src="https://unpkg.com/@smartledger/bsv@3.4.
|
|
74
|
+
<script src="https://unpkg.com/@smartledger/bsv@3.4.5/bsv.min.js"></script>
|
|
75
|
+
<script src="https://unpkg.com/@smartledger/bsv@3.4.5/bsv-covenant.min.js"></script>
|
|
76
|
+
<script src="https://unpkg.com/@smartledger/bsv@3.4.5/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@3.4.
|
|
86
|
-
<script src="https://unpkg.com/@smartledger/bsv@3.4.
|
|
87
|
-
<script src="https://unpkg.com/@smartledger/bsv@3.4.
|
|
85
|
+
<script src="https://unpkg.com/@smartledger/bsv@3.4.5/bsv.min.js"></script>
|
|
86
|
+
<script src="https://unpkg.com/@smartledger/bsv@3.4.5/bsv-ltp.min.js"></script>
|
|
87
|
+
<script src="https://unpkg.com/@smartledger/bsv@3.4.5/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@3.4.
|
|
102
|
-
<script src="https://unpkg.com/@smartledger/bsv@3.4.
|
|
103
|
-
<script src="https://unpkg.com/@smartledger/bsv@3.4.
|
|
101
|
+
<script src="https://unpkg.com/@smartledger/bsv@3.4.5/bsv.min.js"></script>
|
|
102
|
+
<script src="https://unpkg.com/@smartledger/bsv@3.4.5/bsv-security.min.js"></script>
|
|
103
|
+
<script src="https://unpkg.com/@smartledger/bsv@3.4.5/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@3.4.
|
|
118
|
-
| **bsv.bundle.js** | 937KB | Everything in one file | `unpkg.com/@smartledger/bsv@3.4.
|
|
119
|
-
| **bsv-smartcontract.min.js** | 937KB | Complete covenant framework | `unpkg.com/@smartledger/bsv@3.4.
|
|
120
|
-
| **bsv-ltp.min.js** | 1184KB | **Legal Token Protocol** | `unpkg.com/@smartledger/bsv@3.4.
|
|
121
|
-
| **bsv-gdaf.min.js** | 1184KB | **Digital Identity & Attestation** | `unpkg.com/@smartledger/bsv@3.4.
|
|
122
|
-
| **bsv-shamir.min.js** | 432KB | **Threshold Cryptography** | `unpkg.com/@smartledger/bsv@3.4.
|
|
123
|
-
| **bsv-security.min.js** | 26KB | Security enhancements (opt-in helpers — see README › Security) | `unpkg.com/@smartledger/bsv@3.4.
|
|
124
|
-
| **bsv-mnemonic.min.js** | 681KB | HD wallets | `unpkg.com/@smartledger/bsv@3.4.
|
|
125
|
-
| **bsv-ecies.min.js** | 71KB | Encryption | `unpkg.com/@smartledger/bsv@3.4.
|
|
126
|
-
| **bsv-covenant.min.js** | 913KB | Covenant operations | `unpkg.com/@smartledger/bsv@3.4.
|
|
127
|
-
| **bsv-script-helper.min.js** | 26KB | Custom script tools | `unpkg.com/@smartledger/bsv@3.4.
|
|
128
|
-
| **bsv-message.min.js** | 26KB | Message signing | `unpkg.com/@smartledger/bsv@3.4.
|
|
117
|
+
| **bsv.min.js** | 937KB | Core BSV + SmartContract | `unpkg.com/@smartledger/bsv@3.4.5/bsv.min.js` |
|
|
118
|
+
| **bsv.bundle.js** | 937KB | Everything in one file | `unpkg.com/@smartledger/bsv@3.4.5/bsv.bundle.js` |
|
|
119
|
+
| **bsv-smartcontract.min.js** | 937KB | Complete covenant framework | `unpkg.com/@smartledger/bsv@3.4.5/bsv-smartcontract.min.js` |
|
|
120
|
+
| **bsv-ltp.min.js** | 1184KB | **Legal Token Protocol** | `unpkg.com/@smartledger/bsv@3.4.5/bsv-ltp.min.js` |
|
|
121
|
+
| **bsv-gdaf.min.js** | 1184KB | **Digital Identity & Attestation** | `unpkg.com/@smartledger/bsv@3.4.5/bsv-gdaf.min.js` |
|
|
122
|
+
| **bsv-shamir.min.js** | 432KB | **Threshold Cryptography** | `unpkg.com/@smartledger/bsv@3.4.5/bsv-shamir.min.js` |
|
|
123
|
+
| **bsv-security.min.js** | 26KB | Security enhancements (opt-in helpers — see README › Security) | `unpkg.com/@smartledger/bsv@3.4.5/bsv-security.min.js` |
|
|
124
|
+
| **bsv-mnemonic.min.js** | 681KB | HD wallets | `unpkg.com/@smartledger/bsv@3.4.5/bsv-mnemonic.min.js` |
|
|
125
|
+
| **bsv-ecies.min.js** | 71KB | Encryption | `unpkg.com/@smartledger/bsv@3.4.5/bsv-ecies.min.js` |
|
|
126
|
+
| **bsv-covenant.min.js** | 913KB | Covenant operations | `unpkg.com/@smartledger/bsv@3.4.5/bsv-covenant.min.js` |
|
|
127
|
+
| **bsv-script-helper.min.js** | 26KB | Custom script tools | `unpkg.com/@smartledger/bsv@3.4.5/bsv-script-helper.min.js` |
|
|
128
|
+
| **bsv-message.min.js** | 26KB | Message signing | `unpkg.com/@smartledger/bsv@3.4.5/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@3.4.
|
|
17
|
+
<script src="https://unpkg.com/@smartledger/bsv@3.4.5/bsv.min.js"></script>
|
|
18
18
|
|
|
19
19
|
<!-- Everything included (937KB) -->
|
|
20
|
-
<script src="https://unpkg.com/@smartledger/bsv@3.4.
|
|
20
|
+
<script src="https://unpkg.com/@smartledger/bsv@3.4.5/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@3.4.
|
|
130
|
+
<script src="https://unpkg.com/@smartledger/bsv@3.4.5/bsv.min.js"></script>
|
|
131
131
|
|
|
132
132
|
<!-- Smart contracts (937KB) -->
|
|
133
|
-
<script src="https://unpkg.com/@smartledger/bsv@3.4.
|
|
133
|
+
<script src="https://unpkg.com/@smartledger/bsv@3.4.5/bsv-smartcontract.min.js"></script>
|
|
134
134
|
|
|
135
135
|
<!-- Legal tokens (1.16MB) -->
|
|
136
|
-
<script src="https://unpkg.com/@smartledger/bsv@3.4.
|
|
136
|
+
<script src="https://unpkg.com/@smartledger/bsv@3.4.5/bsv-ltp.min.js"></script>
|
|
137
137
|
|
|
138
138
|
<!-- Digital identity (1.16MB) -->
|
|
139
|
-
<script src="https://unpkg.com/@smartledger/bsv@3.4.
|
|
139
|
+
<script src="https://unpkg.com/@smartledger/bsv@3.4.5/bsv-gdaf.min.js"></script>
|
|
140
140
|
|
|
141
141
|
<!-- Everything (937KB) -->
|
|
142
|
-
<script src="https://unpkg.com/@smartledger/bsv@3.4.
|
|
142
|
+
<script src="https://unpkg.com/@smartledger/bsv@3.4.5/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@3.4.
|
|
162
|
+
<script src="https://unpkg.com/@smartledger/bsv@3.4.5/bsv.min.js"></script>
|
|
163
163
|
|
|
164
164
|
<!-- Add smart contracts when ready -->
|
|
165
|
-
<script src="https://unpkg.com/@smartledger/bsv@3.4.
|
|
165
|
+
<script src="https://unpkg.com/@smartledger/bsv@3.4.5/bsv-smartcontract.min.js"></script>
|
|
166
166
|
|
|
167
167
|
<!-- Add advanced features as needed -->
|
|
168
|
-
<script src="https://unpkg.com/@smartledger/bsv@3.4.
|
|
169
|
-
<script src="https://unpkg.com/@smartledger/bsv@3.4.
|
|
168
|
+
<script src="https://unpkg.com/@smartledger/bsv@3.4.5/bsv-ltp.min.js"></script>
|
|
169
|
+
<script src="https://unpkg.com/@smartledger/bsv@3.4.5/bsv-gdaf.min.js"></script>
|
|
170
170
|
|
|
171
171
|
<!-- Everything in one file -->
|
|
172
|
-
<script src="https://unpkg.com/@smartledger/bsv@3.4.
|
|
172
|
+
<script src="https://unpkg.com/@smartledger/bsv@3.4.5/bsv.bundle.js"></script>
|
|
173
173
|
```
|
|
174
174
|
|
|
175
175
|
## 🔍 **Testing Your Migration**
|
package/lib/script/script.js
CHANGED
|
@@ -334,6 +334,25 @@ Script.prototype.isPublicKeyHashOut = function () {
|
|
|
334
334
|
this.chunks[4].opcodenum === Opcode.OP_CHECKSIG)
|
|
335
335
|
}
|
|
336
336
|
|
|
337
|
+
/**
|
|
338
|
+
* @returns {boolean} true if the FIRST five chunks are a P2PKH pattern, regardless
|
|
339
|
+
* of any trailing chunks. Matches 1Sat Ordinals (P2PKH + `OP_FALSE OP_IF "ord" …
|
|
340
|
+
* OP_ENDIF`), MAP+BAP-style appended metadata, sCrypt covenants with a P2PKH
|
|
341
|
+
* spendable guard, etc. The strict `isPublicKeyHashOut()` is unchanged so
|
|
342
|
+
* address derivation / script classification keep their canonical semantics;
|
|
343
|
+
* this loose check is used by `Transaction.from()` so spending such outputs
|
|
344
|
+
* via the high-level API Just Works.
|
|
345
|
+
*/
|
|
346
|
+
Script.prototype.isPublicKeyHashOutPrefix = function () {
|
|
347
|
+
return !!(this.chunks.length >= 5 &&
|
|
348
|
+
this.chunks[0].opcodenum === Opcode.OP_DUP &&
|
|
349
|
+
this.chunks[1].opcodenum === Opcode.OP_HASH160 &&
|
|
350
|
+
this.chunks[2].buf &&
|
|
351
|
+
this.chunks[2].buf.length === 20 &&
|
|
352
|
+
this.chunks[3].opcodenum === Opcode.OP_EQUALVERIFY &&
|
|
353
|
+
this.chunks[4].opcodenum === Opcode.OP_CHECKSIG)
|
|
354
|
+
}
|
|
355
|
+
|
|
337
356
|
/**
|
|
338
357
|
* @returns {boolean} if this is a pay to public key hash input script
|
|
339
358
|
*/
|
|
@@ -34,7 +34,12 @@ PublicKeyHashInput.prototype.getSignatures = function (transaction, privateKey,
|
|
|
34
34
|
hashData = hashData || Hash.sha256ripemd160(privateKey.publicKey.toBuffer())
|
|
35
35
|
sigtype = sigtype || (Signature.SIGHASH_ALL | Signature.SIGHASH_FORKID)
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
// The dispatcher (Transaction._fromNonP2SH) may have routed a "P2PKH +
|
|
38
|
+
// trailing data" script here via isPublicKeyHashOutPrefix() — in which
|
|
39
|
+
// case the strict getPublicKeyHash() would throw. Read the 20-byte hash
|
|
40
|
+
// directly from chunks[2] (validated by the prefix check at dispatch).
|
|
41
|
+
var scriptPkh = this.output.script.chunks[2] && this.output.script.chunks[2].buf
|
|
42
|
+
if (scriptPkh && hashData.equals(scriptPkh)) {
|
|
38
43
|
return [new TransactionSignature({
|
|
39
44
|
publicKey: privateKey.publicKey,
|
|
40
45
|
prevTxId: this.prevTxId,
|
|
@@ -549,7 +549,11 @@ Transaction.prototype.from = function (utxo, pubkeys, threshold) {
|
|
|
549
549
|
Transaction.prototype._fromNonP2SH = function (utxo) {
|
|
550
550
|
var Clazz
|
|
551
551
|
utxo = new UnspentOutput(utxo)
|
|
552
|
-
|
|
552
|
+
// Use the loose P2PKH check so 1Sat Ordinal outputs (P2PKH + inscription
|
|
553
|
+
// envelope) and other "P2PKH + trailing data" patterns dispatch to the
|
|
554
|
+
// signing-capable subclass instead of falling through to the abstract
|
|
555
|
+
// base Input. See Script.prototype.isPublicKeyHashOutPrefix.
|
|
556
|
+
if (utxo.script.isPublicKeyHashOutPrefix()) {
|
|
553
557
|
Clazz = PublicKeyHashInput
|
|
554
558
|
} else if (utxo.script.isPublicKeyOut()) {
|
|
555
559
|
Clazz = PublicKeyInput
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smartledger/bsv",
|
|
3
|
-
"version": "3.4.
|
|
3
|
+
"version": "3.4.5",
|
|
4
4
|
"description": "🚀 Complete Bitcoin SV development framework with legally-recognizable DID:web + W3C VC-JWT toolkit, Legal Token Protocol (LTP), Global Digital Attestation Framework (GDAF), StatusList2021 revocation, and 16 flexible loading options. Standards-based credentials with ES256/ES256K support, on-chain BSV anchoring, and comprehensive Bitcoin SV API. Perfect for legal tokens, verifiable credentials, DeFi, smart contracts, and secure Bitcoin applications.",
|
|
5
5
|
"author": "SmartLedger Technology <hello@smartledger.technology> (https://smartledger.technology)",
|
|
6
6
|
"homepage": "https://github.com/codenlighten/smartledger-bsv#readme",
|