@babylonlabs-io/ts-sdk 0.27.1 → 0.28.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/PeginManager-Da4uSHzl.cjs +2 -0
- package/dist/PeginManager-Da4uSHzl.cjs.map +1 -0
- package/dist/{context-ktqanzXE.js → PeginManager-DzMSIQ0I.js} +1100 -1058
- package/dist/PeginManager-DzMSIQ0I.js.map +1 -0
- package/dist/buildAndBroadcastRefund-DkEpTFkv.cjs +2 -0
- package/dist/buildAndBroadcastRefund-DkEpTFkv.cjs.map +1 -0
- package/dist/{buildAndBroadcastRefund-BzYJv-Fv.js → buildAndBroadcastRefund-xWS8frc6.js} +338 -348
- package/dist/buildAndBroadcastRefund-xWS8frc6.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +55 -55
- package/dist/sha2-6wN58S6R.js +280 -0
- package/dist/sha2-6wN58S6R.js.map +1 -0
- package/dist/sha2-CsTynrfJ.cjs +2 -0
- package/dist/sha2-CsTynrfJ.cjs.map +1 -0
- package/dist/shared/index.cjs.map +1 -1
- package/dist/shared/index.js.map +1 -1
- package/dist/shared/wallets/index.d.ts +2 -1
- package/dist/shared/wallets/index.d.ts.map +1 -1
- package/dist/shared/wallets/interfaces/BitcoinWallet.d.ts +8 -0
- package/dist/shared/wallets/interfaces/BitcoinWallet.d.ts.map +1 -1
- package/dist/signing-BZigafm0.js.map +1 -1
- package/dist/signing-DHSXjhLM.cjs.map +1 -1
- package/dist/tbv/core/clients/eth/vault-registry-reader.d.ts.map +1 -1
- package/dist/tbv/core/clients/index.cjs +1 -1
- package/dist/tbv/core/clients/index.js +2 -2
- package/dist/tbv/core/contracts/abis/BTCVaultRegistry.abi.d.ts +80 -70
- package/dist/tbv/core/contracts/abis/BTCVaultRegistry.abi.d.ts.map +1 -1
- package/dist/tbv/core/index.cjs +1 -1
- package/dist/tbv/core/index.js +52 -52
- package/dist/tbv/core/managers/PeginManager.d.ts +64 -27
- package/dist/tbv/core/managers/PeginManager.d.ts.map +1 -1
- package/dist/tbv/core/managers/index.d.ts +1 -1
- package/dist/tbv/core/managers/index.d.ts.map +1 -1
- package/dist/tbv/core/services/deposit/peginState.d.ts +1 -1
- package/dist/tbv/core/services/deposit/peginState.d.ts.map +1 -1
- package/dist/tbv/core/services/deposit/validation.d.ts +0 -4
- package/dist/tbv/core/services/deposit/validation.d.ts.map +1 -1
- package/dist/tbv/core/services/index.cjs +1 -1
- package/dist/tbv/core/services/index.js +1 -1
- package/dist/tbv/core/vault-secrets/__tests__/deriveVaultRoot.test.d.ts +13 -0
- package/dist/tbv/core/vault-secrets/__tests__/deriveVaultRoot.test.d.ts.map +1 -0
- package/dist/tbv/core/vault-secrets/context.d.ts +9 -0
- package/dist/tbv/core/vault-secrets/context.d.ts.map +1 -1
- package/dist/tbv/core/vault-secrets/deriveVaultRoot.d.ts +56 -0
- package/dist/tbv/core/vault-secrets/deriveVaultRoot.d.ts.map +1 -0
- package/dist/tbv/core/vault-secrets/expand.d.ts +18 -3
- package/dist/tbv/core/vault-secrets/expand.d.ts.map +1 -1
- package/dist/tbv/core/vault-secrets/index.d.ts +6 -3
- package/dist/tbv/core/vault-secrets/index.d.ts.map +1 -1
- package/dist/tbv/core/wots/blockDerivation.d.ts +20 -24
- package/dist/tbv/core/wots/blockDerivation.d.ts.map +1 -1
- package/dist/tbv/core/wots/errors.d.ts +3 -1
- package/dist/tbv/core/wots/errors.d.ts.map +1 -1
- package/dist/tbv/core/wots/index.d.ts +1 -2
- package/dist/tbv/core/wots/index.d.ts.map +1 -1
- package/dist/tbv/index.cjs +1 -1
- package/dist/tbv/index.js +52 -52
- package/dist/testing/MockBitcoinWallet.d.ts +10 -3
- package/dist/testing/MockBitcoinWallet.d.ts.map +1 -1
- package/dist/testing/index.cjs +1 -1
- package/dist/testing/index.cjs.map +1 -1
- package/dist/testing/index.js +67 -55
- package/dist/testing/index.js.map +1 -1
- package/dist/types-CnG3JsRs.js +680 -0
- package/dist/types-CnG3JsRs.js.map +1 -0
- package/dist/types-jmEyzzhY.cjs +2 -0
- package/dist/types-jmEyzzhY.cjs.map +1 -0
- package/dist/{vault-registry-reader-CpCOte7w.js → vault-registry-reader-BywZhqJL.js} +65 -64
- package/dist/{vault-registry-reader-CpCOte7w.js.map → vault-registry-reader-BywZhqJL.js.map} +1 -1
- package/dist/vault-registry-reader-DdruADqa.cjs +2 -0
- package/dist/{vault-registry-reader-BizmBSBV.cjs.map → vault-registry-reader-DdruADqa.cjs.map} +1 -1
- package/package.json +1 -1
- package/dist/buildAndBroadcastRefund-BEASMFsz.cjs +0 -2
- package/dist/buildAndBroadcastRefund-BEASMFsz.cjs.map +0 -1
- package/dist/buildAndBroadcastRefund-BzYJv-Fv.js.map +0 -1
- package/dist/context-B4fYDTxy.cjs +0 -2
- package/dist/context-B4fYDTxy.cjs.map +0 -1
- package/dist/context-ktqanzXE.js.map +0 -1
- package/dist/sha2-1XZuToHP.cjs +0 -2
- package/dist/sha2-1XZuToHP.cjs.map +0 -1
- package/dist/sha2-ZzfZqQSw.js +0 -1123
- package/dist/sha2-ZzfZqQSw.js.map +0 -1
- package/dist/tbv/core/wots/deriveWotsPkHash.d.ts +0 -9
- package/dist/tbv/core/wots/deriveWotsPkHash.d.ts.map +0 -1
- package/dist/vault-registry-reader-BizmBSBV.cjs +0 -2
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Address, Chain, Hex, WalletClient } from 'viem';
|
|
2
2
|
import { BitcoinWallet, Hash } from '../../../shared/wallets';
|
|
3
|
+
import { WotsBlockPublicKey } from '../clients/vault-provider/types';
|
|
3
4
|
import { Network } from '../primitives';
|
|
4
5
|
import { UTXO } from '../utils';
|
|
5
6
|
/**
|
|
@@ -73,12 +74,6 @@ export interface PreparePeginParams {
|
|
|
73
74
|
* CSV timelock in blocks for the Pre-PegIn HTLC refund path.
|
|
74
75
|
*/
|
|
75
76
|
timelockRefund: number;
|
|
76
|
-
/**
|
|
77
|
-
* SHA256 hash commitment(s) for the HTLC (64 hex chars = 32 bytes each).
|
|
78
|
-
* Generated by the depositor as H = SHA256(secret).
|
|
79
|
-
* For single deposits, pass a single-element array.
|
|
80
|
-
*/
|
|
81
|
-
hashlocks: readonly string[];
|
|
82
77
|
/**
|
|
83
78
|
* Protocol fee rate in sat/vB from the contract offchain params.
|
|
84
79
|
* Used by WASM for computing depositorClaimValue and min pegin fee.
|
|
@@ -124,7 +119,11 @@ export interface PerVaultPeginData {
|
|
|
124
119
|
/** Vault output scriptPubKey hex */
|
|
125
120
|
vaultScriptPubKey: string;
|
|
126
121
|
}
|
|
127
|
-
|
|
122
|
+
/**
|
|
123
|
+
* Broadcast-ready transaction output of {@link PeginManager.preparePegin}.
|
|
124
|
+
* Safe to log / persist — contains no sensitive material.
|
|
125
|
+
*/
|
|
126
|
+
export interface PreparePeginTransaction {
|
|
128
127
|
/**
|
|
129
128
|
* Funded, pre-witness Pre-PegIn tx hex. Pass this for register calls'
|
|
130
129
|
* `unsignedPrePeginTx` — despite the contract-side name, the registry
|
|
@@ -133,7 +132,7 @@ export interface PreparePeginResult {
|
|
|
133
132
|
fundedPrePeginTxHex: string;
|
|
134
133
|
/** Funded Pre-PegIn transaction ID */
|
|
135
134
|
prePeginTxid: string;
|
|
136
|
-
/** Per-vault PegIn data — one entry per
|
|
135
|
+
/** Per-vault PegIn data — one entry per amount */
|
|
137
136
|
perVault: PerVaultPeginData[];
|
|
138
137
|
/** UTXOs selected to fund the Pre-PegIn transaction */
|
|
139
138
|
selectedUTXOs: UTXO[];
|
|
@@ -142,6 +141,35 @@ export interface PreparePeginResult {
|
|
|
142
141
|
/** Change amount in satoshis (if any) */
|
|
143
142
|
changeAmount: bigint;
|
|
144
143
|
}
|
|
144
|
+
/**
|
|
145
|
+
* Sensitive material derived from the wallet root. Do not log; do not
|
|
146
|
+
* persist beyond the activation flow. Strings are immutable in JS, so
|
|
147
|
+
* lifetime is GC-only — secrets stay live until the result is dropped.
|
|
148
|
+
*/
|
|
149
|
+
export interface PreparePeginDerivedSecrets {
|
|
150
|
+
/** Per-vault WOTS block public keys (one array per vault). */
|
|
151
|
+
perVaultWotsKeys: WotsBlockPublicKey[][];
|
|
152
|
+
/** Per-vault keccak256 of WOTS keys, ready as `depositorWotsPkHash`. */
|
|
153
|
+
wotsPkHashes: Hex[];
|
|
154
|
+
/**
|
|
155
|
+
* Per-vault HTLC preimage hex (no 0x prefix). Re-derivable any time
|
|
156
|
+
* via `expandHashlockSecret(root, htlcVout)`; not persisted.
|
|
157
|
+
*/
|
|
158
|
+
htlcSecretHexes: string[];
|
|
159
|
+
}
|
|
160
|
+
export interface PreparePeginResult {
|
|
161
|
+
/** Broadcast-ready Pre-PegIn + per-vault PegIn txs. Safe to log. */
|
|
162
|
+
transaction: PreparePeginTransaction;
|
|
163
|
+
/**
|
|
164
|
+
* x-only depositor pubkey snapshot used end-to-end across sizing,
|
|
165
|
+
* vault-root derivation, and PSBT signing. Safe to persist; not
|
|
166
|
+
* sensitive. Reusing this snapshot downstream guarantees that
|
|
167
|
+
* derived secrets and signed PSBTs reference the same identity.
|
|
168
|
+
*/
|
|
169
|
+
depositorBtcPubkey: string;
|
|
170
|
+
/** Sensitive derived material — see {@link PreparePeginDerivedSecrets}. */
|
|
171
|
+
derivedSecrets: PreparePeginDerivedSecrets;
|
|
172
|
+
}
|
|
145
173
|
/**
|
|
146
174
|
* Parameters for signing and broadcasting a transaction.
|
|
147
175
|
*/
|
|
@@ -187,8 +215,9 @@ export interface PopSignature {
|
|
|
187
215
|
export interface RegisterPeginParams {
|
|
188
216
|
/**
|
|
189
217
|
* Funded, pre-witness Pre-PegIn tx hex — pass
|
|
190
|
-
* {@link
|
|
191
|
-
*
|
|
218
|
+
* {@link PreparePeginTransaction.fundedPrePeginTxHex} from
|
|
219
|
+
* {@link PreparePeginResult.transaction}. The contract-side parameter
|
|
220
|
+
* is named `unsignedPrePeginTx` but it stores the funded form.
|
|
192
221
|
*/
|
|
193
222
|
unsignedPrePeginTx: string;
|
|
194
223
|
/**
|
|
@@ -301,26 +330,34 @@ export declare class PeginManager {
|
|
|
301
330
|
*/
|
|
302
331
|
constructor(config: PeginManagerConfig);
|
|
303
332
|
/**
|
|
304
|
-
*
|
|
305
|
-
*
|
|
306
|
-
*
|
|
307
|
-
*
|
|
308
|
-
* 1. Get depositor BTC public key from wallet
|
|
309
|
-
* 2. Build unfunded Pre-PegIn transaction (HTLC output) using primitives
|
|
310
|
-
* 3. Select UTXOs to cover the HTLC value
|
|
311
|
-
* 4. Fund the Pre-PegIn transaction
|
|
312
|
-
* 5. Derive the PegIn transaction from the funded Pre-PegIn tx
|
|
313
|
-
* 6. Build PSBT for signing the PegIn input (HTLC leaf 0)
|
|
314
|
-
* 7. Sign via BTC wallet and extract depositor signature
|
|
333
|
+
* Prepare a peg-in: sizing pass → vault-root derivation (one wallet
|
|
334
|
+
* popup) → per-vault WOTS / hashlock derivation → commit pass with
|
|
335
|
+
* batch PSBT signing (one popup). Returns broadcast-ready txs, the
|
|
336
|
+
* pubkey snapshot, and the sensitive derived material.
|
|
315
337
|
*
|
|
316
|
-
*
|
|
317
|
-
*
|
|
318
|
-
*
|
|
319
|
-
* @param params - Pegin parameters including amount, HTLC params, UTXOs
|
|
320
|
-
* @returns Pegin result with funded Pre-PegIn tx, signed PegIn input, and signatures
|
|
321
|
-
* @throws Error if wallet operations fail or insufficient funds
|
|
338
|
+
* @throws If the wallet rejects, insufficient funds, or an internal
|
|
339
|
+
* invariant violation.
|
|
322
340
|
*/
|
|
323
341
|
preparePegin(params: PreparePeginParams): Promise<PreparePeginResult>;
|
|
342
|
+
/**
|
|
343
|
+
* Derive per-vault WOTS keys + HTLC preimages from the wallet root.
|
|
344
|
+
* Takes ownership of `root`: zeros the buffer (and per-vault secret
|
|
345
|
+
* buffers) before returning, regardless of how the caller exits.
|
|
346
|
+
*/
|
|
347
|
+
private expandPerVaultSecrets;
|
|
348
|
+
/**
|
|
349
|
+
* Build unfunded Pre-PegIn + select UTXOs. No PSBT signing.
|
|
350
|
+
*
|
|
351
|
+
* Returns the full selection result (UTXOs, fee, changeAmount) so the
|
|
352
|
+
* commit pass funds the broadcast tx with the exact same set used to
|
|
353
|
+
* build the vault-context funding-outpoints commitment. Re-running
|
|
354
|
+
* `selectUtxosForPegin` in the commit pass would be deterministic given
|
|
355
|
+
* the same inputs, but threading the result through guarantees the
|
|
356
|
+
* domain separator structurally matches the funded tx inputs.
|
|
357
|
+
*/
|
|
358
|
+
private prepareSizing;
|
|
359
|
+
/** Build PegIn txs and batch-sign their inputs with real hashlocks. */
|
|
360
|
+
private preparePeginCommit;
|
|
324
361
|
/**
|
|
325
362
|
* Signs multiple PSBTs using batch signing if available, falling back to sequential signing.
|
|
326
363
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PeginManager.d.ts","sourceRoot":"","sources":["../../../../src/tbv/core/managers/PeginManager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAKH,OAAO,EAML,KAAK,OAAO,EACZ,KAAK,KAAK,EACV,KAAK,GAAG,EACR,KAAK,YAAY,EAClB,MAAM,MAAM,CAAC;AAEd,OAAO,KAAK,EAAE,aAAa,EAAE,IAAI,EAAmB,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"PeginManager.d.ts","sourceRoot":"","sources":["../../../../src/tbv/core/managers/PeginManager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAKH,OAAO,EAML,KAAK,OAAO,EACZ,KAAK,KAAK,EACV,KAAK,GAAG,EACR,KAAK,YAAY,EAClB,MAAM,MAAM,CAAC;AAEd,OAAO,KAAK,EAAE,aAAa,EAAE,IAAI,EAAmB,MAAM,yBAAyB,CAAC;AACpF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAG1E,OAAO,EAQL,KAAK,OAAO,EACb,MAAM,eAAe,CAAC;AAUvB,OAAO,EAOL,KAAK,IAA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OAAO,EAAE,GAAG,CAAC;IACb,qCAAqC;IACrC,WAAW,EAAE,GAAG,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,gCAAgC;IAChC,SAAS,EAAE,GAAG,CAAC;IACf,uDAAuD;IACvD,MAAM,EAAE,oBAAoB,EAAE,CAAC;CAChC;AAmED,qBAAa,YAAY;IACvB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAqB;IAE5C;;;;OAIG;gBACS,MAAM,EAAE,kBAAkB;IAItC;;;;;;;;OAQG;IACG,YAAY,CAChB,MAAM,EAAE,kBAAkB,GACzB,OAAO,CAAC,kBAAkB,CAAC;IAgE9B;;;;OAIG;YACW,qBAAqB;IA2CnC;;;;;;;;;OASG;YACW,aAAa;IAwC3B,uEAAuE;YACzD,kBAAkB;IAuHhC;;;;;;OAMG;YACW,qBAAqB;IA6BnC;;;;;;;;;;;;;;OAcG;IACG,gBAAgB,CAAC,MAAM,EAAE,sBAAsB,GAAG,OAAO,CAAC,MAAM,CAAC;IAuHvE;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACG,oBAAoB,CACxB,MAAM,EAAE,mBAAmB,GAC1B,OAAO,CAAC,mBAAmB,CAAC;IAqJ/B;;;;;;;;;OASG;IACG,yBAAyB,CAC7B,MAAM,EAAE,wBAAwB,GAC/B,OAAO,CAAC,wBAAwB,CAAC;IAuJpC;;;;;OAKG;YACW,gBAAgB;IAsB9B;;;;;;OAMG;YACW,yBAAyB;IAmCvC;;;;;OAKG;IACG,qBAAqB,IAAI,OAAO,CAAC,YAAY,CAAC;YAyBtC,yBAAyB;IAkBvC;;;;OAIG;IACH,UAAU,IAAI,OAAO;IAIrB;;;;OAIG;IACH,uBAAuB,IAAI,OAAO;CAGnC"}
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
* @module managers
|
|
22
22
|
*/
|
|
23
23
|
export { PeginManager } from './PeginManager';
|
|
24
|
-
export type { PopSignature, PreparePeginResult, PreparePeginParams, PeginManagerConfig, RegisterPeginParams, RegisterPeginResult, SignAndBroadcastParams, BatchPeginRequestItem, RegisterPeginBatchParams, BatchPeginResultItem, RegisterPeginBatchResult, } from './PeginManager';
|
|
24
|
+
export type { PopSignature, PreparePeginResult, PreparePeginTransaction, PreparePeginDerivedSecrets, PreparePeginParams, PerVaultPeginData, PeginManagerConfig, RegisterPeginParams, RegisterPeginResult, SignAndBroadcastParams, BatchPeginRequestItem, RegisterPeginBatchParams, BatchPeginResultItem, RegisterPeginBatchResult, } from './PeginManager';
|
|
25
25
|
export { PayoutManager } from './PayoutManager';
|
|
26
26
|
export type { PayoutManagerConfig, PayoutSignatureResult, SignPayoutParams, } from './PayoutManager';
|
|
27
27
|
export type { UTXO } from '../utils/utxo/selectUtxos';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/tbv/core/managers/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EACV,YAAY,EACZ,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,sBAAsB,EACtB,qBAAqB,EACrB,wBAAwB,EACxB,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EACV,mBAAmB,EACnB,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,iBAAiB,CAAC;AAGzB,YAAY,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AACtD,YAAY,EACV,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,eAAe,GAChB,MAAM,kDAAkD,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/tbv/core/managers/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EACV,YAAY,EACZ,kBAAkB,EAClB,uBAAuB,EACvB,0BAA0B,EAC1B,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,sBAAsB,EACtB,qBAAqB,EACrB,wBAAwB,EACxB,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EACV,mBAAmB,EACnB,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,iBAAiB,CAAC;AAGzB,YAAY,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AACtD,YAAY,EACV,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,eAAe,GAChB,MAAM,kDAAkD,CAAC"}
|
|
@@ -33,7 +33,7 @@ export type ExpirationReason = "ack_timeout" | "proof_timeout" | "activation_tim
|
|
|
33
33
|
* Available actions user can take
|
|
34
34
|
*/
|
|
35
35
|
export declare enum PeginAction {
|
|
36
|
-
/** Submit WOTS key (re-
|
|
36
|
+
/** Submit WOTS key (re-derives via wallet `deriveContextHash`) */
|
|
37
37
|
SUBMIT_WOTS_KEY = "SUBMIT_WOTS_KEY",
|
|
38
38
|
/** Sign payout transactions */
|
|
39
39
|
SIGN_PAYOUT_TRANSACTIONS = "SIGN_PAYOUT_TRANSACTIONS",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"peginState.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/services/deposit/peginState.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;GAUG;AACH,oBAAY,cAAc;IACxB,oDAAoD;IACpD,OAAO,IAAI;IACX,gEAAgE;IAChE,QAAQ,IAAI;IACZ,qGAAqG;IACrG,MAAM,IAAI;IACV,0DAA0D;IAC1D,QAAQ,IAAI;IACZ,2FAA2F;IAC3F,UAAU,IAAI;IACd,kGAAkG;IAClG,OAAO,IAAI;IACX,uFAAuF;IACvF,mBAAmB,IAAI;IACvB,oFAAoF;IACpF,OAAO,IAAI;CACZ;AAED,iCAAiC;AACjC,MAAM,MAAM,gBAAgB,GACxB,aAAa,GACb,eAAe,GACf,oBAAoB,CAAC;AAMzB;;GAEG;AACH,oBAAY,WAAW;IACrB,
|
|
1
|
+
{"version":3,"file":"peginState.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/services/deposit/peginState.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;GAUG;AACH,oBAAY,cAAc;IACxB,oDAAoD;IACpD,OAAO,IAAI;IACX,gEAAgE;IAChE,QAAQ,IAAI;IACZ,qGAAqG;IACrG,MAAM,IAAI;IACV,0DAA0D;IAC1D,QAAQ,IAAI;IACZ,2FAA2F;IAC3F,UAAU,IAAI;IACd,kGAAkG;IAClG,OAAO,IAAI;IACX,uFAAuF;IACvF,mBAAmB,IAAI;IACvB,oFAAoF;IACpF,OAAO,IAAI;CACZ;AAED,iCAAiC;AACjC,MAAM,MAAM,gBAAgB,GACxB,aAAa,GACb,eAAe,GACf,oBAAoB,CAAC;AAMzB;;GAEG;AACH,oBAAY,WAAW;IACrB,kEAAkE;IAClE,eAAe,oBAAoB;IACnC,+BAA+B;IAC/B,wBAAwB,6BAA6B;IACrD,uDAAuD;IACvD,6BAA6B,kCAAkC;IAC/D,uDAAuD;IACvD,cAAc,mBAAmB;IACjC,sEAAsE;IACtE,WAAW,gBAAgB;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,iEAAiE;IACjE,cAAc,EAAE,cAAc,CAAC;IAC/B,uEAAuE;IACvE,gBAAgB,EAAE,WAAW,EAAE,CAAC;CACjC;AAED;;;;;;GAMG;AACH,MAAM,WAAW,4BAA4B;IAC3C,0DAA0D;IAC1D,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,gFAAgF;IAChF,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,iEAAiE;IACjE,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,yEAAyE;IACzE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,6DAA6D;IAC7D,0BAA0B,CAAC,EAAE,OAAO,CAAC;CACtC;AAMD;;;;;;;;;;;;GAYG;AACH,wBAAgB,qBAAqB,CACnC,cAAc,EAAE,cAAc,EAC9B,OAAO,GAAE,4BAAiC,GACzC,kBAAkB,CA6EpB;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,kBAAkB,EACzB,MAAM,EAAE,WAAW,GAClB,OAAO,CAET"}
|
|
@@ -65,10 +65,6 @@ export interface MultiVaultDepositFlowInputs {
|
|
|
65
65
|
minDeposit: bigint;
|
|
66
66
|
/** Protocol maximum deposit per vault (satoshis) */
|
|
67
67
|
maxDeposit?: bigint;
|
|
68
|
-
/** Number of HTLC secret hexes — must match vaultAmounts.length */
|
|
69
|
-
htlcSecretHexesLength: number;
|
|
70
|
-
/** Number of depositor secret hashes — must match vaultAmounts.length */
|
|
71
|
-
depositorSecretHashesLength: number;
|
|
72
68
|
}
|
|
73
69
|
/**
|
|
74
70
|
* Check if deposit amount is within valid range and affordable.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/services/deposit/validation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAWH,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC,iCAAiC;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,2CAA2C;IAC3C,UAAU,EAAE,MAAM,CAAC;IACnB,sDAAsD;IACtD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,+CAA+C;IAC/C,UAAU,EAAE,MAAM,CAAC;IACnB,4CAA4C;IAC5C,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,qFAAqF;IACrF,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,WAAW,uBAAuB;IACtC,2CAA2C;IAC3C,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;CACnC;AAED,+EAA+E;AAC/E,UAAU,QAAQ;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,2BAA2B;IAC1C,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,cAAc,EAAE,QAAQ,EAAE,CAAC;IAC3B,sBAAsB,EAAE,MAAM,CAAC;IAC/B,qBAAqB,EAAE,MAAM,EAAE,CAAC;IAChC,6BAA6B,EAAE,MAAM,EAAE,CAAC;IACxC,oDAAoD;IACpD,UAAU,EAAE,MAAM,CAAC;IACnB,oDAAoD;IACpD,UAAU,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/services/deposit/validation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAWH,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC,iCAAiC;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,2CAA2C;IAC3C,UAAU,EAAE,MAAM,CAAC;IACnB,sDAAsD;IACtD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,+CAA+C;IAC/C,UAAU,EAAE,MAAM,C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MAAM,EACnB,UAAU,CAAC,EAAE,MAAM,GAClB,gBAAgB,CA+BlB;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,MAAM,GAAG,gBAAgB,CAU5E;AAqCD;;;;;;GAMG;AACH,wBAAgB,+BAA+B,CAC7C,MAAM,EAAE,2BAA2B,GAClC,IAAI,CA6BN"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../../buildAndBroadcastRefund-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../../buildAndBroadcastRefund-DkEpTFkv.cjs"),a=require("../../../signing-DHSXjhLM.cjs");exports.BIP68NotMatureError=t.BIP68NotMatureError;exports.ClaimerPegoutStatusValue=t.ClaimerPegoutStatusValue;exports.activateVault=t.activateVault;exports.buildAndBroadcastRefund=t.buildAndBroadcastRefund;exports.computeHashlock=t.computeHashlock;exports.isDepositAmountValid=t.isDepositAmountValid;exports.isPegoutTerminalStatus=t.isPegoutTerminalStatus;exports.isRecognizedPegoutStatus=t.isRecognizedPegoutStatus;exports.pollAndSignPayouts=t.pollAndSignPayouts;exports.signDepositorGraph=t.signDepositorGraph;exports.submitWotsPublicKey=t.submitWotsPublicKey;exports.validateDepositAmount=t.validateDepositAmount;exports.validateMultiVaultDepositInputs=t.validateMultiVaultDepositInputs;exports.validateProviderSelection=t.validateProviderSelection;exports.validateRemainingCapacity=t.validateRemainingCapacity;exports.validateSecretAgainstHashlock=t.validateSecretAgainstHashlock;exports.validateVaultAmounts=t.validateVaultAmounts;exports.validateVaultProviderPubkey=t.validateVaultProviderPubkey;exports.waitForPeginStatus=t.waitForPeginStatus;exports.ContractStatus=a.ContractStatus;exports.PeginAction=a.PeginAction;exports.canPerformAction=a.canPerformAction;exports.getPeginProtocolState=a.getPeginProtocolState;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as s, C as e, a as i, m as o, h as u, i as l, l as r, k as n, p as d, b as c, s as P, v as g, g as m, d as p, c as v, j as S, e as A, f as V, w as b } from "../../../buildAndBroadcastRefund-
|
|
1
|
+
import { B as s, C as e, a as i, m as o, h as u, i as l, l as r, k as n, p as d, b as c, s as P, v as g, g as m, d as p, c as v, j as S, e as A, f as V, w as b } from "../../../buildAndBroadcastRefund-xWS8frc6.js";
|
|
2
2
|
import { C, P as h, a as k, g as y } from "../../../signing-BZigafm0.js";
|
|
3
3
|
export {
|
|
4
4
|
s as BIP68NotMatureError,
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tests for `deriveVaultRoot` — the SDK helper that wires a wallet's
|
|
3
|
+
* `deriveContextHash` API to the canonical `vaultContext` encoding.
|
|
4
|
+
*
|
|
5
|
+
* The helper is a thin pass-through; tests pin the wiring contract:
|
|
6
|
+
* - Forwards the hardcoded `appName` "babylon-vault" verbatim.
|
|
7
|
+
* - Forwards the hex of the 72-byte `vaultContext` (lowercase, 144 chars).
|
|
8
|
+
* - Decodes the wallet's 64-char hex output to 32 bytes.
|
|
9
|
+
* - Rejects malformed wallet output (wrong length / non-hex / uppercase).
|
|
10
|
+
* - Propagates wallet errors unchanged (user rejection, not-supported, etc.).
|
|
11
|
+
*/
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=deriveVaultRoot.test.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deriveVaultRoot.test.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/vault-secrets/__tests__/deriveVaultRoot.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG"}
|
|
@@ -38,6 +38,10 @@ export interface VaultContextInput {
|
|
|
38
38
|
* Outpoints are serialized as 36-byte `txid || vout_BE`, sorted
|
|
39
39
|
* ascending lexicographically, concatenated, then hashed.
|
|
40
40
|
*
|
|
41
|
+
* @stability frozen — on-chain-binding. Any change to layout, sort
|
|
42
|
+
* order, or serialization is a hard fork; existing deposits would no
|
|
43
|
+
* longer match their committed `depositorWotsPkHash`.
|
|
44
|
+
*
|
|
41
45
|
* @throws If `outpoints` is empty or contains duplicates.
|
|
42
46
|
*/
|
|
43
47
|
export declare function buildFundingOutpointsCommitment(outpoints: readonly FundingOutpoint[]): Uint8Array;
|
|
@@ -47,6 +51,11 @@ export declare function buildFundingOutpointsCommitment(outpoints: readonly Fund
|
|
|
47
51
|
* app side).
|
|
48
52
|
*
|
|
49
53
|
* Output length is always 72 bytes.
|
|
54
|
+
*
|
|
55
|
+
* @stability frozen — on-chain-binding. The 72-byte layout is the
|
|
56
|
+
* input to `deriveContextHash`; any change rotates the vault root and
|
|
57
|
+
* therefore every WOTS key, hashlock secret, and auth anchor derived
|
|
58
|
+
* from it. Existing deposits cannot be recovered after a layout change.
|
|
50
59
|
*/
|
|
51
60
|
export declare function buildVaultContext(input: VaultContextInput): Uint8Array;
|
|
52
61
|
//# sourceMappingURL=context.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../../src/tbv/core/vault-secrets/context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAeH,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,IAAI,EAAE,UAAU,CAAC;IACjB,4DAA4D;IAC5D,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,iBAAiB;IAChC,oDAAoD;IACpD,kBAAkB,EAAE,UAAU,CAAC;IAC/B,yEAAyE;IACzE,gBAAgB,EAAE,SAAS,eAAe,EAAE,CAAC;CAC9C;AAoCD
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../../src/tbv/core/vault-secrets/context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAeH,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,IAAI,EAAE,UAAU,CAAC;IACjB,4DAA4D;IAC5D,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,iBAAiB;IAChC,oDAAoD;IACpD,kBAAkB,EAAE,UAAU,CAAC;IAC/B,yEAAyE;IACzE,gBAAgB,EAAE,SAAS,eAAe,EAAE,CAAC;CAC9C;AAoCD;;;;;;;;;;;GAWG;AACH,wBAAgB,+BAA+B,CAC7C,SAAS,EAAE,SAAS,eAAe,EAAE,GACpC,UAAU,CAsBZ;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,iBAAiB,GAAG,UAAU,CAqBtE"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { VaultContextInput } from './context';
|
|
2
|
+
/**
|
|
3
|
+
* The fixed `appName` passed to the wallet's `deriveContextHash` for
|
|
4
|
+
* Babylon vault derivations. The wallet displays this in its approval
|
|
5
|
+
* dialog. Defined by `derive-vault-secrets.md` §2.2 — must not be
|
|
6
|
+
* changed without coordinating a spec revision and a downstream
|
|
7
|
+
* migration plan, as it provides app-level domain separation across
|
|
8
|
+
* applications using the same wallet.
|
|
9
|
+
*/
|
|
10
|
+
export declare const VAULT_APP_NAME = "babylon-vault";
|
|
11
|
+
/**
|
|
12
|
+
* Minimal structural shape for the wallet capability needed by this
|
|
13
|
+
* helper. Typed against the method directly so callers can pass any
|
|
14
|
+
* value that implements `deriveContextHash` — `BitcoinWallet` from
|
|
15
|
+
* this SDK, `IBTCProvider` from `@babylonlabs-io/wallet-connector`,
|
|
16
|
+
* or a test mock — without depending on the rest of either interface.
|
|
17
|
+
*/
|
|
18
|
+
export interface DeriveContextHashCapableWallet {
|
|
19
|
+
deriveContextHash(appName: string, context: string): Promise<string>;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Derive the 32-byte vault root from a wallet by encoding the
|
|
23
|
+
* canonical {@link VaultContextInput} and forwarding to
|
|
24
|
+
* `wallet.deriveContextHash`.
|
|
25
|
+
*
|
|
26
|
+
* Validates the wallet's output strictly: must be exactly 64
|
|
27
|
+
* lowercase hex characters per `derive-context-hash.md` §2.1. A
|
|
28
|
+
* conformant wallet always satisfies this, but we re-check at the
|
|
29
|
+
* SDK boundary so a non-conformant wallet (or a wallet returning a
|
|
30
|
+
* malformed value through a buggy adapter) fails loud here rather
|
|
31
|
+
* than producing silently-wrong derived secrets downstream.
|
|
32
|
+
*
|
|
33
|
+
* The helper itself produces only valid spec inputs (`appName` is
|
|
34
|
+
* the hardcoded `VAULT_APP_NAME`; `context` is hex of the 72-byte
|
|
35
|
+
* `vaultContext`, always 144 chars lowercase), so input-side
|
|
36
|
+
* validation is unnecessary.
|
|
37
|
+
*
|
|
38
|
+
* @param wallet - Any value implementing `deriveContextHash`.
|
|
39
|
+
* @param input - The canonical {@link VaultContextInput} that
|
|
40
|
+
* uniquely identifies the vault. Encoded by
|
|
41
|
+
* {@link buildVaultContext} into a 72-byte structure
|
|
42
|
+
* before being hex-encoded for the wallet.
|
|
43
|
+
* @stability frozen — on-chain-binding. The pair (`VAULT_APP_NAME`,
|
|
44
|
+
* `vaultContext` encoding) is the wallet's input space; changing
|
|
45
|
+
* either rotates the root and invalidates every secret derived from
|
|
46
|
+
* it. `VAULT_APP_NAME` is fixed by `derive-vault-secrets.md` §2.2
|
|
47
|
+
* and must never change without a coordinated spec revision.
|
|
48
|
+
*
|
|
49
|
+
* @returns 32-byte root suitable for {@link expandAuthAnchor},
|
|
50
|
+
* {@link expandHashlockSecret}, {@link expandWotsSeed}.
|
|
51
|
+
* @throws If the wallet returns a non-64-char or non-lowercase-hex
|
|
52
|
+
* string. Errors from the wallet (user rejection,
|
|
53
|
+
* method-not-supported, etc.) propagate unchanged.
|
|
54
|
+
*/
|
|
55
|
+
export declare function deriveVaultRoot(wallet: DeriveContextHashCapableWallet, input: VaultContextInput): Promise<Uint8Array>;
|
|
56
|
+
//# sourceMappingURL=deriveVaultRoot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deriveVaultRoot.d.ts","sourceRoot":"","sources":["../../../../src/tbv/core/vault-secrets/deriveVaultRoot.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH,OAAO,EAAqB,KAAK,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAEtE;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,kBAAkB,CAAC;AAU9C;;;;;;GAMG;AACH,MAAM,WAAW,8BAA8B;IAC7C,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CACtE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAsB,eAAe,CACnC,MAAM,EAAE,8BAA8B,EACtC,KAAK,EAAE,iBAAiB,GACvB,OAAO,CAAC,UAAU,CAAC,CAuBrB"}
|
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
* `derive-vault-secrets.md` §2.2.
|
|
4
4
|
*
|
|
5
5
|
* Pure, synchronous expanders that derive three domain-separated
|
|
6
|
-
* secrets from a 32-byte `root`. The root is spec-opaque —
|
|
7
|
-
*
|
|
8
|
-
*
|
|
6
|
+
* secrets from a 32-byte `root`. The root is spec-opaque — typically
|
|
7
|
+
* obtained via `deriveVaultRoot(wallet, vaultContextInput)` (which
|
|
8
|
+
* forwards to the wallet's `deriveContextHash`), but any 32-byte
|
|
9
|
+
* pseudorandom source satisfies the contract.
|
|
9
10
|
*
|
|
10
11
|
* All expand calls use HKDF-Expand-SHA-256 with `root` directly as the
|
|
11
12
|
* PRK (RFC 5869 §3.3: the Extract step is omitted when the input is
|
|
@@ -20,6 +21,10 @@
|
|
|
20
21
|
* `SHA256(authAnchor)` is committed as the OP_RETURN preimage hash in
|
|
21
22
|
* the Pre-PegIn; the raw preimage is revealed to the vault provider's
|
|
22
23
|
* `auth_createDepositorToken` RPC in exchange for a CWT bearer token.
|
|
24
|
+
*
|
|
25
|
+
* @stability frozen — on-chain-binding. Changing the HKDF info encoding
|
|
26
|
+
* (label or argument order) rotates the anchor and invalidates the VP
|
|
27
|
+
* bearer-token flow for existing deposits.
|
|
23
28
|
*/
|
|
24
29
|
export declare function expandAuthAnchor(root: Uint8Array): Uint8Array;
|
|
25
30
|
/**
|
|
@@ -29,6 +34,10 @@ export declare function expandAuthAnchor(root: Uint8Array): Uint8Array;
|
|
|
29
34
|
* `SHA256(hashlockSecret)` is committed as the HTLC taproot hashlock
|
|
30
35
|
* at vout = `htlcVout` in the Pre-PegIn. The raw preimage is revealed
|
|
31
36
|
* on Ethereum via `activateVaultWithSecret`.
|
|
37
|
+
*
|
|
38
|
+
* @stability frozen — on-chain-binding. Changing the HKDF info
|
|
39
|
+
* encoding produces a different secret whose SHA-256 will not match
|
|
40
|
+
* the on-chain hashlock; affected vaults can never be activated.
|
|
32
41
|
*/
|
|
33
42
|
export declare function expandHashlockSecret(root: Uint8Array, htlcVout: number): Uint8Array;
|
|
34
43
|
/**
|
|
@@ -38,6 +47,12 @@ export declare function expandHashlockSecret(root: Uint8Array, htlcVout: number)
|
|
|
38
47
|
* Fed into the per-vault WOTS block-keypair derivation. Only the
|
|
39
48
|
* `keccak256` hash of the derived public keys appears on-chain
|
|
40
49
|
* (committed as `depositorWotsPkHash`).
|
|
50
|
+
*
|
|
51
|
+
* @stability frozen — on-chain-binding. Changing the HKDF info
|
|
52
|
+
* encoding (label or htlcVout serialization) rotates the seed and
|
|
53
|
+
* therefore the WOTS keys; existing `depositorWotsPkHash` commitments
|
|
54
|
+
* would no longer match. Per-vault domain separation depends on the
|
|
55
|
+
* `i2osp4(htlcVout)` argument: do not change its encoding.
|
|
41
56
|
*/
|
|
42
57
|
export declare function expandWotsSeed(root: Uint8Array, htlcVout: number): Uint8Array;
|
|
43
58
|
//# sourceMappingURL=expand.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expand.d.ts","sourceRoot":"","sources":["../../../../src/tbv/core/vault-secrets/expand.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"expand.d.ts","sourceRoot":"","sources":["../../../../src/tbv/core/vault-secrets/expand.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AA0BH;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,UAAU,GAAG,UAAU,CAQ7D;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,UAAU,EAChB,QAAQ,EAAE,MAAM,GACf,UAAU,CAQZ;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,GAAG,UAAU,CAQ7E"}
|
|
@@ -4,13 +4,16 @@
|
|
|
4
4
|
* from a single 32-byte root.
|
|
5
5
|
*
|
|
6
6
|
* Implements `derive-vault-secrets.md` §2.2 and Appendix A. The root is
|
|
7
|
-
* spec-opaque — callers produce it
|
|
8
|
-
*
|
|
9
|
-
* provenance-agnostic and only
|
|
7
|
+
* spec-opaque — callers produce it from `wallet.deriveContextHash` via
|
|
8
|
+
* {@link deriveVaultRoot} (canonical path), or from any other source
|
|
9
|
+
* that yields 32 bytes. The SDK is provenance-agnostic and only
|
|
10
|
+
* consumes the 32 bytes.
|
|
10
11
|
*
|
|
11
12
|
* @module tbv/core/vault-secrets
|
|
12
13
|
*/
|
|
13
14
|
export { expandAuthAnchor, expandHashlockSecret, expandWotsSeed, } from './expand';
|
|
14
15
|
export { buildFundingOutpointsCommitment, buildVaultContext } from './context';
|
|
15
16
|
export type { FundingOutpoint, VaultContextInput } from './context';
|
|
17
|
+
export { deriveVaultRoot, VAULT_APP_NAME } from './deriveVaultRoot';
|
|
18
|
+
export type { DeriveContextHashCapableWallet } from './deriveVaultRoot';
|
|
16
19
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/tbv/core/vault-secrets/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/tbv/core/vault-secrets/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,cAAc,GACf,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,+BAA+B,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAE/E,YAAY,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAEpE,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEpE,YAAY,EAAE,8BAA8B,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -1,33 +1,27 @@
|
|
|
1
|
-
import { WotsBlockPublicKey } from '../clients/vault-provider/types';
|
|
2
1
|
import { Hex } from 'viem';
|
|
2
|
+
import { WotsBlockPublicKey } from '../clients/vault-provider/types';
|
|
3
3
|
/**
|
|
4
|
-
* Derive
|
|
5
|
-
*
|
|
6
|
-
* Internally uses PBKDF2 with 2048 rounds of HMAC-SHA-512 and the passphrase
|
|
7
|
-
* `"mnemonic"` (no user password), per the BIP-39 specification.
|
|
4
|
+
* Derive deterministic WOTS block public keys from a per-vault 64-byte seed.
|
|
8
5
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
* Derive deterministic WOTS block public keys for a specific vault.
|
|
6
|
+
* The seed must come from `expandWotsSeed(root, htlcVout)` (vault-secrets
|
|
7
|
+
* module). Per-vault uniqueness is encoded in `htlcVout`; this function
|
|
8
|
+
* only handles the chain derivation. Per-block 20-byte seeds are derived
|
|
9
|
+
* as `hash160(seed || blockIdx)` and fed into the standard Rust
|
|
10
|
+
* `babe::wots` chain logic.
|
|
15
11
|
*
|
|
16
|
-
*
|
|
17
|
-
* matching the Rust `Vec<babe::wots::PublicKey>` format expected by the
|
|
18
|
-
* vault provider's `submitDepositorWotsKey` RPC.
|
|
12
|
+
* The seed is zeroed in the `finally` block.
|
|
19
13
|
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
14
|
+
* @stability frozen — on-chain-binding. Per-block seed derivation,
|
|
15
|
+
* chain length, checksum-digit ordering, and terminal byte layout
|
|
16
|
+
* must match Rust `babe::wots` byte-for-byte. Any divergence rotates
|
|
17
|
+
* `depositorWotsPkHash` and breaks resume + on-chain verification
|
|
18
|
+
* for every existing vault.
|
|
22
19
|
*
|
|
23
|
-
* @param seed
|
|
24
|
-
* @param vaultId - Vault identifier / pegin tx hash (hex, with or without 0x prefix).
|
|
25
|
-
* @param depositorPk - Depositor's BTC public key (hex, with or without 0x prefix).
|
|
26
|
-
* @param appContractAddress - Application contract address.
|
|
20
|
+
* @param seed - 64-byte per-vault seed.
|
|
27
21
|
* @returns Array of 2 WOTS block public keys.
|
|
28
|
-
* @throws If seed
|
|
22
|
+
* @throws If `seed.length !== 64`.
|
|
29
23
|
*/
|
|
30
|
-
export declare function
|
|
24
|
+
export declare function deriveWotsBlocksFromSeed(seed: Uint8Array): Promise<WotsBlockPublicKey[]>;
|
|
31
25
|
/**
|
|
32
26
|
* Compute the keccak256 hash of WOTS block public keys.
|
|
33
27
|
*
|
|
@@ -39,8 +33,10 @@ export declare function deriveWotsBlockPublicKeys(seed: Uint8Array, vaultId: str
|
|
|
39
33
|
* The result is committed on-chain as `depositorWotsPkHash` so the vault
|
|
40
34
|
* provider can verify submitted WOTS public keys.
|
|
41
35
|
*
|
|
42
|
-
* @
|
|
43
|
-
*
|
|
36
|
+
* @stability frozen — on-chain-binding. Concatenation order of chain
|
|
37
|
+
* tips and the keccak256 input layout MUST match Rust
|
|
38
|
+
* `btc_vault::wots_public_keys_keccak256` byte-for-byte. Any change
|
|
39
|
+
* rotates the on-chain commitment and breaks every existing vault.
|
|
44
40
|
*/
|
|
45
41
|
export declare function computeWotsBlockPublicKeysHash(publicKeys: WotsBlockPublicKey[]): Hex;
|
|
46
42
|
//# sourceMappingURL=blockDerivation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blockDerivation.d.ts","sourceRoot":"","sources":["../../../../src/tbv/core/wots/blockDerivation.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"blockDerivation.d.ts","sourceRoot":"","sources":["../../../../src/tbv/core/wots/blockDerivation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAKH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAEhC,OAAO,KAAK,EACV,kBAAkB,EAEnB,MAAM,iCAAiC,CAAC;AAgJzC;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,wBAAwB,CAC5C,IAAI,EAAE,UAAU,GACf,OAAO,CAAC,kBAAkB,EAAE,CAAC,CA+E/B;AAuBD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,8BAA8B,CAC5C,UAAU,EAAE,kBAAkB,EAAE,GAC/B,GAAG,CAmCL"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Check whether an error from the vault provider indicates that the
|
|
3
3
|
* submitted WOTS public key hash does not match the on-chain
|
|
4
|
-
* commitment. This signals that the wrong
|
|
4
|
+
* commitment. This signals that the wrong wallet is connected (its
|
|
5
|
+
* `deriveContextHash` produces a different vault root and therefore
|
|
6
|
+
* different WOTS keys).
|
|
5
7
|
*/
|
|
6
8
|
export declare function isWotsMismatchError(error: unknown): boolean;
|
|
7
9
|
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../src/tbv/core/wots/errors.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../src/tbv/core/wots/errors.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAc3D"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export { deriveWotsPkHash } from './deriveWotsPkHash';
|
|
1
|
+
export { deriveWotsBlocksFromSeed, computeWotsBlockPublicKeysHash, } from './blockDerivation';
|
|
3
2
|
export { isWotsMismatchError } from './errors';
|
|
4
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/tbv/core/wots/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/tbv/core/wots/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EACxB,8BAA8B,GAC/B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC"}
|
package/dist/tbv/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../challengeAssert-BM8m9gPM.cjs"),P=require("@babylonlabs-io/babylon-tbv-rust-wasm"),d=require("../payout-DP6KMFP1.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../challengeAssert-BM8m9gPM.cjs"),P=require("@babylonlabs-io/babylon-tbv-rust-wasm"),d=require("../payout-DP6KMFP1.cjs"),o=require("../bitcoin-DIN0OupO.cjs"),l=require("../signing-DHSXjhLM.cjs"),u=require("../validation-u8W7Lp2x.cjs"),t=require("../buildAndBroadcastRefund-DkEpTFkv.cjs"),a=require("../fundPeginTransaction-DaWoYCgO.cjs"),i=require("../psbtInputFields-CB8hqjQ5.cjs"),r=require("../PeginManager-Da4uSHzl.cjs"),e=require("../vault-registry-reader-DdruADqa.cjs"),s=require("../types-jmEyzzhY.cjs");exports.buildChallengeAssertPsbt=n.buildChallengeAssertPsbt;exports.buildDepositorPayoutPsbt=n.buildDepositorPayoutPsbt;exports.buildNoPayoutPsbt=n.buildNoPayoutPsbt;exports.buildPeginInputPsbt=n.buildPeginInputPsbt;exports.buildPeginTxFromFundedPrePegin=n.buildPeginTxFromFundedPrePegin;exports.buildPrePeginPsbt=n.buildPrePeginPsbt;exports.computeNumLocalChallengers=n.computeNumLocalChallengers;exports.extractPeginInputSignature=n.extractPeginInputSignature;exports.finalizePeginInputPsbt=n.finalizePeginInputPsbt;Object.defineProperty(exports,"computeMinClaimValue",{enumerable:!0,get:()=>P.computeMinClaimValue});Object.defineProperty(exports,"deriveVaultId",{enumerable:!0,get:()=>P.deriveVaultId});exports.buildPayoutPsbt=d.buildPayoutPsbt;exports.buildRefundPsbt=d.buildRefundPsbt;exports.createPayoutScript=d.createPayoutScript;exports.extractPayoutSignature=d.extractPayoutSignature;exports.deriveNativeSegwitAddress=o.deriveNativeSegwitAddress;exports.deriveTaprootAddress=o.deriveTaprootAddress;exports.ensureHexPrefix=o.ensureHexPrefix;exports.formatSatoshisToBtc=o.formatSatoshisToBtc;exports.getNetwork=o.getNetwork;exports.hexToUint8Array=o.hexToUint8Array;exports.isAddressFromPublicKey=o.isAddressFromPublicKey;exports.isValidHex=o.isValidHex;exports.processPublicKeyToXOnly=o.processPublicKeyToXOnly;exports.stripHexPrefix=o.stripHexPrefix;exports.toXOnly=o.toXOnly;exports.uint8ArrayToHex=o.uint8ArrayToHex;exports.validateWalletPubkey=o.validateWalletPubkey;exports.ContractStatus=l.ContractStatus;exports.PeginAction=l.PeginAction;exports.canPerformAction=l.canPerformAction;exports.createTaprootScriptPathSignOptions=l.createTaprootScriptPathSignOptions;exports.getPeginProtocolState=l.getPeginProtocolState;exports.BITCOIN_ADDRESS_RE=u.BITCOIN_ADDRESS_RE;exports.HEX_RE=u.HEX_RE;exports.KNOWN_SCRIPT_PREFIXES=u.KNOWN_SCRIPT_PREFIXES;exports.MAX_REASONABLE_FEE_SATS=u.MAX_REASONABLE_FEE_SATS;exports.TXID_RE=u.TXID_RE;exports.BIP68NotMatureError=t.BIP68NotMatureError;exports.ClaimerPegoutStatusValue=t.ClaimerPegoutStatusValue;exports.PayoutManager=t.PayoutManager;exports.activateVault=t.activateVault;exports.buildAndBroadcastRefund=t.buildAndBroadcastRefund;exports.computeHashlock=t.computeHashlock;exports.isDepositAmountValid=t.isDepositAmountValid;exports.isPegoutTerminalStatus=t.isPegoutTerminalStatus;exports.isRecognizedPegoutStatus=t.isRecognizedPegoutStatus;exports.pollAndSignPayouts=t.pollAndSignPayouts;exports.signDepositorGraph=t.signDepositorGraph;exports.submitWotsPublicKey=t.submitWotsPublicKey;exports.validateDepositAmount=t.validateDepositAmount;exports.validateMultiVaultDepositInputs=t.validateMultiVaultDepositInputs;exports.validateProviderSelection=t.validateProviderSelection;exports.validateRemainingCapacity=t.validateRemainingCapacity;exports.validateSecretAgainstHashlock=t.validateSecretAgainstHashlock;exports.validateVaultAmounts=t.validateVaultAmounts;exports.validateVaultProviderPubkey=t.validateVaultProviderPubkey;exports.waitForPeginStatus=t.waitForPeginStatus;exports.BTC_DUST_SAT=a.BTC_DUST_SAT;exports.DUST_THRESHOLD=a.DUST_THRESHOLD;exports.FEE_SAFETY_MARGIN=a.FEE_SAFETY_MARGIN;exports.LOW_RATE_ESTIMATION_ACCURACY_BUFFER=a.LOW_RATE_ESTIMATION_ACCURACY_BUFFER;exports.MAX_NON_LEGACY_OUTPUT_SIZE=a.MAX_NON_LEGACY_OUTPUT_SIZE;exports.P2TR_INPUT_SIZE=a.P2TR_INPUT_SIZE;exports.PEGIN_AUTH_ANCHOR_OUTPUTS=a.PEGIN_AUTH_ANCHOR_OUTPUTS;exports.PEGIN_FIXED_OUTPUTS=a.PEGIN_FIXED_OUTPUTS;exports.SPLIT_TX_FEE_SAFETY_MULTIPLIER=a.SPLIT_TX_FEE_SAFETY_MULTIPLIER;exports.TX_BUFFER_SIZE_OVERHEAD=a.TX_BUFFER_SIZE_OVERHEAD;exports.WALLET_RELAY_FEE_RATE_THRESHOLD=a.WALLET_RELAY_FEE_RATE_THRESHOLD;exports.fundPeginTransaction=a.fundPeginTransaction;exports.parseUnfundedWasmTransaction=a.parseUnfundedWasmTransaction;exports.peginOutputCount=a.peginOutputCount;exports.rateBasedTxBufferFee=a.rateBasedTxBufferFee;exports.BitcoinScriptType=i.BitcoinScriptType;exports.UtxoNotAvailableError=i.UtxoNotAvailableError;exports.assertUtxosAvailable=i.assertUtxosAvailable;exports.calculateBtcTxHash=i.calculateBtcTxHash;exports.collectReservedUtxoRefs=i.collectReservedUtxoRefs;exports.extractInputsFromTransaction=i.extractInputsFromTransaction;exports.getDustThreshold=i.getDustThreshold;exports.getPsbtInputFields=i.getPsbtInputFields;exports.getScriptType=i.getScriptType;exports.selectUtxosForDeposit=i.selectUtxosForDeposit;exports.selectUtxosForPegin=i.selectUtxosForPegin;exports.shouldAddChangeOutput=i.shouldAddChangeOutput;exports.validateUtxosAvailable=i.validateUtxosAvailable;exports.CONTRACT_ERRORS=r.CONTRACT_ERRORS;exports.PeginManager=r.PeginManager;exports.VAULT_APP_NAME=r.VAULT_APP_NAME;exports.buildFundingOutpointsCommitment=r.buildFundingOutpointsCommitment;exports.buildVaultContext=r.buildVaultContext;exports.computeWotsBlockPublicKeysHash=r.computeWotsBlockPublicKeysHash;exports.deriveVaultRoot=r.deriveVaultRoot;exports.deriveWotsBlocksFromSeed=r.deriveWotsBlocksFromSeed;exports.expandAuthAnchor=r.expandAuthAnchor;exports.expandHashlockSecret=r.expandHashlockSecret;exports.expandWotsSeed=r.expandWotsSeed;exports.extractErrorData=r.extractErrorData;exports.getContractErrorMessage=r.getContractErrorMessage;exports.handleContractError=r.handleContractError;exports.isKnownContractError=r.isKnownContractError;exports.isWotsMismatchError=r.isWotsMismatchError;exports.ApplicationRegistryABI=e.ApplicationRegistryABI;exports.MEMPOOL_API_URLS=e.MEMPOOL_API_URLS;exports.ProtocolParamsABI=e.ProtocolParamsABI;exports.ServerIdentityError=e.ServerIdentityError;exports.VaultProviderRpcClient=e.VaultProviderRpcClient;exports.ViemProtocolParamsReader=e.ViemProtocolParamsReader;exports.ViemUniversalChallengerReader=e.ViemUniversalChallengerReader;exports.ViemVaultKeeperReader=e.ViemVaultKeeperReader;exports.ViemVaultRegistryReader=e.ViemVaultRegistryReader;exports.VpResponseValidationError=e.VpResponseValidationError;exports.VpTokenProvider=e.VpTokenProvider;exports.getAddressTxs=e.getAddressTxs;exports.getAddressUtxos=e.getAddressUtxos;exports.getMempoolApiUrl=e.getMempoolApiUrl;exports.getNetworkFees=e.getNetworkFees;exports.getTxHex=e.getTxHex;exports.getTxInfo=e.getTxInfo;exports.getUtxoInfo=e.getUtxoInfo;exports.pushTx=e.pushTx;exports.resolveProtocolAddresses=e.resolveProtocolAddresses;exports.validateRequestDepositorClaimerArtifactsResponse=e.validateRequestDepositorClaimerArtifactsResponse;exports.verifyServerIdentity=e.verifyServerIdentity;exports.BTCVaultRegistryABI=s.BTCVaultRegistryABI;exports.DaemonStatus=s.DaemonStatus;exports.JSON_RPC_ERROR_CODES=s.JSON_RPC_ERROR_CODES;exports.JsonRpcClient=s.JsonRpcClient;exports.JsonRpcError=s.JsonRpcError;exports.POST_WOTS_STATUSES=s.POST_WOTS_STATUSES;exports.PRE_DEPOSITOR_SIGNATURES_STATES=s.PRE_DEPOSITOR_SIGNATURES_STATES;exports.RpcErrorCode=s.RpcErrorCode;exports.VP_TERMINAL_STATUSES=s.VP_TERMINAL_STATUSES;exports.VP_TRANSIENT_STATUSES=s.VP_TRANSIENT_STATUSES;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|