@smartledger/bsv 9.10.1 → 9.11.1
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 +71 -0
- package/README.md +19 -19
- package/bsv-gdaf.min.js +58 -58
- package/bsv-ltp.min.js +28 -28
- package/bsv-smartcontract.min.js +1 -1
- package/bsv.bundle.js +58 -58
- package/bsv.min.js +58 -58
- package/docs/AUDIT_SCOPE.md +8 -8
- package/docs/MODULE_REFERENCE_COMPLETE.md +27 -27
- package/docs/advanced/UTXO_MANAGER_GUIDE.md +1 -1
- package/docs/audit-rfq/cure53.txt +2 -2
- package/docs/audit-rfq/ncc-group.txt +2 -2
- package/docs/audit-rfq/trail-of-bits.txt +2 -2
- 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/script/interpreter.js +21 -4
- package/lib/script/script.js +110 -28
- package/lib/transaction/sighash.js +12 -5
- package/package.json +1 -1
- package/version.js +1 -1
|
@@ -102,8 +102,9 @@ var sighashPreimageForForkId = function (transaction, sighashType, inputNumber,
|
|
|
102
102
|
writer.writeUInt32LE(input.outputIndex)
|
|
103
103
|
|
|
104
104
|
// scriptCode of the input (serialized as scripts inside CTxOuts)
|
|
105
|
-
|
|
106
|
-
writer.
|
|
105
|
+
var scriptCode = subscript.toBuffer()
|
|
106
|
+
writer.writeVarintNum(scriptCode.length)
|
|
107
|
+
writer.write(scriptCode)
|
|
107
108
|
|
|
108
109
|
// value of the output spent by this input (8-byte little endian)
|
|
109
110
|
writer.writeUInt64LEBN(satoshisBN)
|
|
@@ -148,8 +149,13 @@ var sighashPreimage = function sighashPreimage (transaction, sighashType, inputN
|
|
|
148
149
|
// Copy transaction
|
|
149
150
|
var txcopy = Transaction.shallowCopy(transaction)
|
|
150
151
|
|
|
151
|
-
//
|
|
152
|
-
|
|
152
|
+
// The BIP-143 path below only reads the script. The original algorithm
|
|
153
|
+
// modifies it, so it takes its own copy there; copying a large script up
|
|
154
|
+
// front cost more than the whole digest. Anything that is not a Script yet
|
|
155
|
+
// is converted, as the copy did.
|
|
156
|
+
if (!(subscript instanceof Script)) {
|
|
157
|
+
subscript = new Script(subscript)
|
|
158
|
+
}
|
|
153
159
|
|
|
154
160
|
if (flags & Interpreter.SCRIPT_ENABLE_REPLAY_PROTECTION) {
|
|
155
161
|
// Legacy chain's value for fork id must be of the form 0xffxxxx.
|
|
@@ -192,7 +198,8 @@ var sighashPreimage = function sighashPreimage (transaction, sighashType, inputN
|
|
|
192
198
|
return sighashPreimageForForkId(txcopy, sighashType, inputNumber, subscript, satoshisBN)
|
|
193
199
|
}
|
|
194
200
|
|
|
195
|
-
// For no ForkId sighash, separators need to be removed.
|
|
201
|
+
// For no ForkId sighash, separators need to be removed — from a copy.
|
|
202
|
+
subscript = new Script(subscript)
|
|
196
203
|
subscript.removeCodeseparators()
|
|
197
204
|
|
|
198
205
|
var i
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smartledger/bsv",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.11.1",
|
|
4
4
|
"description": "Bitcoin SV library with an interpreter-verified script engine: OP_PUSH_TX covenants, BIP-143 preimage tooling, and consensus flags that match what miners actually enforce. Also ships DID:web / W3C VC-JWT credentials and the Legal Token Protocol.",
|
|
5
5
|
"author": "SmartLedger Technology <hello@smartledger.technology> (https://smartledger.technology)",
|
|
6
6
|
"homepage": "https://github.com/codenlighten/smartledger-bsv#readme",
|
package/version.js
CHANGED