@babylonlabs-io/ts-sdk 1.0.0 → 1.1.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/dist/{signPsbtsWithFallback-DoRbHHua.js → PayoutManager-CHTOwj0E.js} +25 -25
- package/dist/PayoutManager-CHTOwj0E.js.map +1 -0
- package/dist/PayoutManager-CpfQjtL0.cjs +2 -0
- package/dist/PayoutManager-CpfQjtL0.cjs.map +1 -0
- package/dist/PeginManager-6tjlGd0t.cjs +2 -0
- package/dist/PeginManager-6tjlGd0t.cjs.map +1 -0
- package/dist/{PeginManager-BH_AKu4l.js → PeginManager-DEldv_Ro.js} +21 -20
- package/dist/PeginManager-DEldv_Ro.js.map +1 -0
- package/dist/buildAndBroadcastReclaim-BwT6Jxp5.cjs +2 -0
- package/dist/buildAndBroadcastReclaim-BwT6Jxp5.cjs.map +1 -0
- package/dist/buildAndBroadcastReclaim-CqO2DoP8.js +1919 -0
- package/dist/buildAndBroadcastReclaim-CqO2DoP8.js.map +1 -0
- package/dist/challengeAssert-Cp_GeRg8.js.map +1 -1
- package/dist/challengeAssert-Z7_YULBb.cjs.map +1 -1
- package/dist/deriveVaultRoot-BwbXmN0x.js +79 -0
- package/dist/{parseFundingOutpoints-BwC3foxS.cjs.map → deriveVaultRoot-BwbXmN0x.js.map} +1 -1
- package/dist/deriveVaultRoot-DvhkHzNb.cjs +2 -0
- package/dist/deriveVaultRoot-DvhkHzNb.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +286 -268
- package/dist/index.js.map +1 -1
- package/dist/noPayout-DAWBQ0eG.cjs.map +1 -1
- package/dist/noPayout-qBXWKwav.js.map +1 -1
- package/dist/onChainBtcPubkey-BXry_CM4.cjs +2 -0
- package/dist/onChainBtcPubkey-BXry_CM4.cjs.map +1 -0
- package/dist/onChainBtcPubkey-C1WqyxPM.js +159 -0
- package/dist/onChainBtcPubkey-C1WqyxPM.js.map +1 -0
- package/dist/parseFundingOutpoints-C_-PT9BT.cjs +2 -0
- package/dist/parseFundingOutpoints-C_-PT9BT.cjs.map +1 -0
- package/dist/parseFundingOutpoints-GSM-IaaK.js +17 -0
- package/dist/parseFundingOutpoints-GSM-IaaK.js.map +1 -0
- package/dist/{pegin-registration-client-pcczkzMg.js → pegin-registration-client-1sZ-74UC.js} +260 -383
- package/dist/pegin-registration-client-1sZ-74UC.js.map +1 -0
- package/dist/pegin-registration-client-BNV44jzw.cjs +2 -0
- package/dist/pegin-registration-client-BNV44jzw.cjs.map +1 -0
- package/dist/signing-3l5Aqd-H.cjs +2 -0
- package/dist/signing-3l5Aqd-H.cjs.map +1 -0
- package/dist/signing-Dhr2t0Z6.js +39 -0
- package/dist/signing-Dhr2t0Z6.js.map +1 -0
- package/dist/tbv/core/clients/eth/index.cjs +1 -1
- package/dist/tbv/core/clients/eth/index.js +8 -8
- package/dist/tbv/core/clients/index.cjs +1 -1
- package/dist/tbv/core/clients/index.js +8 -8
- package/dist/tbv/core/index.cjs +1 -1
- package/dist/tbv/core/index.js +284 -266
- package/dist/tbv/core/index.js.map +1 -1
- package/dist/tbv/core/managers/PayoutManager.d.ts +1 -1
- package/dist/tbv/core/managers/PeginManager.d.ts +1 -1
- package/dist/tbv/core/managers/index.cjs +1 -1
- package/dist/tbv/core/managers/index.js +2 -2
- package/dist/tbv/core/primitives/index.d.ts +1 -1
- package/dist/tbv/core/primitives/psbt/challengeAssert.d.ts +2 -2
- package/dist/tbv/core/primitives/psbt/challengeAssert.d.ts.map +1 -1
- package/dist/tbv/core/primitives/psbt/noPayout.d.ts +1 -1
- package/dist/tbv/core/primitives/psbt/noPayout.d.ts.map +1 -1
- package/dist/tbv/core/primitives/psbt/payout.d.ts +13 -7
- package/dist/tbv/core/primitives/psbt/payout.d.ts.map +1 -1
- package/dist/tbv/core/services/delegated-claim/__tests__/assembleWatchtowerArtifacts.test.d.ts +15 -0
- package/dist/tbv/core/services/delegated-claim/__tests__/assembleWatchtowerArtifacts.test.d.ts.map +1 -0
- package/dist/tbv/core/services/delegated-claim/__tests__/deriveClaimerWotsKeypair.test.d.ts +11 -0
- package/dist/tbv/core/services/delegated-claim/__tests__/deriveClaimerWotsKeypair.test.d.ts.map +1 -0
- package/dist/tbv/core/services/delegated-claim/__tests__/readWatchtowerArtifacts.test.d.ts +10 -0
- package/dist/tbv/core/services/delegated-claim/__tests__/readWatchtowerArtifacts.test.d.ts.map +1 -0
- package/dist/tbv/core/services/delegated-claim/__tests__/vaultIdBinding.test.d.ts +10 -0
- package/dist/tbv/core/services/delegated-claim/__tests__/vaultIdBinding.test.d.ts.map +1 -0
- package/dist/tbv/core/services/delegated-claim/__tests__/wotsKeypair.golden.test.d.ts +11 -0
- package/dist/tbv/core/services/delegated-claim/__tests__/wotsKeypair.golden.test.d.ts.map +1 -0
- package/dist/tbv/core/services/delegated-claim/assembleWatchtowerArtifacts.d.ts +46 -0
- package/dist/tbv/core/services/delegated-claim/assembleWatchtowerArtifacts.d.ts.map +1 -0
- package/dist/tbv/core/services/delegated-claim/challengerBinding.d.ts +72 -0
- package/dist/tbv/core/services/delegated-claim/challengerBinding.d.ts.map +1 -0
- package/dist/tbv/core/services/delegated-claim/deriveClaimerWotsKeypair.d.ts +63 -0
- package/dist/tbv/core/services/delegated-claim/deriveClaimerWotsKeypair.d.ts.map +1 -0
- package/dist/tbv/core/services/delegated-claim/index.d.ts +55 -0
- package/dist/tbv/core/services/delegated-claim/index.d.ts.map +1 -0
- package/dist/tbv/core/services/delegated-claim/payoutBinding.d.ts +65 -0
- package/dist/tbv/core/services/delegated-claim/payoutBinding.d.ts.map +1 -0
- package/dist/tbv/core/services/delegated-claim/readWatchtowerArtifacts.d.ts +70 -0
- package/dist/tbv/core/services/delegated-claim/readWatchtowerArtifacts.d.ts.map +1 -0
- package/dist/tbv/core/services/delegated-claim/types.d.ts +105 -0
- package/dist/tbv/core/services/delegated-claim/types.d.ts.map +1 -0
- package/dist/tbv/core/services/delegated-claim/vaultIdBinding.d.ts +44 -0
- package/dist/tbv/core/services/delegated-claim/vaultIdBinding.d.ts.map +1 -0
- package/dist/tbv/core/services/index.cjs +1 -1
- package/dist/tbv/core/services/index.d.ts +1 -0
- package/dist/tbv/core/services/index.d.ts.map +1 -1
- package/dist/tbv/core/services/index.js +73 -56
- package/dist/tbv/core/services/index.js.map +1 -1
- package/dist/tbv/core/utils/index.cjs +1 -1
- package/dist/tbv/core/utils/index.js +44 -43
- package/dist/tbv/core/utils/signing.d.ts +24 -0
- package/dist/tbv/core/utils/signing.d.ts.map +1 -1
- package/dist/tbv/core/vault-secrets/index.cjs +1 -1
- package/dist/tbv/core/vault-secrets/index.js +9 -8
- package/dist/tbv/core/vault-secrets/index.js.map +1 -1
- package/dist/tbv/core/wasm/index.cjs +1 -1
- package/dist/tbv/core/wasm/index.cjs.map +1 -1
- package/dist/tbv/core/wasm/index.d.ts +102 -5
- package/dist/tbv/core/wasm/index.d.ts.map +1 -1
- package/dist/tbv/core/wasm/index.js +170 -73
- package/dist/tbv/core/wasm/index.js.map +1 -1
- package/dist/tbv/index.cjs +1 -1
- package/dist/tbv/index.js +284 -266
- package/dist/tbv/index.js.map +1 -1
- package/dist/tbv/integrations/aave/types.d.ts +1 -1
- package/dist/toRefundInputs-BaN9XluU.cjs +2 -0
- package/dist/{toRefundInputs-DEPXcrgO.cjs.map → toRefundInputs-BaN9XluU.cjs.map} +1 -1
- package/dist/{toRefundInputs-BEulLgN_.js → toRefundInputs-mtuuYezp.js} +23 -22
- package/dist/{toRefundInputs-BEulLgN_.js.map → toRefundInputs-mtuuYezp.js.map} +1 -1
- package/dist/{types-B9YhlXe8.js → types-BdCEoANP.js} +2 -2
- package/dist/{types-B9YhlXe8.js.map → types-BdCEoANP.js.map} +1 -1
- package/dist/{types-C1tpDycc.cjs → types-BuxreSq4.cjs} +2 -2
- package/dist/{types-C1tpDycc.cjs.map → types-BuxreSq4.cjs.map} +1 -1
- package/dist/verifyScriptPathSchnorrSignature-BKZihCjk.cjs.map +1 -1
- package/dist/verifyScriptPathSchnorrSignature-CpjSTfMj.js.map +1 -1
- package/package.json +3 -3
- package/dist/PeginManager-BCJWwV05.cjs +0 -2
- package/dist/PeginManager-BCJWwV05.cjs.map +0 -1
- package/dist/PeginManager-BH_AKu4l.js.map +0 -1
- package/dist/buildAndBroadcastReclaim-DLsf5hjO.cjs +0 -2
- package/dist/buildAndBroadcastReclaim-DLsf5hjO.cjs.map +0 -1
- package/dist/buildAndBroadcastReclaim-OMvihzJg.js +0 -1545
- package/dist/buildAndBroadcastReclaim-OMvihzJg.js.map +0 -1
- package/dist/onChainBtcPubkey-BbxRrbvg.cjs +0 -2
- package/dist/onChainBtcPubkey-BbxRrbvg.cjs.map +0 -1
- package/dist/onChainBtcPubkey-C-6UWpD8.js +0 -34
- package/dist/onChainBtcPubkey-C-6UWpD8.js.map +0 -1
- package/dist/parseFundingOutpoints-BwC3foxS.cjs +0 -2
- package/dist/parseFundingOutpoints-CC4NKYz2.js +0 -93
- package/dist/parseFundingOutpoints-CC4NKYz2.js.map +0 -1
- package/dist/pegin-registration-client-CZgcU2_0.cjs +0 -2
- package/dist/pegin-registration-client-CZgcU2_0.cjs.map +0 -1
- package/dist/pegin-registration-client-pcczkzMg.js.map +0 -1
- package/dist/signPsbtsWithFallback-DoRbHHua.js.map +0 -1
- package/dist/signPsbtsWithFallback-FwrTYZS4.cjs +0 -2
- package/dist/signPsbtsWithFallback-FwrTYZS4.cjs.map +0 -1
- package/dist/signing-BJ3X66b-.cjs +0 -2
- package/dist/signing-BJ3X66b-.cjs.map +0 -1
- package/dist/signing-Cm-McVR2.js +0 -22
- package/dist/signing-Cm-McVR2.js.map +0 -1
- package/dist/toRefundInputs-DEPXcrgO.cjs +0 -2
|
@@ -14,8 +14,8 @@ export interface ChallengeAssertParams {
|
|
|
14
14
|
* Build unsigned ChallengeAssert PSBT.
|
|
15
15
|
*
|
|
16
16
|
* Each input has its own taproot script derived from its connector params; the
|
|
17
|
-
* number of connector params must match the transaction's input count.
|
|
18
|
-
*
|
|
17
|
+
* number of connector params must match the transaction's input count.
|
|
18
|
+
* Every prevout is derived from the authoritative
|
|
19
19
|
* Assert transaction, never trusted from external input.
|
|
20
20
|
*
|
|
21
21
|
* @param params - ChallengeAssert parameters
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"challengeAssert.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/primitives/psbt/challengeAssert.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"challengeAssert.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/primitives/psbt/challengeAssert.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EACL,KAAK,8BAA8B,EAGpC,MAAM,YAAY,CAAC;AAWpB;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,iDAAiD;IACjD,oBAAoB,EAAE,MAAM,CAAC;IAC7B,qFAAqF;IACrF,WAAW,EAAE,MAAM,CAAC;IACpB,wFAAwF;IACxF,uBAAuB,EAAE,8BAA8B,EAAE,CAAC;CAC3D;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,wBAAwB,CAC5C,MAAM,EAAE,qBAAqB,GAC5B,OAAO,CAAC,MAAM,CAAC,CA+EjB"}
|
|
@@ -7,7 +7,7 @@ export interface NoPayoutParams {
|
|
|
7
7
|
noPayoutTxHex: string;
|
|
8
8
|
/** Challenger's x-only public key (hex encoded) */
|
|
9
9
|
challengerPubkey: string;
|
|
10
|
-
/** Prevouts for all inputs [{script_pubkey, value}] from
|
|
10
|
+
/** Prevouts for all inputs [{script_pubkey, value}], used verbatim — derive them from the parent txs */
|
|
11
11
|
prevouts: Array<{
|
|
12
12
|
script_pubkey: string;
|
|
13
13
|
value: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"noPayout.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/primitives/psbt/noPayout.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EACL,KAAK,mCAAmC,EACxC,KAAK,OAAO,EAGb,MAAM,YAAY,CAAC;AAYpB;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,kDAAkD;IAClD,aAAa,EAAE,MAAM,CAAC;IACtB,mDAAmD;IACnD,gBAAgB,EAAE,MAAM,CAAC;IACzB
|
|
1
|
+
{"version":3,"file":"noPayout.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/primitives/psbt/noPayout.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EACL,KAAK,mCAAmC,EACxC,KAAK,OAAO,EAGb,MAAM,YAAY,CAAC;AAYpB;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,kDAAkD;IAClD,aAAa,EAAE,MAAM,CAAC;IACtB,mDAAmD;IACnD,gBAAgB,EAAE,MAAM,CAAC;IACzB,wGAAwG;IACxG,QAAQ,EAAE,KAAK,CAAC;QAAE,aAAa,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC1D,0DAA0D;IAC1D,eAAe,EAAE,mCAAmC,CAAC;CACtD;AAED;;;;;;;;GAQG;AACH,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,cAAc,GACrB,OAAO,CAAC,MAAM,CAAC,CA6DjB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,qCAAqC,CACnD,aAAa,EAAE,MAAM,EACrB,gBAAgB,EAAE,MAAM,EACxB,OAAO,EAAE,OAAO,GACf,IAAI,CAyBN"}
|
|
@@ -2,8 +2,8 @@ import { Network } from '../../wasm';
|
|
|
2
2
|
/**
|
|
3
3
|
* Parameters for building an unsigned Payout PSBT
|
|
4
4
|
*
|
|
5
|
-
* Payout
|
|
6
|
-
* Input 1 references the Assert transaction.
|
|
5
|
+
* Payout ends two of the peg-out paths; see {@link buildPayoutPsbt} for all of
|
|
6
|
+
* them. Input 1 references the Assert transaction.
|
|
7
7
|
*/
|
|
8
8
|
export interface PayoutParams {
|
|
9
9
|
/**
|
|
@@ -131,11 +131,17 @@ export interface PayoutPsbtResult {
|
|
|
131
131
|
/**
|
|
132
132
|
* Build unsigned Payout PSBT for depositor to sign.
|
|
133
133
|
*
|
|
134
|
-
* Payout
|
|
135
|
-
*
|
|
136
|
-
*
|
|
137
|
-
*
|
|
138
|
-
*
|
|
134
|
+
* Payout ends two of the peg-out paths (btc-vault
|
|
135
|
+
* `crates/vault/docs/btc-transactions-spec.md`):
|
|
136
|
+
* - Happy path: Claim -> Assert -> Payout.
|
|
137
|
+
* - Challenge path, claimer wins: Claim -> Assert -> ChallengeAssert ->
|
|
138
|
+
* WronglyChallenged -> Payout.
|
|
139
|
+
* - Challenge path, challenger wins: Claim -> Assert -> ChallengeAssert -> NoPayout.
|
|
140
|
+
* - Emergency path: the Security Council spends Assert:0 via CouncilNoPayout.
|
|
141
|
+
*
|
|
142
|
+
* So a raised challenge does not remove Payout; only NoPayout (challenger wins)
|
|
143
|
+
* or CouncilNoPayout (council emergency) blocks it.
|
|
144
|
+
* Payout references the Assert tx and needs its timelock matured.
|
|
139
145
|
*
|
|
140
146
|
* Payout transactions have the following structure:
|
|
141
147
|
* - Input 0: from PeginTx output0 (signed by depositor)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payout.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/primitives/psbt/payout.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;
|
|
1
|
+
{"version":3,"file":"payout.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/primitives/psbt/payout.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,OAAO,EAGL,KAAK,OAAO,EACb,MAAM,YAAY,CAAC;AA0CpB;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B;;;;OAIG;IACH,gBAAgB,EAAE,MAAM,CAAC;IAEzB;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,kBAAkB,EAAE,MAAM,CAAC;IAE3B;;OAEG;IACH,sBAAsB,EAAE,MAAM,CAAC;IAE/B;;OAEG;IACH,qBAAqB,EAAE,MAAM,EAAE,CAAC;IAEhC;;OAEG;IACH,6BAA6B,EAAE,MAAM,EAAE,CAAC;IAExC;;;OAGG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;;OAGG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;IAEjB;;;OAGG;IACH,gBAAgB,EAAE,MAAM,CAAC;IAEzB;;;;OAIG;IACH,4BAA4B,EAAE,MAAM,CAAC;IAErC;;;;OAIG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;;;OAIG;IACH,eAAe,EAAE,MAAM,CAAC;IAExB;;;;;;;OAOG;IACH,cAAc,EAAE,MAAM,EAAE,CAAC;IAEzB;;;;OAIG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;;;;;;;;;;;;;OAcG;IACH,4BAA4B,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAE/D;;;;;OAKG;IACH,wBAAwB,EAAE,MAAM,CAAC;CAClC;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,wBAAsB,eAAe,CACnC,MAAM,EAAE,YAAY,GACnB,OAAO,CAAC,gBAAgB,CAAC,CAoH3B;AA4bD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,sBAAsB,CACpC,aAAa,EAAE,MAAM,EACrB,eAAe,EAAE,MAAM,EACvB,UAAU,SAAI,GACb,MAAM,CA+CR"}
|
package/dist/tbv/core/services/delegated-claim/__tests__/assembleWatchtowerArtifacts.test.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Orchestration of the one signing session that authorizes a delegated claim.
|
|
3
|
+
*
|
|
4
|
+
* The signatures are collected months before they are used and cannot be
|
|
5
|
+
* re-collected, so what matters here is that every signature ends up attached
|
|
6
|
+
* to the transaction, challenger, and garbled-circuit index it was computed
|
|
7
|
+
* for, and that the batch is a single wallet interaction.
|
|
8
|
+
*
|
|
9
|
+
* Every wasm call is mocked, so nothing here says anything about the bytes
|
|
10
|
+
* the file ends up carrying. That guarantee lives in btc-vault#2655's
|
|
11
|
+
* `crates/vault/src/delegated_claim/artifacts.rs` round-trip test, which is
|
|
12
|
+
* where an `artifacts.json` format change has to be caught.
|
|
13
|
+
*/
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=assembleWatchtowerArtifacts.test.d.ts.map
|
package/dist/tbv/core/services/delegated-claim/__tests__/assembleWatchtowerArtifacts.test.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assembleWatchtowerArtifacts.test.d.ts","sourceRoot":"","sources":["../../../../../../src/tbv/core/services/delegated-claim/__tests__/assembleWatchtowerArtifacts.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Re-derivation of the WOTS keypair a delegated claim needs.
|
|
3
|
+
*
|
|
4
|
+
* The keypair is never stored, so the only thing standing between a wallet
|
|
5
|
+
* that derives the wrong one and an Assert nobody can verify is the pair of
|
|
6
|
+
* checks here: against the vault's on-chain commitment, and against the
|
|
7
|
+
* graph. Both must run before the keypair is handed back, and the secrets
|
|
8
|
+
* they run on must not outlive the call.
|
|
9
|
+
*/
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=deriveClaimerWotsKeypair.test.d.ts.map
|
package/dist/tbv/core/services/delegated-claim/__tests__/deriveClaimerWotsKeypair.test.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deriveClaimerWotsKeypair.test.d.ts","sourceRoot":"","sources":["../../../../../../src/tbv/core/services/delegated-claim/__tests__/deriveClaimerWotsKeypair.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checks on an artifacts file that arrives from disk.
|
|
3
|
+
*
|
|
4
|
+
* Nothing verifies an artifacts file between the day it is written and the
|
|
5
|
+
* day it is claimed against, and by then the vault provider may be gone. A
|
|
6
|
+
* file for the wrong vault, or one whose signatures no longer hold, has to
|
|
7
|
+
* fail at selection — after the Claim is broadcast the PegIn UTXO is spent.
|
|
8
|
+
*/
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=readWatchtowerArtifacts.test.d.ts.map
|
package/dist/tbv/core/services/delegated-claim/__tests__/readWatchtowerArtifacts.test.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"readWatchtowerArtifacts.test.d.ts","sourceRoot":"","sources":["../../../../../../src/tbv/core/services/delegated-claim/__tests__/readWatchtowerArtifacts.test.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one check that ties a vault-provider-served graph to a vault.
|
|
3
|
+
*
|
|
4
|
+
* Every other field is self-declared: the graph JSON names no vault, and the
|
|
5
|
+
* artifacts file's `vault_id` is copied in by whoever wrote it. Only the
|
|
6
|
+
* PegIn output the Claim spends is a fact about the chain, and getting its
|
|
7
|
+
* byte order wrong would silently reject correct graphs and accept nothing.
|
|
8
|
+
*/
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=vaultIdBinding.test.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vaultIdBinding.test.d.ts","sourceRoot":"","sources":["../../../../../../src/tbv/core/services/delegated-claim/__tests__/vaultIdBinding.test.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Golden-vector gate for the WOTS keypair derivation the delegated claim
|
|
3
|
+
* depends on. The derivation binds on-chain through `depositorWotsPkHash`:
|
|
4
|
+
* if these bytes drift, every existing depositor loses the ability to prove
|
|
5
|
+
* the keypair the graph's Claim commits to, and with it their claim path.
|
|
6
|
+
*
|
|
7
|
+
* The same vector is pinned Rust-side in vault-wasm `lib.rs` and in btc-vault
|
|
8
|
+
* `crates/crypto`. A vault-wasm re-pin that changes it must not ship.
|
|
9
|
+
*/
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=wotsKeypair.golden.test.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wotsKeypair.golden.test.d.ts","sourceRoot":"","sources":["../../../../../../src/tbv/core/services/delegated-claim/__tests__/wotsKeypair.golden.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Network } from '@babylonlabs-io/babylon-tbv-rust-wasm';
|
|
2
|
+
import { BitcoinWallet } from '../../../../shared/wallets/interfaces';
|
|
3
|
+
import { ClaimerArtifactsSource, DelegatedClaimVaultContext } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* Everything one delegated-claim signing session needs.
|
|
6
|
+
*
|
|
7
|
+
* @experimental
|
|
8
|
+
*/
|
|
9
|
+
export interface AssembleWatchtowerArtifactsParams {
|
|
10
|
+
/** Wallet holding the depositor key the graph was built with. */
|
|
11
|
+
btcWallet: BitcoinWallet;
|
|
12
|
+
/** Depositor's BTC public key (compressed or x-only hex). */
|
|
13
|
+
depositorPublicKey: string;
|
|
14
|
+
/** Network the depositor's address is derived on, to check the signer. */
|
|
15
|
+
btcNetwork: Network;
|
|
16
|
+
/** Graph and verifying key as the vault provider returned them. */
|
|
17
|
+
source: ClaimerArtifactsSource;
|
|
18
|
+
vault: DelegatedClaimVaultContext;
|
|
19
|
+
/**
|
|
20
|
+
* Per-challenger BaBe sessions as `{"<pk>": {"decryptor_artifacts_hex":
|
|
21
|
+
* "..."}}`, passed through into the file unchanged.
|
|
22
|
+
*
|
|
23
|
+
* Omit it for anything but a fixture. Real sessions run to hundreds of
|
|
24
|
+
* megabytes per challenger, and this argument crosses the WASM boundary as
|
|
25
|
+
* one string — join them into the file downstream instead.
|
|
26
|
+
*/
|
|
27
|
+
babeSessionsJson?: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Signs the delegated-claim set and returns the `artifacts.json` content,
|
|
31
|
+
* ready to write verbatim.
|
|
32
|
+
*
|
|
33
|
+
* Every signature is verified against the graph before the file is produced,
|
|
34
|
+
* so a wallet that signed under the wrong key fails here rather than at claim
|
|
35
|
+
* time, when nothing can be re-signed.
|
|
36
|
+
*
|
|
37
|
+
* Experimental: this API can change in a minor release. Pin the SDK
|
|
38
|
+
* version if you build on it.
|
|
39
|
+
*
|
|
40
|
+
* @throws If the graph is not version 3, if the wallet returns a signature
|
|
41
|
+
* that does not verify, or if the graph's own presignatures are
|
|
42
|
+
* incomplete.
|
|
43
|
+
* @experimental
|
|
44
|
+
*/
|
|
45
|
+
export declare function assembleWatchtowerArtifacts(params: AssembleWatchtowerArtifactsParams): Promise<string>;
|
|
46
|
+
//# sourceMappingURL=assembleWatchtowerArtifacts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assembleWatchtowerArtifacts.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/services/delegated-claim/assembleWatchtowerArtifacts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uCAAuC,CAAC;AAGrE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AAgB3E,OAAO,KAAK,EACV,sBAAsB,EACtB,0BAA0B,EAC3B,MAAM,SAAS,CAAC;AA8BjB;;;;GAIG;AACH,MAAM,WAAW,iCAAiC;IAChD,iEAAiE;IACjE,SAAS,EAAE,aAAa,CAAC;IACzB,6DAA6D;IAC7D,kBAAkB,EAAE,MAAM,CAAC;IAC3B,0EAA0E;IAC1E,UAAU,EAAE,OAAO,CAAC;IACpB,mEAAmE;IACnE,MAAM,EAAE,sBAAsB,CAAC;IAC/B,KAAK,EAAE,0BAA0B,CAAC;IAClC;;;;;;;OAOG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,2BAA2B,CAC/C,MAAM,EAAE,iCAAiC,GACxC,OAAO,CAAC,MAAM,CAAC,CAkHjB"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Binding between the challenger set a delegated claim signs for and the set
|
|
3
|
+
* the vault actually has on chain.
|
|
4
|
+
*
|
|
5
|
+
* The WronglyChallenged PSBTs arrive keyed by challenger public key, and the
|
|
6
|
+
* vault provider chooses those keys. Nothing downstream notices a short map:
|
|
7
|
+
* the artifacts file verifies against its own graph, so a missing challenger
|
|
8
|
+
* produces a file that looks complete and fails only months later, when that
|
|
9
|
+
* challenger's ChallengeAssert has to be answered inside
|
|
10
|
+
* `timelock_challenge_assert` and the material is not there.
|
|
11
|
+
*
|
|
12
|
+
* The failure is asymmetric, which is why both directions are checked.
|
|
13
|
+
* Missing entries leave the depositor unable to defend the claim; extra
|
|
14
|
+
* entries hand out signatures for keys the protocol does not recognize.
|
|
15
|
+
*
|
|
16
|
+
* This mirrors `assertChallengerSetMatchesExpected` in
|
|
17
|
+
* `services/deposit/signDepositorGraph.ts`, which does the same job at
|
|
18
|
+
* deposit time against the same on-chain sets.
|
|
19
|
+
*
|
|
20
|
+
* @module services/delegated-claim/challengerBinding
|
|
21
|
+
*/
|
|
22
|
+
/**
|
|
23
|
+
* Thrown when the graph's challengers are not the vault's challengers.
|
|
24
|
+
*
|
|
25
|
+
* @experimental
|
|
26
|
+
*/
|
|
27
|
+
export declare class ChallengerSetMismatchError extends Error {
|
|
28
|
+
/** Challengers the vault has that the graph left out. */
|
|
29
|
+
readonly missing: string[];
|
|
30
|
+
/** Challengers the graph lists that the vault does not have. */
|
|
31
|
+
readonly unexpected: string[];
|
|
32
|
+
constructor(
|
|
33
|
+
/** Challengers the vault has that the graph left out. */
|
|
34
|
+
missing: string[],
|
|
35
|
+
/** Challengers the graph lists that the vault does not have. */
|
|
36
|
+
unexpected: string[]);
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* The graph's challenger keys, and the on-chain sets they must equal.
|
|
40
|
+
*
|
|
41
|
+
* @experimental
|
|
42
|
+
*/
|
|
43
|
+
export interface AssertChallengerSetMatchesVaultParams {
|
|
44
|
+
/** Challenger keys the graph produced WronglyChallenged PSBTs for. */
|
|
45
|
+
graphChallengerPubkeys: string[];
|
|
46
|
+
/** Depositor's BTC public key, registered on chain for this vault. */
|
|
47
|
+
depositorBtcPubkey: string;
|
|
48
|
+
/**
|
|
49
|
+
* Vault provider's BTC public key, registered on chain for this vault.
|
|
50
|
+
* The depositor-as-claimer branch does not use it, but the shared
|
|
51
|
+
* derivation takes it, and passing a stand-in would be a lie that the
|
|
52
|
+
* next change to that function could turn into a wrong set.
|
|
53
|
+
*/
|
|
54
|
+
vaultProviderBtcPubkey: string;
|
|
55
|
+
/** Vault keepers registered on chain for this vault. */
|
|
56
|
+
vaultKeeperBtcPubkeys: string[];
|
|
57
|
+
/** Universal challengers registered on chain. */
|
|
58
|
+
universalChallengerBtcPubkeys: string[];
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Throws unless the graph's challenger set equals `local ∪ universal`.
|
|
62
|
+
*
|
|
63
|
+
* The depositor is the claimer here, so the local set is the vault keepers,
|
|
64
|
+
* derived by the same function the deposit path uses rather than restated.
|
|
65
|
+
*
|
|
66
|
+
* @throws {@link ChallengerSetMismatchError} on any missing or extra key, or
|
|
67
|
+
* a plain error when the on-chain sets themselves are unusable.
|
|
68
|
+
*
|
|
69
|
+
* @experimental
|
|
70
|
+
*/
|
|
71
|
+
export declare function assertChallengerSetMatchesVault(params: AssertChallengerSetMatchesVaultParams): void;
|
|
72
|
+
//# sourceMappingURL=challengerBinding.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"challengerBinding.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/services/delegated-claim/challengerBinding.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAKH;;;;GAIG;AACH,qBAAa,0BAA2B,SAAQ,KAAK;IAEjD,yDAAyD;IACzD,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE;IAC1B,gEAAgE;IAChE,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE;;IAH7B,yDAAyD;IAChD,OAAO,EAAE,MAAM,EAAE;IAC1B,gEAAgE;IACvD,UAAU,EAAE,MAAM,EAAE;CAahC;AAED;;;;GAIG;AACH,MAAM,WAAW,qCAAqC;IACpD,sEAAsE;IACtE,sBAAsB,EAAE,MAAM,EAAE,CAAC;IACjC,sEAAsE;IACtE,kBAAkB,EAAE,MAAM,CAAC;IAC3B;;;;;OAKG;IACH,sBAAsB,EAAE,MAAM,CAAC;IAC/B,wDAAwD;IACxD,qBAAqB,EAAE,MAAM,EAAE,CAAC;IAChC,iDAAiD;IACjD,6BAA6B,EAAE,MAAM,EAAE,CAAC;CACzC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,+BAA+B,CAC7C,MAAM,EAAE,qCAAqC,GAC5C,IAAI,CAkCN"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { BitcoinWallet } from '../../../../shared/wallets/interfaces';
|
|
2
|
+
import { VaultContextInput } from '../../vault-secrets';
|
|
3
|
+
/**
|
|
4
|
+
* Inputs for re-deriving the depositor's WOTS keypair at claim time.
|
|
5
|
+
*
|
|
6
|
+
* @experimental
|
|
7
|
+
*/
|
|
8
|
+
export interface DeriveClaimerWotsKeypairParams {
|
|
9
|
+
/** Must implement `deriveContextHash` — the only wallet prompt in the claim. */
|
|
10
|
+
btcWallet: BitcoinWallet;
|
|
11
|
+
/** Same context that produced this vault's secrets at deposit time. */
|
|
12
|
+
vaultContext: VaultContextInput;
|
|
13
|
+
/** HTLC output index of this vault within the Pre-PegIn transaction. */
|
|
14
|
+
htlcVout: number;
|
|
15
|
+
/** JSON-serialized TxGraph the keypair must match. */
|
|
16
|
+
txGraphJson: string;
|
|
17
|
+
/** Graph version. Delegated claim requires 3. */
|
|
18
|
+
txGraphVersion: number;
|
|
19
|
+
/**
|
|
20
|
+
* `depositorWotsPkHash` as the vault records it on chain, `0x`-prefixed.
|
|
21
|
+
*
|
|
22
|
+
* This is the only anchor here the vault provider does not supply. The
|
|
23
|
+
* graph check below compares against VP-served bytes, so it cannot tell a
|
|
24
|
+
* wrong `htlcVout`, a wrong wallet account, or expander drift after a
|
|
25
|
+
* WASM re-pin from a correct derivation.
|
|
26
|
+
*/
|
|
27
|
+
expectedWotsPkHash: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* The `wots_keypair.json` content and the hash it commits to.
|
|
31
|
+
*
|
|
32
|
+
* @experimental
|
|
33
|
+
*/
|
|
34
|
+
export interface ClaimerWotsKeypair {
|
|
35
|
+
/**
|
|
36
|
+
* Content of `wots_keypair.json`, ready to write verbatim. Secret and
|
|
37
|
+
* single-use: never log it, never persist it beyond the claim, and never
|
|
38
|
+
* reuse it — reuse across claims leaks the WOTS key.
|
|
39
|
+
*/
|
|
40
|
+
wotsKeypairJson: string;
|
|
41
|
+
/** `0x`-prefixed hash of the public keys, matching `depositorWotsPkHash`. */
|
|
42
|
+
pkHash: string;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Re-derives the depositor's WOTS keypair and checks it against the vault's
|
|
46
|
+
* on-chain commitment and against the graph.
|
|
47
|
+
*
|
|
48
|
+
* The validation is the point of this function, not a formality: an unbound
|
|
49
|
+
* keypair produces an Assert witness no verifier accepts, and that failure
|
|
50
|
+
* would otherwise surface only after the Claim has been broadcast and the
|
|
51
|
+
* PegIn UTXO is already spent. The on-chain hash is checked first, because
|
|
52
|
+
* it is the one value here the vault provider cannot choose.
|
|
53
|
+
*
|
|
54
|
+
* Experimental: this API can change in a minor release. Pin the SDK
|
|
55
|
+
* version if you build on it.
|
|
56
|
+
*
|
|
57
|
+
* @throws If the derivation does not match the vault's on-chain
|
|
58
|
+
* `depositorWotsPkHash`, or the WOTS public keys the graph's Claim
|
|
59
|
+
* commits to.
|
|
60
|
+
* @experimental
|
|
61
|
+
*/
|
|
62
|
+
export declare function deriveClaimerWotsKeypair(params: DeriveClaimerWotsKeypairParams): Promise<ClaimerWotsKeypair>;
|
|
63
|
+
//# sourceMappingURL=deriveClaimerWotsKeypair.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deriveClaimerWotsKeypair.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/services/delegated-claim/deriveClaimerWotsKeypair.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AAE3E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAM7D;;;;GAIG;AACH,MAAM,WAAW,8BAA8B;IAC7C,gFAAgF;IAChF,SAAS,EAAE,aAAa,CAAC;IACzB,uEAAuE;IACvE,YAAY,EAAE,iBAAiB,CAAC;IAChC,wEAAwE;IACxE,QAAQ,EAAE,MAAM,CAAC;IACjB,sDAAsD;IACtD,WAAW,EAAE,MAAM,CAAC;IACpB,iDAAiD;IACjD,cAAc,EAAE,MAAM,CAAC;IACvB;;;;;;;OAOG;IACH,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAED;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IACjC;;;;OAIG;IACH,eAAe,EAAE,MAAM,CAAC;IACxB,6EAA6E;IAC7E,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,wBAAwB,CAC5C,MAAM,EAAE,8BAA8B,GACrC,OAAO,CAAC,kBAAkB,CAAC,CA4B7B"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Delegated claim (depositor-as-claimer) — artifact assembly and claim-time
|
|
3
|
+
* execution.
|
|
4
|
+
*
|
|
5
|
+
* EXPERIMENTAL. This surface is still under test. It has been exercised end
|
|
6
|
+
* to end on signet, not on mainnet, and no caller ships in this repo yet.
|
|
7
|
+
* Treat the shape of every export here as provisional: names, parameters and
|
|
8
|
+
* return types can change in a minor release. Pin the SDK version if you
|
|
9
|
+
* build on it. The on-chain and file formats are not provisional — those are
|
|
10
|
+
* owned by btc-vault and by the `VAULT_WASM_COMMIT` pin.
|
|
11
|
+
*
|
|
12
|
+
* Produces and checks the two files a claim runs from: `artifacts.json` and
|
|
13
|
+
* `wots_keypair.json`. `vaultd vp wt` reads the same pair, so either can drive
|
|
14
|
+
* the claim.
|
|
15
|
+
*
|
|
16
|
+
* Claim time is here as well. From an assembled `artifacts.json` this module
|
|
17
|
+
* pins the Groth16 proof, finalizes the Assert, and produces the Payout and
|
|
18
|
+
* WronglyChallenged transactions, so a depositor whose vault provider is gone
|
|
19
|
+
* completes a claim without running the CLI.
|
|
20
|
+
*
|
|
21
|
+
* Two things stay outside: the proof itself comes from the prover service,
|
|
22
|
+
* and nothing here watches the chain — a ChallengeAssert must be answered
|
|
23
|
+
* inside `timelock_challenge_assert`, and noticing one is the caller's job.
|
|
24
|
+
*
|
|
25
|
+
* @see btc-vault docs/delegated_claim.md
|
|
26
|
+
* @module services/delegated-claim
|
|
27
|
+
*/
|
|
28
|
+
export { assembleWatchtowerArtifacts, type AssembleWatchtowerArtifactsParams, } from './assembleWatchtowerArtifacts';
|
|
29
|
+
export { deriveClaimerWotsKeypair, type ClaimerWotsKeypair, type DeriveClaimerWotsKeypairParams, } from './deriveClaimerWotsKeypair';
|
|
30
|
+
export { ArtifactsVaultMismatchError, DELEGATED_CLAIM_TX_GRAPH_VERSION, assertArtifactsUsableForVault, summarizeWatchtowerArtifacts, type AssertArtifactsUsableParams, } from './readWatchtowerArtifacts';
|
|
31
|
+
export { ChallengerSetMismatchError, assertChallengerSetMatchesVault, type AssertChallengerSetMatchesVaultParams, } from './challengerBinding';
|
|
32
|
+
export { PayoutDestinationError, assertPayoutPaysRegisteredScript, type AssertPayoutPaysRegisteredScriptParams, } from './payoutBinding';
|
|
33
|
+
export { VaultIdBindingError, assertClaimSpendsVault, type AssertClaimSpendsVaultParams, } from './vaultIdBinding';
|
|
34
|
+
export type { ClaimerArtifactsSource, DelegatedClaimVaultContext, WatchtowerArtifactsSummary, } from './types';
|
|
35
|
+
/**
|
|
36
|
+
* Claim-time execution, artifacts in and artifacts out.
|
|
37
|
+
*
|
|
38
|
+
* The least settled part of an already experimental module: these four are
|
|
39
|
+
* re-exports of the WASM surface and have no caller in this repo. They were
|
|
40
|
+
* run end to end on signet from a browser page that is not part of this
|
|
41
|
+
* package. Expect them to be reshaped, renamed, or wrapped before they are
|
|
42
|
+
* stable.
|
|
43
|
+
*
|
|
44
|
+
* `pinPegoutProof` verifies the prover's Groth16 proof and writes it into the
|
|
45
|
+
* artifacts; `attachFinalizedAssert` then finalizes the Assert from that
|
|
46
|
+
* pinned proof and the depositor's WOTS keypair, so the keypair never leaves
|
|
47
|
+
* the caller. `finalizePayout` and `finalizeWronglyChallenged` return
|
|
48
|
+
* broadcastable transaction hex from the signatures the file already carries.
|
|
49
|
+
*
|
|
50
|
+
* Persist the JSON `pinPegoutProof` returns before the Assert is broadcast: a
|
|
51
|
+
* one-time WOTS keypair signs exactly one proof, and a second, different one
|
|
52
|
+
* is refused.
|
|
53
|
+
*/
|
|
54
|
+
export { pinPegoutProof, attachFinalizedAssert, finalizePayout, finalizeWronglyChallenged, } from '../../wasm';
|
|
55
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/services/delegated-claim/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EACL,2BAA2B,EAC3B,KAAK,iCAAiC,GACvC,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,wBAAwB,EACxB,KAAK,kBAAkB,EACvB,KAAK,8BAA8B,GACpC,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,2BAA2B,EAC3B,gCAAgC,EAChC,6BAA6B,EAC7B,4BAA4B,EAC5B,KAAK,2BAA2B,GACjC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,0BAA0B,EAC1B,+BAA+B,EAC/B,KAAK,qCAAqC,GAC3C,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,sBAAsB,EACtB,gCAAgC,EAChC,KAAK,sCAAsC,GAC5C,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EACtB,KAAK,4BAA4B,GAClC,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EACV,sBAAsB,EACtB,0BAA0B,EAC1B,0BAA0B,GAC3B,MAAM,SAAS,CAAC;AAEjB;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EACL,cAAc,EACd,qBAAqB,EACrB,cAAc,EACd,yBAAyB,GAC1B,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Binding between a delegated-claim Payout and the destination the vault
|
|
3
|
+
* registered on chain.
|
|
4
|
+
*
|
|
5
|
+
* The Payout transaction is built by the vault provider and moves the whole
|
|
6
|
+
* recovered peg-in. Its outputs are the one thing in this flow that decides
|
|
7
|
+
* where the money lands, and nothing in the artifacts file constrains them:
|
|
8
|
+
* the Rust verification proves the bundled signatures are self-consistent
|
|
9
|
+
* with the same graph that named the outputs. So a graph correctly bound to
|
|
10
|
+
* this vault can still carry a Payout that pays somebody else, and the
|
|
11
|
+
* depositor would sign it in the same prompt as everything else.
|
|
12
|
+
*
|
|
13
|
+
* This is the claim-side counterpart of `assertPayoutOutputLayout` in
|
|
14
|
+
* `primitives/psbt/payout.ts`, which the deposit-time path already runs for
|
|
15
|
+
* the same `depositor-as-claimer` role. It pins the same four things: the
|
|
16
|
+
* output count, the payout script, the CPFP anchor value, and the version
|
|
17
|
+
* and locktime the depositor's signature commits to.
|
|
18
|
+
*
|
|
19
|
+
* @module services/delegated-claim/payoutBinding
|
|
20
|
+
*/
|
|
21
|
+
/**
|
|
22
|
+
* Thrown when a Payout does not pay the vault's registered destination.
|
|
23
|
+
*
|
|
24
|
+
* @experimental
|
|
25
|
+
*/
|
|
26
|
+
export declare class PayoutDestinationError extends Error {
|
|
27
|
+
/** The vault's registered payout scriptPubKey, hex. */
|
|
28
|
+
readonly expectedScriptHex: string;
|
|
29
|
+
/** The scriptPubKey the Payout actually pays, hex. */
|
|
30
|
+
readonly actualScriptHex: string;
|
|
31
|
+
constructor(
|
|
32
|
+
/** The vault's registered payout scriptPubKey, hex. */
|
|
33
|
+
expectedScriptHex: string,
|
|
34
|
+
/** The scriptPubKey the Payout actually pays, hex. */
|
|
35
|
+
actualScriptHex: string);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* The Payout to check, and the destination it must pay.
|
|
39
|
+
*
|
|
40
|
+
* @experimental
|
|
41
|
+
*/
|
|
42
|
+
export interface AssertPayoutPaysRegisteredScriptParams {
|
|
43
|
+
/** A Payout signing PSBT, base64, as the graph produced it. */
|
|
44
|
+
payoutPsbtBase64: string;
|
|
45
|
+
/**
|
|
46
|
+
* `depositorPayoutScriptPubKey` as the vault registered it on chain, hex.
|
|
47
|
+
* The vault provider does not choose this value, which is the whole point
|
|
48
|
+
* of comparing against it.
|
|
49
|
+
*/
|
|
50
|
+
registeredPayoutScriptPubKey: string;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Throws unless the Payout pays the vault's registered payout script.
|
|
54
|
+
*
|
|
55
|
+
* Run this on every Payout PSBT before the wallet is prompted. Both the
|
|
56
|
+
* depositor and the claimer PSBT describe the same transaction, so both must
|
|
57
|
+
* pass; checking only one would leave the other free to differ.
|
|
58
|
+
*
|
|
59
|
+
* @throws {@link PayoutDestinationError} when output 0 pays elsewhere, or a
|
|
60
|
+
* plain error when the layout is not the canonical claimer layout.
|
|
61
|
+
*
|
|
62
|
+
* @experimental
|
|
63
|
+
*/
|
|
64
|
+
export declare function assertPayoutPaysRegisteredScript(params: AssertPayoutPaysRegisteredScriptParams): void;
|
|
65
|
+
//# sourceMappingURL=payoutBinding.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payoutBinding.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/services/delegated-claim/payoutBinding.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAgBH;;;;GAIG;AACH,qBAAa,sBAAuB,SAAQ,KAAK;IAE7C,uDAAuD;IACvD,QAAQ,CAAC,iBAAiB,EAAE,MAAM;IAClC,sDAAsD;IACtD,QAAQ,CAAC,eAAe,EAAE,MAAM;;IAHhC,uDAAuD;IAC9C,iBAAiB,EAAE,MAAM;IAClC,sDAAsD;IAC7C,eAAe,EAAE,MAAM;CAUnC;AAED;;;;GAIG;AACH,MAAM,WAAW,sCAAsC;IACrD,+DAA+D;IAC/D,gBAAgB,EAAE,MAAM,CAAC;IACzB;;;;OAIG;IACH,4BAA4B,EAAE,MAAM,CAAC;CACtC;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,gCAAgC,CAC9C,MAAM,EAAE,sCAAsC,GAC7C,IAAI,CAmDN"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { WatchtowerArtifactsSummary } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Graph version the delegated-claim artifacts format exists for. Vaults on
|
|
4
|
+
* graph v1 and v2 predate it and have no artifacts path at all.
|
|
5
|
+
*
|
|
6
|
+
* @experimental
|
|
7
|
+
*/
|
|
8
|
+
export declare const DELEGATED_CLAIM_TX_GRAPH_VERSION = 3;
|
|
9
|
+
/**
|
|
10
|
+
* Thrown when an artifacts file does not describe the vault being claimed.
|
|
11
|
+
*
|
|
12
|
+
* @experimental
|
|
13
|
+
*/
|
|
14
|
+
export declare class ArtifactsVaultMismatchError extends Error {
|
|
15
|
+
readonly expectedVaultId: string;
|
|
16
|
+
readonly actualVaultId: string;
|
|
17
|
+
constructor(expectedVaultId: string, actualVaultId: string);
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Reads the small, self-describing fields of an artifacts file.
|
|
21
|
+
*
|
|
22
|
+
* This parses the whole JSON, so it is bounded by whatever the file carries
|
|
23
|
+
* in `babe_sessions`. Keep those sessions in their own file: a bundle with
|
|
24
|
+
* real sessions runs to hundreds of megabytes per challenger and cannot be
|
|
25
|
+
* parsed in a browser tab.
|
|
26
|
+
*
|
|
27
|
+
* Experimental: this API can change in a minor release. Pin the SDK
|
|
28
|
+
* version if you build on it.
|
|
29
|
+
*
|
|
30
|
+
* @throws If the file is not JSON, or lacks the fields every artifacts file
|
|
31
|
+
* has.
|
|
32
|
+
* @experimental
|
|
33
|
+
*/
|
|
34
|
+
export declare function summarizeWatchtowerArtifacts(artifactsJson: string): WatchtowerArtifactsSummary;
|
|
35
|
+
/**
|
|
36
|
+
* The file to check, and the vault it must belong to.
|
|
37
|
+
*
|
|
38
|
+
* @experimental
|
|
39
|
+
*/
|
|
40
|
+
export interface AssertArtifactsUsableParams {
|
|
41
|
+
artifactsJson: string;
|
|
42
|
+
/** Vault the caller intends to claim, `0x`-prefixed or bare hex. */
|
|
43
|
+
expectedVaultId: string;
|
|
44
|
+
/**
|
|
45
|
+
* Depositor's Ethereum address, used with the file's PegIn txid to
|
|
46
|
+
* re-derive the vault id. Without it the only check would be the file's
|
|
47
|
+
* self-declared `vault_id`.
|
|
48
|
+
*/
|
|
49
|
+
depositorEthAddress: string;
|
|
50
|
+
/**
|
|
51
|
+
* Graph version to verify under. Defaults to the only version the format
|
|
52
|
+
* exists for. A file that records a different `vault_core_version` is
|
|
53
|
+
* rejected rather than verified under this one.
|
|
54
|
+
*/
|
|
55
|
+
txGraphVersion?: number;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Verifies an artifacts file and confirms it is the one for this vault.
|
|
59
|
+
*
|
|
60
|
+
* Experimental: this API can change in a minor release. Pin the SDK
|
|
61
|
+
* version if you build on it.
|
|
62
|
+
*
|
|
63
|
+
* @throws {@link ArtifactsVaultMismatchError} when the file names a different
|
|
64
|
+
* vault, {@link VaultIdBindingError} when the graph it carries
|
|
65
|
+
* belongs to another vault whatever the file says, or a verification
|
|
66
|
+
* error when any bundled signature does not hold against that graph.
|
|
67
|
+
* @experimental
|
|
68
|
+
*/
|
|
69
|
+
export declare function assertArtifactsUsableForVault(params: AssertArtifactsUsableParams): Promise<WatchtowerArtifactsSummary>;
|
|
70
|
+
//# sourceMappingURL=readWatchtowerArtifacts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"readWatchtowerArtifacts.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/services/delegated-claim/readWatchtowerArtifacts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAMH,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAC;AAO1D;;;;;GAKG;AACH,eAAO,MAAM,gCAAgC,IAAI,CAAC;AAElD;;;;GAIG;AACH,qBAAa,2BAA4B,SAAQ,KAAK;IAElD,QAAQ,CAAC,eAAe,EAAE,MAAM;IAChC,QAAQ,CAAC,aAAa,EAAE,MAAM;gBADrB,eAAe,EAAE,MAAM,EACvB,aAAa,EAAE,MAAM;CAQjC;AAYD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,4BAA4B,CAC1C,aAAa,EAAE,MAAM,GACpB,0BAA0B,CA2C5B;AAED;;;;GAIG;AACH,MAAM,WAAW,2BAA2B;IAC1C,aAAa,EAAE,MAAM,CAAC;IACtB,oEAAoE;IACpE,eAAe,EAAE,MAAM,CAAC;IACxB;;;;OAIG;IACH,mBAAmB,EAAE,MAAM,CAAC;IAC5B;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,6BAA6B,CACjD,MAAM,EAAE,2BAA2B,GAClC,OAAO,CAAC,0BAA0B,CAAC,CA+CrC"}
|