@ledgerhq/hw-app-btc 10.0.1 → 10.0.2-next.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 +7 -0
- package/lib/Btc.d.ts.map +1 -1
- package/lib/Btc.js +72 -97
- package/lib/Btc.js.map +1 -1
- package/lib/BtcNew.js +217 -313
- package/lib/BtcNew.js.map +1 -1
- package/lib/BtcOld.js +46 -106
- package/lib/BtcOld.js.map +1 -1
- package/lib/bip32.js +12 -12
- package/lib/bip32.js.map +1 -1
- package/lib/buffertools.js +66 -69
- package/lib/buffertools.js.map +1 -1
- package/lib/compressPublicKey.js +3 -3
- package/lib/compressPublicKey.js.map +1 -1
- package/lib/constants.js +1 -1
- package/lib/createTransaction.d.ts +1 -1
- package/lib/createTransaction.d.ts.map +1 -1
- package/lib/createTransaction.js +285 -398
- package/lib/createTransaction.js.map +1 -1
- package/lib/debug.js +11 -13
- package/lib/debug.js.map +1 -1
- package/lib/finalizeInput.js +23 -62
- package/lib/finalizeInput.js.map +1 -1
- package/lib/getAppAndVersion.d.ts +1 -1
- package/lib/getAppAndVersion.d.ts.map +1 -1
- package/lib/getAppAndVersion.js +29 -72
- package/lib/getAppAndVersion.js.map +1 -1
- package/lib/getTrustedInput.js +108 -251
- package/lib/getTrustedInput.js.map +1 -1
- package/lib/getTrustedInputBIP143.js +9 -10
- package/lib/getTrustedInputBIP143.js.map +1 -1
- package/lib/getWalletPublicKey.d.ts +1 -1
- package/lib/getWalletPublicKey.d.ts.map +1 -1
- package/lib/getWalletPublicKey.js +27 -73
- package/lib/getWalletPublicKey.js.map +1 -1
- package/lib/hashPublicKey.js +4 -4
- package/lib/hashPublicKey.js.map +1 -1
- package/lib/index.js +3 -3
- package/lib/index.js.map +1 -1
- package/lib/newops/accounttype.d.ts +2 -2
- package/lib/newops/accounttype.d.ts.map +1 -1
- package/lib/newops/accounttype.js +85 -125
- package/lib/newops/accounttype.js.map +1 -1
- package/lib/newops/appClient.js +98 -205
- package/lib/newops/appClient.js.map +1 -1
- package/lib/newops/clientCommands.js +122 -213
- package/lib/newops/clientCommands.js.map +1 -1
- package/lib/newops/merkelizedPsbt.js +28 -75
- package/lib/newops/merkelizedPsbt.js.map +1 -1
- package/lib/newops/merkle.js +38 -67
- package/lib/newops/merkle.js.map +1 -1
- package/lib/newops/merkleMap.js +11 -12
- package/lib/newops/merkleMap.js.map +1 -1
- package/lib/newops/policy.d.ts +1 -1
- package/lib/newops/policy.d.ts.map +1 -1
- package/lib/newops/policy.js +17 -18
- package/lib/newops/policy.js.map +1 -1
- package/lib/newops/psbtExtractor.js +9 -9
- package/lib/newops/psbtExtractor.js.map +1 -1
- package/lib/newops/psbtFinalizer.js +22 -22
- package/lib/newops/psbtFinalizer.js.map +1 -1
- package/lib/newops/psbtv2.d.ts +1 -1
- package/lib/newops/psbtv2.d.ts.map +1 -1
- package/lib/newops/psbtv2.js +227 -286
- package/lib/newops/psbtv2.js.map +1 -1
- package/lib/serializeTransaction.js +13 -15
- package/lib/serializeTransaction.js.map +1 -1
- package/lib/shouldUseTrustedInputForSegwit.js +4 -5
- package/lib/shouldUseTrustedInputForSegwit.js.map +1 -1
- package/lib/signMessage.js +47 -99
- package/lib/signMessage.js.map +1 -1
- package/lib/signP2SHTransaction.d.ts +1 -1
- package/lib/signP2SHTransaction.d.ts.map +1 -1
- package/lib/signP2SHTransaction.js +91 -187
- package/lib/signP2SHTransaction.js.map +1 -1
- package/lib/signTransaction.js +8 -9
- package/lib/signTransaction.js.map +1 -1
- package/lib/splitTransaction.js +50 -54
- package/lib/splitTransaction.js.map +1 -1
- package/lib/startUntrustedHashTransactionInput.js +65 -167
- package/lib/startUntrustedHashTransactionInput.js.map +1 -1
- package/lib/types.js +1 -1
- package/lib/varint.js +10 -10
- package/lib/varint.js.map +1 -1
- package/lib-es/Btc.d.ts.map +1 -1
- package/lib-es/Btc.js +58 -84
- package/lib-es/Btc.js.map +1 -1
- package/lib-es/BtcNew.js +205 -302
- package/lib-es/BtcNew.js.map +1 -1
- package/lib-es/BtcOld.js +35 -96
- package/lib-es/BtcOld.js.map +1 -1
- package/lib-es/bip32.js +7 -7
- package/lib-es/bip32.js.map +1 -1
- package/lib-es/buffertools.js +62 -67
- package/lib-es/buffertools.js.map +1 -1
- package/lib-es/compressPublicKey.js +2 -2
- package/lib-es/compressPublicKey.js.map +1 -1
- package/lib-es/constants.js +12 -12
- package/lib-es/constants.js.map +1 -1
- package/lib-es/createTransaction.d.ts +1 -1
- package/lib-es/createTransaction.d.ts.map +1 -1
- package/lib-es/createTransaction.js +271 -384
- package/lib-es/createTransaction.js.map +1 -1
- package/lib-es/debug.js +10 -12
- package/lib-es/debug.js.map +1 -1
- package/lib-es/finalizeInput.js +20 -59
- package/lib-es/finalizeInput.js.map +1 -1
- package/lib-es/getAppAndVersion.d.ts +1 -1
- package/lib-es/getAppAndVersion.d.ts.map +1 -1
- package/lib-es/getAppAndVersion.js +27 -70
- package/lib-es/getAppAndVersion.js.map +1 -1
- package/lib-es/getTrustedInput.js +104 -247
- package/lib-es/getTrustedInput.js.map +1 -1
- package/lib-es/getTrustedInputBIP143.js +5 -6
- package/lib-es/getTrustedInputBIP143.js.map +1 -1
- package/lib-es/getWalletPublicKey.d.ts +1 -1
- package/lib-es/getWalletPublicKey.d.ts.map +1 -1
- package/lib-es/getWalletPublicKey.js +25 -71
- package/lib-es/getWalletPublicKey.js.map +1 -1
- package/lib-es/newops/accounttype.d.ts +2 -2
- package/lib-es/newops/accounttype.d.ts.map +1 -1
- package/lib-es/newops/accounttype.js +79 -123
- package/lib-es/newops/accounttype.js.map +1 -1
- package/lib-es/newops/appClient.js +92 -200
- package/lib-es/newops/appClient.js.map +1 -1
- package/lib-es/newops/clientCommands.js +117 -214
- package/lib-es/newops/clientCommands.js.map +1 -1
- package/lib-es/newops/merkelizedPsbt.js +25 -73
- package/lib-es/newops/merkelizedPsbt.js.map +1 -1
- package/lib-es/newops/merkle.js +36 -66
- package/lib-es/newops/merkle.js.map +1 -1
- package/lib-es/newops/merkleMap.js +8 -10
- package/lib-es/newops/merkleMap.js.map +1 -1
- package/lib-es/newops/policy.d.ts +1 -1
- package/lib-es/newops/policy.d.ts.map +1 -1
- package/lib-es/newops/policy.js +12 -14
- package/lib-es/newops/policy.js.map +1 -1
- package/lib-es/newops/psbtExtractor.js +7 -7
- package/lib-es/newops/psbtExtractor.js.map +1 -1
- package/lib-es/newops/psbtFinalizer.js +19 -19
- package/lib-es/newops/psbtFinalizer.js.map +1 -1
- package/lib-es/newops/psbtv2.d.ts +1 -1
- package/lib-es/newops/psbtv2.d.ts.map +1 -1
- package/lib-es/newops/psbtv2.js +225 -286
- package/lib-es/newops/psbtv2.js.map +1 -1
- package/lib-es/serializeTransaction.js +11 -13
- package/lib-es/serializeTransaction.js.map +1 -1
- package/lib-es/shouldUseTrustedInputForSegwit.js +1 -2
- package/lib-es/shouldUseTrustedInputForSegwit.js.map +1 -1
- package/lib-es/signMessage.js +44 -96
- package/lib-es/signMessage.js.map +1 -1
- package/lib-es/signP2SHTransaction.d.ts +1 -1
- package/lib-es/signP2SHTransaction.d.ts.map +1 -1
- package/lib-es/signP2SHTransaction.js +84 -180
- package/lib-es/signP2SHTransaction.js.map +1 -1
- package/lib-es/signTransaction.js +6 -7
- package/lib-es/signTransaction.js.map +1 -1
- package/lib-es/splitTransaction.js +46 -50
- package/lib-es/splitTransaction.js.map +1 -1
- package/lib-es/startUntrustedHashTransactionInput.js +62 -164
- package/lib-es/startUntrustedHashTransactionInput.js.map +1 -1
- package/lib-es/varint.js +9 -9
- package/lib-es/varint.js.map +1 -1
- package/package.json +5 -6
- package/src/Btc.ts +28 -5
package/lib/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
|
-
exports
|
|
6
|
-
|
|
7
|
-
exports
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const Btc_1 = __importDefault(require("./Btc"));
|
|
7
|
+
exports.default = Btc_1.default;
|
|
8
8
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;AAAA,gDAAwB;AACxB,kBAAe,aAAG,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { DefaultDescriptorTemplate } from "./policy";
|
|
3
3
|
import { PsbtV2 } from "./psbtv2";
|
|
4
|
-
export
|
|
4
|
+
export type SpendingCondition = {
|
|
5
5
|
scriptPubKey: Buffer;
|
|
6
6
|
redeemScript?: Buffer;
|
|
7
7
|
};
|
|
8
|
-
export
|
|
8
|
+
export type SpentOutput = {
|
|
9
9
|
cond: SpendingCondition;
|
|
10
10
|
amount: Buffer;
|
|
11
11
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accounttype.d.ts","sourceRoot":"","sources":["../../src/newops/accounttype.ts"],"names":[],"mappings":";AAYA,OAAO,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,
|
|
1
|
+
{"version":3,"file":"accounttype.d.ts","sourceRoot":"","sources":["../../src/newops/accounttype.ts"],"names":[],"mappings":";AAYA,OAAO,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,MAAM,MAAM,iBAAiB,GAAG;IAC9B,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;CAIvB,CAAC;AAEF,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AQG;IACH,mBAAmB,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM;CAqBpD;AAED,qBAAa,aAAc,SAAQ,gBAAgB;IACjD,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,iBAAiB;IAUrD,iBAAiB,CACf,CAAC,EAAE,MAAM,EACT,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,WAAW,EAAE,WAAW,EACxB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EAAE;IA4BhB,kBAAkB,CAChB,CAAC,EAAE,MAAM,EACT,IAAI,EAAE,iBAAiB,EACvB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EAAE;IAMhB,qBAAqB,IAAI,yBAAyB;IAIlD,OAAO,CAAC,kBAAkB;CAI3B;AAED,qBAAa,MAAO,SAAQ,gBAAgB;IAC1C,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,iBAAiB;IAQrD,iBAAiB,CACf,CAAC,EAAE,MAAM,EACT,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,WAAW,EAAE,WAAW,EACxB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EAAE;IAchB,kBAAkB,CAChB,CAAC,EAAE,MAAM,EACT,IAAI,EAAE,iBAAiB,EACvB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EAAE;IAKhB,qBAAqB,IAAI,yBAAyB;CAGnD"}
|
|
@@ -1,50 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
exports.__esModule = true;
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
3
|
exports.p2wpkh = exports.p2wpkhWrapped = exports.p2tr = exports.p2pkh = void 0;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
4
|
+
const bitcoinjs_lib_1 = require("bitcoinjs-lib");
|
|
5
|
+
const tiny_secp256k1_1 = require("tiny-secp256k1");
|
|
6
|
+
const buffertools_1 = require("../buffertools");
|
|
7
|
+
const constants_1 = require("../constants");
|
|
8
|
+
const hashPublicKey_1 = require("../hashPublicKey");
|
|
9
|
+
class BaseAccount {
|
|
10
|
+
constructor(psbt, masterFp) {
|
|
26
11
|
this.psbt = psbt;
|
|
27
12
|
this.masterFp = masterFp;
|
|
28
13
|
}
|
|
29
|
-
|
|
30
|
-
}());
|
|
14
|
+
}
|
|
31
15
|
/**
|
|
32
16
|
* Superclass for single signature accounts. This will make sure that the pubkey
|
|
33
17
|
* arrays and path arrays in the method arguments contains exactly one element
|
|
34
18
|
* and calls an abstract method to do the actual work.
|
|
35
19
|
*/
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
function SingleKeyAccount() {
|
|
39
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
40
|
-
}
|
|
41
|
-
SingleKeyAccount.prototype.spendingCondition = function (pubkeys) {
|
|
20
|
+
class SingleKeyAccount extends BaseAccount {
|
|
21
|
+
spendingCondition(pubkeys) {
|
|
42
22
|
if (pubkeys.length != 1) {
|
|
43
23
|
throw new Error("Expected single key, got " + pubkeys.length);
|
|
44
24
|
}
|
|
45
25
|
return this.singleKeyCondition(pubkeys[0]);
|
|
46
|
-
}
|
|
47
|
-
|
|
26
|
+
}
|
|
27
|
+
setInput(i, inputTx, spentOutput, pubkeys, pathElems) {
|
|
48
28
|
if (pubkeys.length != 1) {
|
|
49
29
|
throw new Error("Expected single key, got " + pubkeys.length);
|
|
50
30
|
}
|
|
@@ -52,8 +32,8 @@ var SingleKeyAccount = /** @class */ (function (_super) {
|
|
|
52
32
|
throw new Error("Expected single path, got " + pathElems.length);
|
|
53
33
|
}
|
|
54
34
|
this.setSingleKeyInput(i, inputTx, spentOutput, pubkeys[0], pathElems[0]);
|
|
55
|
-
}
|
|
56
|
-
|
|
35
|
+
}
|
|
36
|
+
setOwnOutput(i, cond, pubkeys, paths) {
|
|
57
37
|
if (pubkeys.length != 1) {
|
|
58
38
|
throw new Error("Expected single key, got " + pubkeys.length);
|
|
59
39
|
}
|
|
@@ -61,73 +41,63 @@ var SingleKeyAccount = /** @class */ (function (_super) {
|
|
|
61
41
|
throw new Error("Expected single path, got " + paths.length);
|
|
62
42
|
}
|
|
63
43
|
this.setSingleKeyOutput(i, cond, pubkeys[0], paths[0]);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
71
|
-
}
|
|
72
|
-
p2pkh.prototype.singleKeyCondition = function (pubkey) {
|
|
73
|
-
var buf = new buffertools_1.BufferWriter();
|
|
74
|
-
var pubkeyHash = (0, hashPublicKey_1.hashPublicKey)(pubkey);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
class p2pkh extends SingleKeyAccount {
|
|
47
|
+
singleKeyCondition(pubkey) {
|
|
48
|
+
const buf = new buffertools_1.BufferWriter();
|
|
49
|
+
const pubkeyHash = (0, hashPublicKey_1.hashPublicKey)(pubkey);
|
|
75
50
|
buf.writeSlice(Buffer.from([constants_1.OP_DUP, constants_1.OP_HASH160, constants_1.HASH_SIZE]));
|
|
76
51
|
buf.writeSlice(pubkeyHash);
|
|
77
52
|
buf.writeSlice(Buffer.from([constants_1.OP_EQUALVERIFY, constants_1.OP_CHECKSIG]));
|
|
78
53
|
return { scriptPubKey: buf.buffer() };
|
|
79
|
-
}
|
|
80
|
-
|
|
54
|
+
}
|
|
55
|
+
setSingleKeyInput(i, inputTx, _spentOutput, pubkey, path) {
|
|
81
56
|
if (!inputTx) {
|
|
82
57
|
throw new Error("Full input base transaction required");
|
|
83
58
|
}
|
|
84
59
|
this.psbt.setInputNonWitnessUtxo(i, inputTx);
|
|
85
60
|
this.psbt.setInputBip32Derivation(i, pubkey, this.masterFp, path);
|
|
86
|
-
}
|
|
87
|
-
|
|
61
|
+
}
|
|
62
|
+
setSingleKeyOutput(i, cond, pubkey, path) {
|
|
88
63
|
this.psbt.setOutputBip32Derivation(i, pubkey, this.masterFp, path);
|
|
89
|
-
}
|
|
90
|
-
|
|
64
|
+
}
|
|
65
|
+
getDescriptorTemplate() {
|
|
91
66
|
return "pkh(@0)";
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
}(SingleKeyAccount));
|
|
67
|
+
}
|
|
68
|
+
}
|
|
95
69
|
exports.p2pkh = p2pkh;
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
p2tr.prototype.singleKeyCondition = function (pubkey) {
|
|
102
|
-
var xonlyPubkey = pubkey.slice(1); // x-only pubkey
|
|
103
|
-
var buf = new buffertools_1.BufferWriter();
|
|
104
|
-
var outputKey = this.getTaprootOutputKey(xonlyPubkey);
|
|
70
|
+
class p2tr extends SingleKeyAccount {
|
|
71
|
+
singleKeyCondition(pubkey) {
|
|
72
|
+
const xonlyPubkey = pubkey.slice(1); // x-only pubkey
|
|
73
|
+
const buf = new buffertools_1.BufferWriter();
|
|
74
|
+
const outputKey = this.getTaprootOutputKey(xonlyPubkey);
|
|
105
75
|
buf.writeSlice(Buffer.from([0x51, 32])); // push1, pubkeylen
|
|
106
76
|
buf.writeSlice(outputKey);
|
|
107
77
|
return { scriptPubKey: buf.buffer() };
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
|
|
78
|
+
}
|
|
79
|
+
setSingleKeyInput(i, _inputTx, spentOutput, pubkey, path) {
|
|
80
|
+
const xonly = pubkey.slice(1);
|
|
111
81
|
this.psbt.setInputTapBip32Derivation(i, xonly, [], this.masterFp, path);
|
|
112
82
|
this.psbt.setInputWitnessUtxo(i, spentOutput.amount, spentOutput.cond.scriptPubKey);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
|
|
83
|
+
}
|
|
84
|
+
setSingleKeyOutput(i, cond, pubkey, path) {
|
|
85
|
+
const xonly = pubkey.slice(1);
|
|
116
86
|
this.psbt.setOutputTapBip32Derivation(i, xonly, [], this.masterFp, path);
|
|
117
|
-
}
|
|
118
|
-
|
|
87
|
+
}
|
|
88
|
+
getDescriptorTemplate() {
|
|
119
89
|
return "tr(@0)";
|
|
120
|
-
}
|
|
90
|
+
}
|
|
121
91
|
/*
|
|
122
92
|
The following two functions are copied from wallet-btc and adapted.
|
|
123
93
|
They should be moved to a library to avoid code reuse.
|
|
124
94
|
*/
|
|
125
|
-
|
|
95
|
+
hashTapTweak(x) {
|
|
126
96
|
// hash_tag(x) = SHA256(SHA256(tag) || SHA256(tag) || x), see BIP340
|
|
127
97
|
// See https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki#specification
|
|
128
|
-
|
|
98
|
+
const h = bitcoinjs_lib_1.crypto.sha256(Buffer.from("TapTweak", "utf-8"));
|
|
129
99
|
return bitcoinjs_lib_1.crypto.sha256(Buffer.concat([h, h, x]));
|
|
130
|
-
}
|
|
100
|
+
}
|
|
131
101
|
/**
|
|
132
102
|
* Calculates a taproot output key from an internal key. This output key will be
|
|
133
103
|
* used as witness program in a taproot output. The internal key is tweaked
|
|
@@ -137,7 +107,7 @@ var p2tr = /** @class */ (function (_super) {
|
|
|
137
107
|
* @param internalPubkey A 32 byte x-only taproot internal key
|
|
138
108
|
* @returns The output key
|
|
139
109
|
*/
|
|
140
|
-
|
|
110
|
+
getTaprootOutputKey(internalPubkey) {
|
|
141
111
|
if (internalPubkey.length != 32) {
|
|
142
112
|
throw new Error("Expected 32 byte pubkey. Got " + internalPubkey.length);
|
|
143
113
|
}
|
|
@@ -145,92 +115,82 @@ var p2tr = /** @class */ (function (_super) {
|
|
|
145
115
|
// the first byte, which represent the oddness/evenness. In schnorr all
|
|
146
116
|
// pubkeys are even.
|
|
147
117
|
// https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki#public-key-conversion
|
|
148
|
-
|
|
118
|
+
const evenEcdsaPubkey = Buffer.concat([
|
|
149
119
|
Buffer.from([0x02]),
|
|
150
120
|
internalPubkey,
|
|
151
121
|
]);
|
|
152
|
-
|
|
122
|
+
const tweak = this.hashTapTweak(internalPubkey);
|
|
153
123
|
// Q = P + int(hash_TapTweak(bytes(P)))G
|
|
154
|
-
|
|
124
|
+
const outputEcdsaKey = Buffer.from((0, tiny_secp256k1_1.pointAddScalar)(evenEcdsaPubkey, tweak));
|
|
155
125
|
// Convert to schnorr.
|
|
156
|
-
|
|
126
|
+
const outputSchnorrKey = outputEcdsaKey.slice(1);
|
|
157
127
|
// Create address
|
|
158
128
|
return outputSchnorrKey;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
}(SingleKeyAccount));
|
|
129
|
+
}
|
|
130
|
+
}
|
|
162
131
|
exports.p2tr = p2tr;
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
p2wpkhWrapped.prototype.singleKeyCondition = function (pubkey) {
|
|
169
|
-
var buf = new buffertools_1.BufferWriter();
|
|
170
|
-
var redeemScript = this.createRedeemScript(pubkey);
|
|
171
|
-
var scriptHash = (0, hashPublicKey_1.hashPublicKey)(redeemScript);
|
|
132
|
+
class p2wpkhWrapped extends SingleKeyAccount {
|
|
133
|
+
singleKeyCondition(pubkey) {
|
|
134
|
+
const buf = new buffertools_1.BufferWriter();
|
|
135
|
+
const redeemScript = this.createRedeemScript(pubkey);
|
|
136
|
+
const scriptHash = (0, hashPublicKey_1.hashPublicKey)(redeemScript);
|
|
172
137
|
buf.writeSlice(Buffer.from([constants_1.OP_HASH160, constants_1.HASH_SIZE]));
|
|
173
138
|
buf.writeSlice(scriptHash);
|
|
174
139
|
buf.writeUInt8(constants_1.OP_EQUAL);
|
|
175
140
|
return { scriptPubKey: buf.buffer(), redeemScript: redeemScript };
|
|
176
|
-
}
|
|
177
|
-
|
|
141
|
+
}
|
|
142
|
+
setSingleKeyInput(i, inputTx, spentOutput, pubkey, path) {
|
|
178
143
|
if (!inputTx) {
|
|
179
144
|
throw new Error("Full input base transaction required");
|
|
180
145
|
}
|
|
181
146
|
this.psbt.setInputNonWitnessUtxo(i, inputTx);
|
|
182
147
|
this.psbt.setInputBip32Derivation(i, pubkey, this.masterFp, path);
|
|
183
|
-
|
|
184
|
-
|
|
148
|
+
const userSuppliedRedeemScript = spentOutput.cond.redeemScript;
|
|
149
|
+
const expectedRedeemScript = this.createRedeemScript(pubkey);
|
|
185
150
|
if (userSuppliedRedeemScript &&
|
|
186
151
|
!expectedRedeemScript.equals(userSuppliedRedeemScript)) {
|
|
187
152
|
// At what point might a user set the redeemScript on its own?
|
|
188
|
-
throw new Error(
|
|
153
|
+
throw new Error(`User-supplied redeemScript ${userSuppliedRedeemScript.toString("hex")} doesn't
|
|
154
|
+
match expected ${expectedRedeemScript.toString("hex")} for input ${i}`);
|
|
189
155
|
}
|
|
190
156
|
this.psbt.setInputRedeemScript(i, expectedRedeemScript);
|
|
191
157
|
this.psbt.setInputWitnessUtxo(i, spentOutput.amount, spentOutput.cond.scriptPubKey);
|
|
192
|
-
}
|
|
193
|
-
|
|
158
|
+
}
|
|
159
|
+
setSingleKeyOutput(i, cond, pubkey, path) {
|
|
194
160
|
this.psbt.setOutputRedeemScript(i, cond.redeemScript);
|
|
195
161
|
this.psbt.setOutputBip32Derivation(i, pubkey, this.masterFp, path);
|
|
196
|
-
}
|
|
197
|
-
|
|
162
|
+
}
|
|
163
|
+
getDescriptorTemplate() {
|
|
198
164
|
return "sh(wpkh(@0))";
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
|
|
165
|
+
}
|
|
166
|
+
createRedeemScript(pubkey) {
|
|
167
|
+
const pubkeyHash = (0, hashPublicKey_1.hashPublicKey)(pubkey);
|
|
202
168
|
return Buffer.concat([Buffer.from("0014", "hex"), pubkeyHash]);
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
}(SingleKeyAccount));
|
|
169
|
+
}
|
|
170
|
+
}
|
|
206
171
|
exports.p2wpkhWrapped = p2wpkhWrapped;
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
}
|
|
212
|
-
p2wpkh.prototype.singleKeyCondition = function (pubkey) {
|
|
213
|
-
var buf = new buffertools_1.BufferWriter();
|
|
214
|
-
var pubkeyHash = (0, hashPublicKey_1.hashPublicKey)(pubkey);
|
|
172
|
+
class p2wpkh extends SingleKeyAccount {
|
|
173
|
+
singleKeyCondition(pubkey) {
|
|
174
|
+
const buf = new buffertools_1.BufferWriter();
|
|
175
|
+
const pubkeyHash = (0, hashPublicKey_1.hashPublicKey)(pubkey);
|
|
215
176
|
buf.writeSlice(Buffer.from([0, constants_1.HASH_SIZE]));
|
|
216
177
|
buf.writeSlice(pubkeyHash);
|
|
217
178
|
return { scriptPubKey: buf.buffer() };
|
|
218
|
-
}
|
|
219
|
-
|
|
179
|
+
}
|
|
180
|
+
setSingleKeyInput(i, inputTx, spentOutput, pubkey, path) {
|
|
220
181
|
if (!inputTx) {
|
|
221
182
|
throw new Error("Full input base transaction required");
|
|
222
183
|
}
|
|
223
184
|
this.psbt.setInputNonWitnessUtxo(i, inputTx);
|
|
224
185
|
this.psbt.setInputBip32Derivation(i, pubkey, this.masterFp, path);
|
|
225
186
|
this.psbt.setInputWitnessUtxo(i, spentOutput.amount, spentOutput.cond.scriptPubKey);
|
|
226
|
-
}
|
|
227
|
-
|
|
187
|
+
}
|
|
188
|
+
setSingleKeyOutput(i, cond, pubkey, path) {
|
|
228
189
|
this.psbt.setOutputBip32Derivation(i, pubkey, this.masterFp, path);
|
|
229
|
-
}
|
|
230
|
-
|
|
190
|
+
}
|
|
191
|
+
getDescriptorTemplate() {
|
|
231
192
|
return "wpkh(@0)";
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
}(SingleKeyAccount));
|
|
193
|
+
}
|
|
194
|
+
}
|
|
235
195
|
exports.p2wpkh = p2wpkh;
|
|
236
196
|
//# sourceMappingURL=accounttype.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accounttype.js","sourceRoot":"","sources":["../../src/newops/accounttype.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"accounttype.js","sourceRoot":"","sources":["../../src/newops/accounttype.ts"],"names":[],"mappings":";;;AAAA,iDAAuC;AACvC,mDAAgD;AAChD,gDAA8C;AAC9C,4CAOsB;AACtB,oDAAiD;AAyEjD,MAAe,WAAW;IACxB,YAAsB,IAAY,EAAY,QAAgB;QAAxC,SAAI,GAAJ,IAAI,CAAQ;QAAY,aAAQ,GAAR,QAAQ,CAAQ;IAAG,CAAC;CACnE;AAED;;;;GAIG;AACH,MAAe,gBAAiB,SAAQ,WAAW;IACjD,iBAAiB,CAAC,OAAiB;QACjC,IAAI,OAAO,CAAC,MAAM,IAAI,CAAC,EAAE;YACvB,MAAM,IAAI,KAAK,CAAC,2BAA2B,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;SAC/D;QACD,OAAO,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7C,CAAC;IAGD,QAAQ,CACN,CAAS,EACT,OAA2B,EAC3B,WAAwB,EACxB,OAAiB,EACjB,SAAqB;QAErB,IAAI,OAAO,CAAC,MAAM,IAAI,CAAC,EAAE;YACv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