@bitgo/wasm-utxo 5.5.0 → 5.5.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/dist/cjs/js/fixedScriptWallet/ZcashIronwoodBitGoPsbt.d.ts +16 -9
- package/dist/cjs/js/fixedScriptWallet/ZcashIronwoodBitGoPsbt.js +14 -8
- package/dist/cjs/js/wasm/wasm_utxo.d.ts +9 -5
- package/dist/cjs/js/wasm/wasm_utxo.js +9 -5
- package/dist/cjs/js/wasm/wasm_utxo_bg.wasm +0 -0
- package/dist/cjs/js/wasm/wasm_utxo_bg.wasm.d.ts +3 -3
- package/dist/esm/js/fixedScriptWallet/ZcashIronwoodBitGoPsbt.d.ts +16 -9
- package/dist/esm/js/fixedScriptWallet/ZcashIronwoodBitGoPsbt.js +14 -8
- package/dist/esm/js/wasm/wasm_utxo.d.ts +9 -5
- package/dist/esm/js/wasm/wasm_utxo_bg.js +9 -5
- package/dist/esm/js/wasm/wasm_utxo_bg.wasm +0 -0
- package/dist/esm/js/wasm/wasm_utxo_bg.wasm.d.ts +3 -3
- package/package.json +1 -1
|
@@ -135,7 +135,9 @@ export declare class ZcashIronwoodBitGoPsbt extends ZcashBitGoPsbt {
|
|
|
135
135
|
* @param amount - note value in zatoshi
|
|
136
136
|
* @param options.anchor - 32-byte Ironwood note-commitment-tree root
|
|
137
137
|
* @param options.memo - optional 512-byte memo (defaults to the ZIP-302 "no memo" encoding)
|
|
138
|
-
* @param options.ovk - optional 32-byte outgoing viewing key (omit for a keyless build)
|
|
138
|
+
* @param options.ovk - optional 32-byte outgoing viewing key (omit for a keyless build). Has no
|
|
139
|
+
* effect in the normal flow: {@link sign}'s first round re-encrypts every action's
|
|
140
|
+
* `out_ciphertext` under the wallet `ovk`, replacing whatever this produced
|
|
139
141
|
* @param options.unifiedAddress - optional full Unified Address string this output was addressed
|
|
140
142
|
* to. Its Orchard receiver must equal `recipient`. The PCZT itself only carries the raw 43-byte
|
|
141
143
|
* receiver — a lossy encoding for a multi-receiver UA, since any transparent/Sapling receiver
|
|
@@ -156,12 +158,14 @@ export declare class ZcashIronwoodBitGoPsbt extends ZcashBitGoPsbt {
|
|
|
156
158
|
* {@link addShieldedOutput}).
|
|
157
159
|
*
|
|
158
160
|
* @param outputs - one entry per recipient; `memo` defaults per-entry to the ZIP-302 "no memo"
|
|
159
|
-
* encoding, exactly as {@link addShieldedOutput}'s does
|
|
161
|
+
* encoding, exactly as {@link addShieldedOutput}'s does, and `ovk` is likewise replaced by
|
|
162
|
+
* {@link sign}'s first round
|
|
160
163
|
* @param anchor - 32-byte Ironwood note-commitment-tree root, shared by every output
|
|
161
164
|
* @returns the action index assigned to each output, in the same order as `outputs` — the
|
|
162
|
-
* orchard builder pads/reorders actions, so
|
|
163
|
-
*
|
|
164
|
-
* `
|
|
165
|
+
* orchard builder pads/reorders actions, so any caller correlating per-action data (a stored
|
|
166
|
+
* unified address, an explicit `setShieldedOutCiphertext` call) must use these indices, not the
|
|
167
|
+
* position in `outputs` — though note {@link sign}'s first round already patches every action's
|
|
168
|
+
* `out_ciphertext` with the wallet `ovk` on its own.
|
|
165
169
|
*/
|
|
166
170
|
addShieldedOutputs(outputs: Array<{
|
|
167
171
|
recipient: Uint8Array;
|
|
@@ -181,14 +185,16 @@ export declare class ZcashIronwoodBitGoPsbt extends ZcashBitGoPsbt {
|
|
|
181
185
|
* `ovk` derived from those is one neither the user nor the server can reproduce, and the resulting
|
|
182
186
|
* transaction would broadcast fine while leaving the shielded output permanently unrecoverable.
|
|
183
187
|
*
|
|
184
|
-
* Normally you do not call this directly: {@link sign} performs it
|
|
188
|
+
* Normally you do not call this directly: {@link sign} performs it for **every** action on the
|
|
189
|
+
* first signing round (idempotently — same `ovk`, same bytes).
|
|
185
190
|
*
|
|
186
191
|
* Must be called **before** signing: `out_ciphertext` is committed by the ZIP-244 sighash, so
|
|
187
192
|
* calling this after any transparent signature has been added (via
|
|
188
193
|
* {@link addTransparentSignature}) throws rather than silently invalidating that signature.
|
|
189
194
|
*
|
|
190
|
-
* @param actionIndex - index of the Ironwood action whose output to re-encrypt
|
|
191
|
-
*
|
|
195
|
+
* @param actionIndex - index of the Ironwood action whose output to re-encrypt; use an index
|
|
196
|
+
* returned by {@link addShieldedOutputs} (the orchard builder may reorder actions, so it is not
|
|
197
|
+
* necessarily the output's position in the call)
|
|
192
198
|
* @param userKey - the wallet's user root key (an xpriv)
|
|
193
199
|
* @param rootWalletKeys - the wallet's root keys, supplying the BitGo cosigner pubkey
|
|
194
200
|
*/
|
|
@@ -220,7 +226,8 @@ export declare class ZcashIronwoodBitGoPsbt extends ZcashBitGoPsbt {
|
|
|
220
226
|
*
|
|
221
227
|
* If no transparent signature has been added to this PSBT yet, this is the first signing round and
|
|
222
228
|
* `key` must be the wallet's user root key: it is used with `rootWalletKeys.bitgoKey()` to derive
|
|
223
|
-
* this wallet's `ovk` and finalize `out_ciphertext` — the client-managed-`ovk`
|
|
229
|
+
* this wallet's `ovk` and finalize **every** action's `out_ciphertext` — the client-managed-`ovk`
|
|
230
|
+
* flow, multi-recipient builds included — before any
|
|
224
231
|
* sighash is computed. Once a signature exists, that step is a no-op, so a caller passes
|
|
225
232
|
* `rootWalletKeys` on every signing round unconditionally: `psbt.sign(userXpriv, rootWalletKeys)`
|
|
226
233
|
* and later `psbt.sign(bitgoXpriv, rootWalletKeys)` — only the first call actually uses it.
|
|
@@ -136,7 +136,9 @@ class ZcashIronwoodBitGoPsbt extends ZcashBitGoPsbt_js_1.ZcashBitGoPsbt {
|
|
|
136
136
|
* @param amount - note value in zatoshi
|
|
137
137
|
* @param options.anchor - 32-byte Ironwood note-commitment-tree root
|
|
138
138
|
* @param options.memo - optional 512-byte memo (defaults to the ZIP-302 "no memo" encoding)
|
|
139
|
-
* @param options.ovk - optional 32-byte outgoing viewing key (omit for a keyless build)
|
|
139
|
+
* @param options.ovk - optional 32-byte outgoing viewing key (omit for a keyless build). Has no
|
|
140
|
+
* effect in the normal flow: {@link sign}'s first round re-encrypts every action's
|
|
141
|
+
* `out_ciphertext` under the wallet `ovk`, replacing whatever this produced
|
|
140
142
|
* @param options.unifiedAddress - optional full Unified Address string this output was addressed
|
|
141
143
|
* to. Its Orchard receiver must equal `recipient`. The PCZT itself only carries the raw 43-byte
|
|
142
144
|
* receiver — a lossy encoding for a multi-receiver UA, since any transparent/Sapling receiver
|
|
@@ -155,12 +157,14 @@ class ZcashIronwoodBitGoPsbt extends ZcashBitGoPsbt_js_1.ZcashBitGoPsbt {
|
|
|
155
157
|
* {@link addShieldedOutput}).
|
|
156
158
|
*
|
|
157
159
|
* @param outputs - one entry per recipient; `memo` defaults per-entry to the ZIP-302 "no memo"
|
|
158
|
-
* encoding, exactly as {@link addShieldedOutput}'s does
|
|
160
|
+
* encoding, exactly as {@link addShieldedOutput}'s does, and `ovk` is likewise replaced by
|
|
161
|
+
* {@link sign}'s first round
|
|
159
162
|
* @param anchor - 32-byte Ironwood note-commitment-tree root, shared by every output
|
|
160
163
|
* @returns the action index assigned to each output, in the same order as `outputs` — the
|
|
161
|
-
* orchard builder pads/reorders actions, so
|
|
162
|
-
*
|
|
163
|
-
* `
|
|
164
|
+
* orchard builder pads/reorders actions, so any caller correlating per-action data (a stored
|
|
165
|
+
* unified address, an explicit `setShieldedOutCiphertext` call) must use these indices, not the
|
|
166
|
+
* position in `outputs` — though note {@link sign}'s first round already patches every action's
|
|
167
|
+
* `out_ciphertext` with the wallet `ovk` on its own.
|
|
164
168
|
*/
|
|
165
169
|
addShieldedOutputs(outputs, anchor) {
|
|
166
170
|
return Array.from(this.wasm.add_ironwood_outputs(outputs.map((o) => ({
|
|
@@ -182,14 +186,16 @@ class ZcashIronwoodBitGoPsbt extends ZcashBitGoPsbt_js_1.ZcashBitGoPsbt {
|
|
|
182
186
|
* `ovk` derived from those is one neither the user nor the server can reproduce, and the resulting
|
|
183
187
|
* transaction would broadcast fine while leaving the shielded output permanently unrecoverable.
|
|
184
188
|
*
|
|
185
|
-
* Normally you do not call this directly: {@link sign} performs it
|
|
189
|
+
* Normally you do not call this directly: {@link sign} performs it for **every** action on the
|
|
190
|
+
* first signing round (idempotently — same `ovk`, same bytes).
|
|
186
191
|
*
|
|
187
192
|
* Must be called **before** signing: `out_ciphertext` is committed by the ZIP-244 sighash, so
|
|
188
193
|
* calling this after any transparent signature has been added (via
|
|
189
194
|
* {@link addTransparentSignature}) throws rather than silently invalidating that signature.
|
|
190
195
|
*
|
|
191
|
-
* @param actionIndex - index of the Ironwood action whose output to re-encrypt
|
|
192
|
-
*
|
|
196
|
+
* @param actionIndex - index of the Ironwood action whose output to re-encrypt; use an index
|
|
197
|
+
* returned by {@link addShieldedOutputs} (the orchard builder may reorder actions, so it is not
|
|
198
|
+
* necessarily the output's position in the call)
|
|
193
199
|
* @param userKey - the wallet's user root key (an xpriv)
|
|
194
200
|
* @param rootWalletKeys - the wallet's root keys, supplying the BitGo cosigner pubkey
|
|
195
201
|
*/
|
|
@@ -144,7 +144,9 @@ export class BitGoPsbt {
|
|
|
144
144
|
*
|
|
145
145
|
* * `recipient` - raw Orchard/Ironwood address ([`ORCHARD_ADDRESS_SIZE`] bytes)
|
|
146
146
|
* * `amount` - note value in zatoshi
|
|
147
|
-
* * `ovk` - optional outgoing viewing key ([`OVK_SIZE`] bytes; `None` for a keyless build)
|
|
147
|
+
* * `ovk` - optional outgoing viewing key ([`OVK_SIZE`] bytes; `None` for a keyless build).
|
|
148
|
+
* Has no effect in the normal flow: `sign_ironwood_v6`'s first round re-encrypts every
|
|
149
|
+
* action's `out_ciphertext` under the wallet `ovk`, replacing whatever this produced
|
|
148
150
|
* * `anchor` - Ironwood note-commitment-tree root ([`ANCHOR_SIZE`] bytes)
|
|
149
151
|
* * `memo` - ZIP-302 memo field ([`MEMO_SIZE`] bytes)
|
|
150
152
|
* * `unified_address` - optional full Unified Address the output was addressed to; if given,
|
|
@@ -168,9 +170,10 @@ export class BitGoPsbt {
|
|
|
168
170
|
* output.
|
|
169
171
|
*
|
|
170
172
|
* Returns the action index assigned to each output, in the same order as `outputs` — the
|
|
171
|
-
* orchard builder pads/reorders actions, so a
|
|
172
|
-
*
|
|
173
|
-
*
|
|
173
|
+
* orchard builder pads/reorders actions, so a caller correlating per-action data (a stored
|
|
174
|
+
* Unified Address, an explicit `set_ironwood_out_ciphertext` call) must use these indices, not
|
|
175
|
+
* the position in `outputs` — though note `sign_ironwood_v6`'s first round already patches
|
|
176
|
+
* every action's `out_ciphertext` with the wallet `ovk` on its own.
|
|
174
177
|
*/
|
|
175
178
|
add_ironwood_outputs(outputs: any, anchor: Uint8Array): Uint32Array;
|
|
176
179
|
/**
|
|
@@ -665,7 +668,8 @@ export class BitGoPsbt {
|
|
|
665
668
|
*
|
|
666
669
|
* If no transparent signature has been collected yet, this is the first signing round and
|
|
667
670
|
* `xpriv` must be the wallet's user root key: it is used with `root_wallet_keys.bitgo_key()` to
|
|
668
|
-
* derive this wallet's `ovk` and finalize `out_ciphertext`
|
|
671
|
+
* derive this wallet's `ovk` and finalize every action's `out_ciphertext` (multi-recipient
|
|
672
|
+
* builds included) before computing any sighash (it is
|
|
669
673
|
* sighash-committed). Any other key signing first is rejected, rather than deriving an `ovk`
|
|
670
674
|
* nobody can reproduce. Once a signature exists, the step is skipped and any key may sign — so
|
|
671
675
|
* callers pass `root_wallet_keys` unconditionally on every signing round without needing to know
|
|
@@ -475,7 +475,9 @@ class BitGoPsbt {
|
|
|
475
475
|
*
|
|
476
476
|
* * `recipient` - raw Orchard/Ironwood address ([`ORCHARD_ADDRESS_SIZE`] bytes)
|
|
477
477
|
* * `amount` - note value in zatoshi
|
|
478
|
-
* * `ovk` - optional outgoing viewing key ([`OVK_SIZE`] bytes; `None` for a keyless build)
|
|
478
|
+
* * `ovk` - optional outgoing viewing key ([`OVK_SIZE`] bytes; `None` for a keyless build).
|
|
479
|
+
* Has no effect in the normal flow: `sign_ironwood_v6`'s first round re-encrypts every
|
|
480
|
+
* action's `out_ciphertext` under the wallet `ovk`, replacing whatever this produced
|
|
479
481
|
* * `anchor` - Ironwood note-commitment-tree root ([`ANCHOR_SIZE`] bytes)
|
|
480
482
|
* * `memo` - ZIP-302 memo field ([`MEMO_SIZE`] bytes)
|
|
481
483
|
* * `unified_address` - optional full Unified Address the output was addressed to; if given,
|
|
@@ -527,9 +529,10 @@ class BitGoPsbt {
|
|
|
527
529
|
* output.
|
|
528
530
|
*
|
|
529
531
|
* Returns the action index assigned to each output, in the same order as `outputs` — the
|
|
530
|
-
* orchard builder pads/reorders actions, so a
|
|
531
|
-
*
|
|
532
|
-
*
|
|
532
|
+
* orchard builder pads/reorders actions, so a caller correlating per-action data (a stored
|
|
533
|
+
* Unified Address, an explicit `set_ironwood_out_ciphertext` call) must use these indices, not
|
|
534
|
+
* the position in `outputs` — though note `sign_ironwood_v6`'s first round already patches
|
|
535
|
+
* every action's `out_ciphertext` with the wallet `ovk` on its own.
|
|
533
536
|
* @param {any} outputs
|
|
534
537
|
* @param {Uint8Array} anchor
|
|
535
538
|
* @returns {Uint32Array}
|
|
@@ -2369,7 +2372,8 @@ class BitGoPsbt {
|
|
|
2369
2372
|
*
|
|
2370
2373
|
* If no transparent signature has been collected yet, this is the first signing round and
|
|
2371
2374
|
* `xpriv` must be the wallet's user root key: it is used with `root_wallet_keys.bitgo_key()` to
|
|
2372
|
-
* derive this wallet's `ovk` and finalize `out_ciphertext`
|
|
2375
|
+
* derive this wallet's `ovk` and finalize every action's `out_ciphertext` (multi-recipient
|
|
2376
|
+
* builds included) before computing any sighash (it is
|
|
2373
2377
|
* sighash-committed). Any other key signing first is rejected, rather than deriving an `ovk`
|
|
2374
2378
|
* nobody can reproduce. Once a signature exists, the step is skipped and any key may sign — so
|
|
2375
2379
|
* callers pass `root_wallet_keys` unconditionally on every signing round without needing to know
|
|
Binary file
|
|
@@ -158,6 +158,8 @@ export const wasmbip32_from_bip32_properties: (a: number, b: number) => void;
|
|
|
158
158
|
export const bitgopsbt_sign_replay_protection_inputs: (a: number, b: number, c: number) => void;
|
|
159
159
|
export const bitgopsbt_sign_wallet_input: (a: number, b: number, c: number, d: number) => void;
|
|
160
160
|
export const bitgopsbt_sign_all_with_xpriv: (a: number, b: number, c: number) => void;
|
|
161
|
+
export const __wbg_wasmutxonamespace_free: (a: number, b: number) => void;
|
|
162
|
+
export const wasmutxonamespace_get_wasm_utxo_version: (a: number) => void;
|
|
161
163
|
export const __wbg_addressnamespace_free: (a: number, b: number) => void;
|
|
162
164
|
export const __wbg_bip322namespace_free: (a: number, b: number) => void;
|
|
163
165
|
export const __wbg_inscriptionsnamespace_free: (a: number, b: number) => void;
|
|
@@ -306,11 +308,8 @@ export const wasmzcashtransaction_lock_time: (a: number) => number;
|
|
|
306
308
|
export const wasmzcashtransaction_version: (a: number) => number;
|
|
307
309
|
export const wrappsbt_lock_time: (a: number) => number;
|
|
308
310
|
export const wrappsbt_version: (a: number) => number;
|
|
309
|
-
export const __wbg_wasmutxonamespace_free: (a: number, b: number) => void;
|
|
310
|
-
export const wasmutxonamespace_get_wasm_utxo_version: (a: number) => void;
|
|
311
311
|
export const __wbg_wrapdescriptor_free: (a: number, b: number) => void;
|
|
312
312
|
export const __wbg_wrapminiscript_free: (a: number, b: number) => void;
|
|
313
|
-
export const isInspectEnabled: () => number;
|
|
314
313
|
export const parsePsbtRawToJson: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
315
314
|
export const wrapdescriptor_atDerivationIndex: (a: number, b: number, c: number) => void;
|
|
316
315
|
export const wrapdescriptor_descType: (a: number, b: number) => void;
|
|
@@ -332,6 +331,7 @@ export const wrapminiscript_fromStringExt: (a: number, b: number, c: number, d:
|
|
|
332
331
|
export const wrapminiscript_node: (a: number, b: number) => void;
|
|
333
332
|
export const wrapminiscript_toAsmString: (a: number, b: number) => void;
|
|
334
333
|
export const wrapminiscript_toString: (a: number, b: number) => void;
|
|
334
|
+
export const isInspectEnabled: () => number;
|
|
335
335
|
export const parsePsbtToJson: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
336
336
|
export const parseTxToJson: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
337
337
|
export const rustsecp256k1_v0_10_0_context_create: (a: number) => number;
|
|
@@ -135,7 +135,9 @@ export declare class ZcashIronwoodBitGoPsbt extends ZcashBitGoPsbt {
|
|
|
135
135
|
* @param amount - note value in zatoshi
|
|
136
136
|
* @param options.anchor - 32-byte Ironwood note-commitment-tree root
|
|
137
137
|
* @param options.memo - optional 512-byte memo (defaults to the ZIP-302 "no memo" encoding)
|
|
138
|
-
* @param options.ovk - optional 32-byte outgoing viewing key (omit for a keyless build)
|
|
138
|
+
* @param options.ovk - optional 32-byte outgoing viewing key (omit for a keyless build). Has no
|
|
139
|
+
* effect in the normal flow: {@link sign}'s first round re-encrypts every action's
|
|
140
|
+
* `out_ciphertext` under the wallet `ovk`, replacing whatever this produced
|
|
139
141
|
* @param options.unifiedAddress - optional full Unified Address string this output was addressed
|
|
140
142
|
* to. Its Orchard receiver must equal `recipient`. The PCZT itself only carries the raw 43-byte
|
|
141
143
|
* receiver — a lossy encoding for a multi-receiver UA, since any transparent/Sapling receiver
|
|
@@ -156,12 +158,14 @@ export declare class ZcashIronwoodBitGoPsbt extends ZcashBitGoPsbt {
|
|
|
156
158
|
* {@link addShieldedOutput}).
|
|
157
159
|
*
|
|
158
160
|
* @param outputs - one entry per recipient; `memo` defaults per-entry to the ZIP-302 "no memo"
|
|
159
|
-
* encoding, exactly as {@link addShieldedOutput}'s does
|
|
161
|
+
* encoding, exactly as {@link addShieldedOutput}'s does, and `ovk` is likewise replaced by
|
|
162
|
+
* {@link sign}'s first round
|
|
160
163
|
* @param anchor - 32-byte Ironwood note-commitment-tree root, shared by every output
|
|
161
164
|
* @returns the action index assigned to each output, in the same order as `outputs` — the
|
|
162
|
-
* orchard builder pads/reorders actions, so
|
|
163
|
-
*
|
|
164
|
-
* `
|
|
165
|
+
* orchard builder pads/reorders actions, so any caller correlating per-action data (a stored
|
|
166
|
+
* unified address, an explicit `setShieldedOutCiphertext` call) must use these indices, not the
|
|
167
|
+
* position in `outputs` — though note {@link sign}'s first round already patches every action's
|
|
168
|
+
* `out_ciphertext` with the wallet `ovk` on its own.
|
|
165
169
|
*/
|
|
166
170
|
addShieldedOutputs(outputs: Array<{
|
|
167
171
|
recipient: Uint8Array;
|
|
@@ -181,14 +185,16 @@ export declare class ZcashIronwoodBitGoPsbt extends ZcashBitGoPsbt {
|
|
|
181
185
|
* `ovk` derived from those is one neither the user nor the server can reproduce, and the resulting
|
|
182
186
|
* transaction would broadcast fine while leaving the shielded output permanently unrecoverable.
|
|
183
187
|
*
|
|
184
|
-
* Normally you do not call this directly: {@link sign} performs it
|
|
188
|
+
* Normally you do not call this directly: {@link sign} performs it for **every** action on the
|
|
189
|
+
* first signing round (idempotently — same `ovk`, same bytes).
|
|
185
190
|
*
|
|
186
191
|
* Must be called **before** signing: `out_ciphertext` is committed by the ZIP-244 sighash, so
|
|
187
192
|
* calling this after any transparent signature has been added (via
|
|
188
193
|
* {@link addTransparentSignature}) throws rather than silently invalidating that signature.
|
|
189
194
|
*
|
|
190
|
-
* @param actionIndex - index of the Ironwood action whose output to re-encrypt
|
|
191
|
-
*
|
|
195
|
+
* @param actionIndex - index of the Ironwood action whose output to re-encrypt; use an index
|
|
196
|
+
* returned by {@link addShieldedOutputs} (the orchard builder may reorder actions, so it is not
|
|
197
|
+
* necessarily the output's position in the call)
|
|
192
198
|
* @param userKey - the wallet's user root key (an xpriv)
|
|
193
199
|
* @param rootWalletKeys - the wallet's root keys, supplying the BitGo cosigner pubkey
|
|
194
200
|
*/
|
|
@@ -220,7 +226,8 @@ export declare class ZcashIronwoodBitGoPsbt extends ZcashBitGoPsbt {
|
|
|
220
226
|
*
|
|
221
227
|
* If no transparent signature has been added to this PSBT yet, this is the first signing round and
|
|
222
228
|
* `key` must be the wallet's user root key: it is used with `rootWalletKeys.bitgoKey()` to derive
|
|
223
|
-
* this wallet's `ovk` and finalize `out_ciphertext` — the client-managed-`ovk`
|
|
229
|
+
* this wallet's `ovk` and finalize **every** action's `out_ciphertext` — the client-managed-`ovk`
|
|
230
|
+
* flow, multi-recipient builds included — before any
|
|
224
231
|
* sighash is computed. Once a signature exists, that step is a no-op, so a caller passes
|
|
225
232
|
* `rootWalletKeys` on every signing round unconditionally: `psbt.sign(userXpriv, rootWalletKeys)`
|
|
226
233
|
* and later `psbt.sign(bitgoXpriv, rootWalletKeys)` — only the first call actually uses it.
|
|
@@ -132,7 +132,9 @@ export class ZcashIronwoodBitGoPsbt extends ZcashBitGoPsbt {
|
|
|
132
132
|
* @param amount - note value in zatoshi
|
|
133
133
|
* @param options.anchor - 32-byte Ironwood note-commitment-tree root
|
|
134
134
|
* @param options.memo - optional 512-byte memo (defaults to the ZIP-302 "no memo" encoding)
|
|
135
|
-
* @param options.ovk - optional 32-byte outgoing viewing key (omit for a keyless build)
|
|
135
|
+
* @param options.ovk - optional 32-byte outgoing viewing key (omit for a keyless build). Has no
|
|
136
|
+
* effect in the normal flow: {@link sign}'s first round re-encrypts every action's
|
|
137
|
+
* `out_ciphertext` under the wallet `ovk`, replacing whatever this produced
|
|
136
138
|
* @param options.unifiedAddress - optional full Unified Address string this output was addressed
|
|
137
139
|
* to. Its Orchard receiver must equal `recipient`. The PCZT itself only carries the raw 43-byte
|
|
138
140
|
* receiver — a lossy encoding for a multi-receiver UA, since any transparent/Sapling receiver
|
|
@@ -151,12 +153,14 @@ export class ZcashIronwoodBitGoPsbt extends ZcashBitGoPsbt {
|
|
|
151
153
|
* {@link addShieldedOutput}).
|
|
152
154
|
*
|
|
153
155
|
* @param outputs - one entry per recipient; `memo` defaults per-entry to the ZIP-302 "no memo"
|
|
154
|
-
* encoding, exactly as {@link addShieldedOutput}'s does
|
|
156
|
+
* encoding, exactly as {@link addShieldedOutput}'s does, and `ovk` is likewise replaced by
|
|
157
|
+
* {@link sign}'s first round
|
|
155
158
|
* @param anchor - 32-byte Ironwood note-commitment-tree root, shared by every output
|
|
156
159
|
* @returns the action index assigned to each output, in the same order as `outputs` — the
|
|
157
|
-
* orchard builder pads/reorders actions, so
|
|
158
|
-
*
|
|
159
|
-
* `
|
|
160
|
+
* orchard builder pads/reorders actions, so any caller correlating per-action data (a stored
|
|
161
|
+
* unified address, an explicit `setShieldedOutCiphertext` call) must use these indices, not the
|
|
162
|
+
* position in `outputs` — though note {@link sign}'s first round already patches every action's
|
|
163
|
+
* `out_ciphertext` with the wallet `ovk` on its own.
|
|
160
164
|
*/
|
|
161
165
|
addShieldedOutputs(outputs, anchor) {
|
|
162
166
|
return Array.from(this.wasm.add_ironwood_outputs(outputs.map((o) => ({
|
|
@@ -178,14 +182,16 @@ export class ZcashIronwoodBitGoPsbt extends ZcashBitGoPsbt {
|
|
|
178
182
|
* `ovk` derived from those is one neither the user nor the server can reproduce, and the resulting
|
|
179
183
|
* transaction would broadcast fine while leaving the shielded output permanently unrecoverable.
|
|
180
184
|
*
|
|
181
|
-
* Normally you do not call this directly: {@link sign} performs it
|
|
185
|
+
* Normally you do not call this directly: {@link sign} performs it for **every** action on the
|
|
186
|
+
* first signing round (idempotently — same `ovk`, same bytes).
|
|
182
187
|
*
|
|
183
188
|
* Must be called **before** signing: `out_ciphertext` is committed by the ZIP-244 sighash, so
|
|
184
189
|
* calling this after any transparent signature has been added (via
|
|
185
190
|
* {@link addTransparentSignature}) throws rather than silently invalidating that signature.
|
|
186
191
|
*
|
|
187
|
-
* @param actionIndex - index of the Ironwood action whose output to re-encrypt
|
|
188
|
-
*
|
|
192
|
+
* @param actionIndex - index of the Ironwood action whose output to re-encrypt; use an index
|
|
193
|
+
* returned by {@link addShieldedOutputs} (the orchard builder may reorder actions, so it is not
|
|
194
|
+
* necessarily the output's position in the call)
|
|
189
195
|
* @param userKey - the wallet's user root key (an xpriv)
|
|
190
196
|
* @param rootWalletKeys - the wallet's root keys, supplying the BitGo cosigner pubkey
|
|
191
197
|
*/
|
|
@@ -144,7 +144,9 @@ export class BitGoPsbt {
|
|
|
144
144
|
*
|
|
145
145
|
* * `recipient` - raw Orchard/Ironwood address ([`ORCHARD_ADDRESS_SIZE`] bytes)
|
|
146
146
|
* * `amount` - note value in zatoshi
|
|
147
|
-
* * `ovk` - optional outgoing viewing key ([`OVK_SIZE`] bytes; `None` for a keyless build)
|
|
147
|
+
* * `ovk` - optional outgoing viewing key ([`OVK_SIZE`] bytes; `None` for a keyless build).
|
|
148
|
+
* Has no effect in the normal flow: `sign_ironwood_v6`'s first round re-encrypts every
|
|
149
|
+
* action's `out_ciphertext` under the wallet `ovk`, replacing whatever this produced
|
|
148
150
|
* * `anchor` - Ironwood note-commitment-tree root ([`ANCHOR_SIZE`] bytes)
|
|
149
151
|
* * `memo` - ZIP-302 memo field ([`MEMO_SIZE`] bytes)
|
|
150
152
|
* * `unified_address` - optional full Unified Address the output was addressed to; if given,
|
|
@@ -168,9 +170,10 @@ export class BitGoPsbt {
|
|
|
168
170
|
* output.
|
|
169
171
|
*
|
|
170
172
|
* Returns the action index assigned to each output, in the same order as `outputs` — the
|
|
171
|
-
* orchard builder pads/reorders actions, so a
|
|
172
|
-
*
|
|
173
|
-
*
|
|
173
|
+
* orchard builder pads/reorders actions, so a caller correlating per-action data (a stored
|
|
174
|
+
* Unified Address, an explicit `set_ironwood_out_ciphertext` call) must use these indices, not
|
|
175
|
+
* the position in `outputs` — though note `sign_ironwood_v6`'s first round already patches
|
|
176
|
+
* every action's `out_ciphertext` with the wallet `ovk` on its own.
|
|
174
177
|
*/
|
|
175
178
|
add_ironwood_outputs(outputs: any, anchor: Uint8Array): Uint32Array;
|
|
176
179
|
/**
|
|
@@ -665,7 +668,8 @@ export class BitGoPsbt {
|
|
|
665
668
|
*
|
|
666
669
|
* If no transparent signature has been collected yet, this is the first signing round and
|
|
667
670
|
* `xpriv` must be the wallet's user root key: it is used with `root_wallet_keys.bitgo_key()` to
|
|
668
|
-
* derive this wallet's `ovk` and finalize `out_ciphertext`
|
|
671
|
+
* derive this wallet's `ovk` and finalize every action's `out_ciphertext` (multi-recipient
|
|
672
|
+
* builds included) before computing any sighash (it is
|
|
669
673
|
* sighash-committed). Any other key signing first is rejected, rather than deriving an `ovk`
|
|
670
674
|
* nobody can reproduce. Once a signature exists, the step is skipped and any key may sign — so
|
|
671
675
|
* callers pass `root_wallet_keys` unconditionally on every signing round without needing to know
|
|
@@ -471,7 +471,9 @@ export class BitGoPsbt {
|
|
|
471
471
|
*
|
|
472
472
|
* * `recipient` - raw Orchard/Ironwood address ([`ORCHARD_ADDRESS_SIZE`] bytes)
|
|
473
473
|
* * `amount` - note value in zatoshi
|
|
474
|
-
* * `ovk` - optional outgoing viewing key ([`OVK_SIZE`] bytes; `None` for a keyless build)
|
|
474
|
+
* * `ovk` - optional outgoing viewing key ([`OVK_SIZE`] bytes; `None` for a keyless build).
|
|
475
|
+
* Has no effect in the normal flow: `sign_ironwood_v6`'s first round re-encrypts every
|
|
476
|
+
* action's `out_ciphertext` under the wallet `ovk`, replacing whatever this produced
|
|
475
477
|
* * `anchor` - Ironwood note-commitment-tree root ([`ANCHOR_SIZE`] bytes)
|
|
476
478
|
* * `memo` - ZIP-302 memo field ([`MEMO_SIZE`] bytes)
|
|
477
479
|
* * `unified_address` - optional full Unified Address the output was addressed to; if given,
|
|
@@ -523,9 +525,10 @@ export class BitGoPsbt {
|
|
|
523
525
|
* output.
|
|
524
526
|
*
|
|
525
527
|
* Returns the action index assigned to each output, in the same order as `outputs` — the
|
|
526
|
-
* orchard builder pads/reorders actions, so a
|
|
527
|
-
*
|
|
528
|
-
*
|
|
528
|
+
* orchard builder pads/reorders actions, so a caller correlating per-action data (a stored
|
|
529
|
+
* Unified Address, an explicit `set_ironwood_out_ciphertext` call) must use these indices, not
|
|
530
|
+
* the position in `outputs` — though note `sign_ironwood_v6`'s first round already patches
|
|
531
|
+
* every action's `out_ciphertext` with the wallet `ovk` on its own.
|
|
529
532
|
* @param {any} outputs
|
|
530
533
|
* @param {Uint8Array} anchor
|
|
531
534
|
* @returns {Uint32Array}
|
|
@@ -2365,7 +2368,8 @@ export class BitGoPsbt {
|
|
|
2365
2368
|
*
|
|
2366
2369
|
* If no transparent signature has been collected yet, this is the first signing round and
|
|
2367
2370
|
* `xpriv` must be the wallet's user root key: it is used with `root_wallet_keys.bitgo_key()` to
|
|
2368
|
-
* derive this wallet's `ovk` and finalize `out_ciphertext`
|
|
2371
|
+
* derive this wallet's `ovk` and finalize every action's `out_ciphertext` (multi-recipient
|
|
2372
|
+
* builds included) before computing any sighash (it is
|
|
2369
2373
|
* sighash-committed). Any other key signing first is rejected, rather than deriving an `ovk`
|
|
2370
2374
|
* nobody can reproduce. Once a signature exists, the step is skipped and any key may sign — so
|
|
2371
2375
|
* callers pass `root_wallet_keys` unconditionally on every signing round without needing to know
|
|
Binary file
|
|
@@ -158,6 +158,8 @@ export const wasmbip32_from_bip32_properties: (a: number, b: number) => void;
|
|
|
158
158
|
export const bitgopsbt_sign_replay_protection_inputs: (a: number, b: number, c: number) => void;
|
|
159
159
|
export const bitgopsbt_sign_wallet_input: (a: number, b: number, c: number, d: number) => void;
|
|
160
160
|
export const bitgopsbt_sign_all_with_xpriv: (a: number, b: number, c: number) => void;
|
|
161
|
+
export const __wbg_wasmutxonamespace_free: (a: number, b: number) => void;
|
|
162
|
+
export const wasmutxonamespace_get_wasm_utxo_version: (a: number) => void;
|
|
161
163
|
export const __wbg_addressnamespace_free: (a: number, b: number) => void;
|
|
162
164
|
export const __wbg_bip322namespace_free: (a: number, b: number) => void;
|
|
163
165
|
export const __wbg_inscriptionsnamespace_free: (a: number, b: number) => void;
|
|
@@ -306,11 +308,8 @@ export const wasmzcashtransaction_lock_time: (a: number) => number;
|
|
|
306
308
|
export const wasmzcashtransaction_version: (a: number) => number;
|
|
307
309
|
export const wrappsbt_lock_time: (a: number) => number;
|
|
308
310
|
export const wrappsbt_version: (a: number) => number;
|
|
309
|
-
export const __wbg_wasmutxonamespace_free: (a: number, b: number) => void;
|
|
310
|
-
export const wasmutxonamespace_get_wasm_utxo_version: (a: number) => void;
|
|
311
311
|
export const __wbg_wrapdescriptor_free: (a: number, b: number) => void;
|
|
312
312
|
export const __wbg_wrapminiscript_free: (a: number, b: number) => void;
|
|
313
|
-
export const isInspectEnabled: () => number;
|
|
314
313
|
export const parsePsbtRawToJson: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
315
314
|
export const wrapdescriptor_atDerivationIndex: (a: number, b: number, c: number) => void;
|
|
316
315
|
export const wrapdescriptor_descType: (a: number, b: number) => void;
|
|
@@ -332,6 +331,7 @@ export const wrapminiscript_fromStringExt: (a: number, b: number, c: number, d:
|
|
|
332
331
|
export const wrapminiscript_node: (a: number, b: number) => void;
|
|
333
332
|
export const wrapminiscript_toAsmString: (a: number, b: number) => void;
|
|
334
333
|
export const wrapminiscript_toString: (a: number, b: number) => void;
|
|
334
|
+
export const isInspectEnabled: () => number;
|
|
335
335
|
export const parsePsbtToJson: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
336
336
|
export const parseTxToJson: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
337
337
|
export const rustsecp256k1_v0_10_0_context_create: (a: number) => number;
|