@babylonlabs-io/ts-sdk 0.79.1 → 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.
Files changed (187) hide show
  1. package/README.md +11 -5
  2. package/dist/{signPsbtsWithFallback-f7QLp0q8.js → PayoutManager-CHTOwj0E.js} +26 -26
  3. package/dist/PayoutManager-CHTOwj0E.js.map +1 -0
  4. package/dist/PayoutManager-CpfQjtL0.cjs +2 -0
  5. package/dist/PayoutManager-CpfQjtL0.cjs.map +1 -0
  6. package/dist/PeginManager-6tjlGd0t.cjs +2 -0
  7. package/dist/PeginManager-6tjlGd0t.cjs.map +1 -0
  8. package/dist/{PeginManager-BXlh3ar0.js → PeginManager-DEldv_Ro.js} +23 -22
  9. package/dist/PeginManager-DEldv_Ro.js.map +1 -0
  10. package/dist/buildAndBroadcastReclaim-BwT6Jxp5.cjs +2 -0
  11. package/dist/buildAndBroadcastReclaim-BwT6Jxp5.cjs.map +1 -0
  12. package/dist/buildAndBroadcastReclaim-CqO2DoP8.js +1919 -0
  13. package/dist/buildAndBroadcastReclaim-CqO2DoP8.js.map +1 -0
  14. package/dist/challengeAssert-Cp_GeRg8.js.map +1 -1
  15. package/dist/challengeAssert-Z7_YULBb.cjs.map +1 -1
  16. package/dist/deriveVaultRoot-BwbXmN0x.js +79 -0
  17. package/dist/deriveVaultRoot-BwbXmN0x.js.map +1 -0
  18. package/dist/deriveVaultRoot-DvhkHzNb.cjs +2 -0
  19. package/dist/deriveVaultRoot-DvhkHzNb.cjs.map +1 -0
  20. package/dist/index.cjs +1 -1
  21. package/dist/index.js +286 -268
  22. package/dist/index.js.map +1 -1
  23. package/dist/noPayout-DAWBQ0eG.cjs +2 -0
  24. package/dist/noPayout-DAWBQ0eG.cjs.map +1 -0
  25. package/dist/{noPayout-DiGr4eas.js → noPayout-qBXWKwav.js} +3 -3
  26. package/dist/noPayout-qBXWKwav.js.map +1 -0
  27. package/dist/onChainBtcPubkey-BXry_CM4.cjs +2 -0
  28. package/dist/onChainBtcPubkey-BXry_CM4.cjs.map +1 -0
  29. package/dist/onChainBtcPubkey-C1WqyxPM.js +159 -0
  30. package/dist/onChainBtcPubkey-C1WqyxPM.js.map +1 -0
  31. package/dist/parseFundingOutpoints-C_-PT9BT.cjs +2 -0
  32. package/dist/parseFundingOutpoints-C_-PT9BT.cjs.map +1 -0
  33. package/dist/parseFundingOutpoints-GSM-IaaK.js +17 -0
  34. package/dist/parseFundingOutpoints-GSM-IaaK.js.map +1 -0
  35. package/dist/{pegin-registration-client-pcczkzMg.js → pegin-registration-client-1sZ-74UC.js} +260 -383
  36. package/dist/pegin-registration-client-1sZ-74UC.js.map +1 -0
  37. package/dist/pegin-registration-client-BNV44jzw.cjs +2 -0
  38. package/dist/pegin-registration-client-BNV44jzw.cjs.map +1 -0
  39. package/dist/shared/index.cjs.map +1 -1
  40. package/dist/shared/index.js.map +1 -1
  41. package/dist/shared/wallets/interfaces/BitcoinWallet.d.ts +6 -3
  42. package/dist/shared/wallets/interfaces/BitcoinWallet.d.ts.map +1 -1
  43. package/dist/signing-3l5Aqd-H.cjs +2 -0
  44. package/dist/signing-3l5Aqd-H.cjs.map +1 -0
  45. package/dist/signing-Dhr2t0Z6.js +39 -0
  46. package/dist/signing-Dhr2t0Z6.js.map +1 -0
  47. package/dist/tbv/core/clients/eth/index.cjs +1 -1
  48. package/dist/tbv/core/clients/eth/index.js +8 -8
  49. package/dist/tbv/core/clients/index.cjs +1 -1
  50. package/dist/tbv/core/clients/index.js +8 -8
  51. package/dist/tbv/core/index.cjs +1 -1
  52. package/dist/tbv/core/index.d.ts +1 -1
  53. package/dist/tbv/core/index.js +284 -266
  54. package/dist/tbv/core/index.js.map +1 -1
  55. package/dist/tbv/core/managers/PayoutManager.d.ts +1 -1
  56. package/dist/tbv/core/managers/PeginManager.d.ts +1 -1
  57. package/dist/tbv/core/managers/index.cjs +1 -1
  58. package/dist/tbv/core/managers/index.js +2 -2
  59. package/dist/tbv/core/primitives/index.cjs +1 -1
  60. package/dist/tbv/core/primitives/index.d.ts +1 -1
  61. package/dist/tbv/core/primitives/index.js +3 -3
  62. package/dist/tbv/core/primitives/psbt/__tests__/assertPeginTxShape.test.d.ts +5 -3
  63. package/dist/tbv/core/primitives/psbt/__tests__/assertPeginTxShape.test.d.ts.map +1 -1
  64. package/dist/tbv/core/primitives/psbt/__tests__/deriveExpectedPeginPayoutScriptPubKey.test.d.ts +8 -0
  65. package/dist/tbv/core/primitives/psbt/__tests__/deriveExpectedPeginPayoutScriptPubKey.test.d.ts.map +1 -0
  66. package/dist/tbv/core/primitives/psbt/assertWasmPeginSizing.d.ts +6 -0
  67. package/dist/tbv/core/primitives/psbt/assertWasmPeginSizing.d.ts.map +1 -1
  68. package/dist/tbv/core/primitives/psbt/challengeAssert.d.ts +2 -2
  69. package/dist/tbv/core/primitives/psbt/challengeAssert.d.ts.map +1 -1
  70. package/dist/tbv/core/primitives/psbt/noPayout.d.ts +1 -1
  71. package/dist/tbv/core/primitives/psbt/noPayout.d.ts.map +1 -1
  72. package/dist/tbv/core/primitives/psbt/payout.d.ts +13 -7
  73. package/dist/tbv/core/primitives/psbt/payout.d.ts.map +1 -1
  74. package/dist/tbv/core/primitives/psbt/pegin.d.ts +4 -1
  75. package/dist/tbv/core/primitives/psbt/pegin.d.ts.map +1 -1
  76. package/dist/tbv/core/recovery/recoveryErrors.d.ts +1 -1
  77. package/dist/tbv/core/services/delegated-claim/__tests__/assembleWatchtowerArtifacts.test.d.ts +15 -0
  78. package/dist/tbv/core/services/delegated-claim/__tests__/assembleWatchtowerArtifacts.test.d.ts.map +1 -0
  79. package/dist/tbv/core/services/delegated-claim/__tests__/deriveClaimerWotsKeypair.test.d.ts +11 -0
  80. package/dist/tbv/core/services/delegated-claim/__tests__/deriveClaimerWotsKeypair.test.d.ts.map +1 -0
  81. package/dist/tbv/core/services/delegated-claim/__tests__/readWatchtowerArtifacts.test.d.ts +10 -0
  82. package/dist/tbv/core/services/delegated-claim/__tests__/readWatchtowerArtifacts.test.d.ts.map +1 -0
  83. package/dist/tbv/core/services/delegated-claim/__tests__/vaultIdBinding.test.d.ts +10 -0
  84. package/dist/tbv/core/services/delegated-claim/__tests__/vaultIdBinding.test.d.ts.map +1 -0
  85. package/dist/tbv/core/services/delegated-claim/__tests__/wotsKeypair.golden.test.d.ts +11 -0
  86. package/dist/tbv/core/services/delegated-claim/__tests__/wotsKeypair.golden.test.d.ts.map +1 -0
  87. package/dist/tbv/core/services/delegated-claim/assembleWatchtowerArtifacts.d.ts +46 -0
  88. package/dist/tbv/core/services/delegated-claim/assembleWatchtowerArtifacts.d.ts.map +1 -0
  89. package/dist/tbv/core/services/delegated-claim/challengerBinding.d.ts +72 -0
  90. package/dist/tbv/core/services/delegated-claim/challengerBinding.d.ts.map +1 -0
  91. package/dist/tbv/core/services/delegated-claim/deriveClaimerWotsKeypair.d.ts +63 -0
  92. package/dist/tbv/core/services/delegated-claim/deriveClaimerWotsKeypair.d.ts.map +1 -0
  93. package/dist/tbv/core/services/delegated-claim/index.d.ts +55 -0
  94. package/dist/tbv/core/services/delegated-claim/index.d.ts.map +1 -0
  95. package/dist/tbv/core/services/delegated-claim/payoutBinding.d.ts +65 -0
  96. package/dist/tbv/core/services/delegated-claim/payoutBinding.d.ts.map +1 -0
  97. package/dist/tbv/core/services/delegated-claim/readWatchtowerArtifacts.d.ts +70 -0
  98. package/dist/tbv/core/services/delegated-claim/readWatchtowerArtifacts.d.ts.map +1 -0
  99. package/dist/tbv/core/services/delegated-claim/types.d.ts +105 -0
  100. package/dist/tbv/core/services/delegated-claim/types.d.ts.map +1 -0
  101. package/dist/tbv/core/services/delegated-claim/vaultIdBinding.d.ts +44 -0
  102. package/dist/tbv/core/services/delegated-claim/vaultIdBinding.d.ts.map +1 -0
  103. package/dist/tbv/core/services/index.cjs +1 -1
  104. package/dist/tbv/core/services/index.d.ts +1 -0
  105. package/dist/tbv/core/services/index.d.ts.map +1 -1
  106. package/dist/tbv/core/services/index.js +73 -56
  107. package/dist/tbv/core/services/index.js.map +1 -1
  108. package/dist/tbv/core/utils/index.cjs +1 -1
  109. package/dist/tbv/core/utils/index.js +44 -43
  110. package/dist/tbv/core/utils/signing.d.ts +24 -0
  111. package/dist/tbv/core/utils/signing.d.ts.map +1 -1
  112. package/dist/tbv/core/vault-secrets/__tests__/context.golden.test.d.ts +4 -4
  113. package/dist/tbv/core/vault-secrets/__tests__/context.test.d.ts +1 -2
  114. package/dist/tbv/core/vault-secrets/__tests__/context.test.d.ts.map +1 -1
  115. package/dist/tbv/core/vault-secrets/__tests__/deriveContextHash.vectors.test.d.ts +40 -0
  116. package/dist/tbv/core/vault-secrets/__tests__/deriveContextHash.vectors.test.d.ts.map +1 -0
  117. package/dist/tbv/core/vault-secrets/context.d.ts +2 -2
  118. package/dist/tbv/core/vault-secrets/deriveVaultRoot.d.ts +5 -6
  119. package/dist/tbv/core/vault-secrets/deriveVaultRoot.d.ts.map +1 -1
  120. package/dist/tbv/core/vault-secrets/index.cjs +1 -1
  121. package/dist/tbv/core/vault-secrets/index.d.ts +2 -2
  122. package/dist/tbv/core/vault-secrets/index.js +9 -8
  123. package/dist/tbv/core/vault-secrets/index.js.map +1 -1
  124. package/dist/tbv/core/wasm/index.cjs +1 -1
  125. package/dist/tbv/core/wasm/index.cjs.map +1 -1
  126. package/dist/tbv/core/wasm/index.d.ts +113 -14
  127. package/dist/tbv/core/wasm/index.d.ts.map +1 -1
  128. package/dist/tbv/core/wasm/index.js +180 -94
  129. package/dist/tbv/core/wasm/index.js.map +1 -1
  130. package/dist/tbv/index.cjs +1 -1
  131. package/dist/tbv/index.js +284 -266
  132. package/dist/tbv/index.js.map +1 -1
  133. package/dist/tbv/integrations/aave/types.d.ts +1 -1
  134. package/dist/testing/MockBitcoinWallet.d.ts +1 -1
  135. package/dist/testing/index.cjs.map +1 -1
  136. package/dist/testing/index.js.map +1 -1
  137. package/dist/toRefundInputs-BaN9XluU.cjs +2 -0
  138. package/dist/toRefundInputs-BaN9XluU.cjs.map +1 -0
  139. package/dist/{toRefundInputs-9inv4Ai4.js → toRefundInputs-mtuuYezp.js} +24 -23
  140. package/dist/toRefundInputs-mtuuYezp.js.map +1 -0
  141. package/dist/{types-B9YhlXe8.js → types-BdCEoANP.js} +2 -2
  142. package/dist/{types-B9YhlXe8.js.map → types-BdCEoANP.js.map} +1 -1
  143. package/dist/{types-C1tpDycc.cjs → types-BuxreSq4.cjs} +2 -2
  144. package/dist/{types-C1tpDycc.cjs.map → types-BuxreSq4.cjs.map} +1 -1
  145. package/dist/{verifyKeyPathSchnorrSignature-BVtNwgK6.js → verifyKeyPathSchnorrSignature-BQHNhRj6.js} +2 -2
  146. package/dist/{verifyKeyPathSchnorrSignature-BVtNwgK6.js.map → verifyKeyPathSchnorrSignature-BQHNhRj6.js.map} +1 -1
  147. package/dist/{verifyKeyPathSchnorrSignature-BjB8Znly.cjs → verifyKeyPathSchnorrSignature-Gm9EmZkx.cjs} +2 -2
  148. package/dist/{verifyKeyPathSchnorrSignature-BjB8Znly.cjs.map → verifyKeyPathSchnorrSignature-Gm9EmZkx.cjs.map} +1 -1
  149. package/dist/verifyScriptPathSchnorrSignature-BKZihCjk.cjs +2 -0
  150. package/dist/verifyScriptPathSchnorrSignature-BKZihCjk.cjs.map +1 -0
  151. package/dist/{verifyScriptPathSchnorrSignature-D_epga4j.js → verifyScriptPathSchnorrSignature-CpjSTfMj.js} +371 -330
  152. package/dist/verifyScriptPathSchnorrSignature-CpjSTfMj.js.map +1 -0
  153. package/package.json +3 -3
  154. package/dist/PeginManager-BXlh3ar0.js.map +0 -1
  155. package/dist/PeginManager-BuVSknB0.cjs +0 -2
  156. package/dist/PeginManager-BuVSknB0.cjs.map +0 -1
  157. package/dist/buildAndBroadcastReclaim-N9dXH9dm.cjs +0 -2
  158. package/dist/buildAndBroadcastReclaim-N9dXH9dm.cjs.map +0 -1
  159. package/dist/buildAndBroadcastReclaim-O6z9kvc4.js +0 -1545
  160. package/dist/buildAndBroadcastReclaim-O6z9kvc4.js.map +0 -1
  161. package/dist/noPayout-4RZB2g1e.cjs +0 -2
  162. package/dist/noPayout-4RZB2g1e.cjs.map +0 -1
  163. package/dist/noPayout-DiGr4eas.js.map +0 -1
  164. package/dist/onChainBtcPubkey-BbxRrbvg.cjs +0 -2
  165. package/dist/onChainBtcPubkey-BbxRrbvg.cjs.map +0 -1
  166. package/dist/onChainBtcPubkey-C-6UWpD8.js +0 -34
  167. package/dist/onChainBtcPubkey-C-6UWpD8.js.map +0 -1
  168. package/dist/parseFundingOutpoints-B4iQeX6q.cjs +0 -2
  169. package/dist/parseFundingOutpoints-B4iQeX6q.cjs.map +0 -1
  170. package/dist/parseFundingOutpoints-BQWvINfm.js +0 -93
  171. package/dist/parseFundingOutpoints-BQWvINfm.js.map +0 -1
  172. package/dist/pegin-registration-client-CZgcU2_0.cjs +0 -2
  173. package/dist/pegin-registration-client-CZgcU2_0.cjs.map +0 -1
  174. package/dist/pegin-registration-client-pcczkzMg.js.map +0 -1
  175. package/dist/signPsbtsWithFallback-DtwzL5AA.cjs +0 -2
  176. package/dist/signPsbtsWithFallback-DtwzL5AA.cjs.map +0 -1
  177. package/dist/signPsbtsWithFallback-f7QLp0q8.js.map +0 -1
  178. package/dist/signing-BJ3X66b-.cjs +0 -2
  179. package/dist/signing-BJ3X66b-.cjs.map +0 -1
  180. package/dist/signing-Cm-McVR2.js +0 -22
  181. package/dist/signing-Cm-McVR2.js.map +0 -1
  182. package/dist/toRefundInputs-9inv4Ai4.js.map +0 -1
  183. package/dist/toRefundInputs-DitGWAnz.cjs +0 -2
  184. package/dist/toRefundInputs-DitGWAnz.cjs.map +0 -1
  185. package/dist/verifyScriptPathSchnorrSignature-D_epga4j.js.map +0 -1
  186. package/dist/verifyScriptPathSchnorrSignature-DaRqvEgW.cjs +0 -2
  187. package/dist/verifyScriptPathSchnorrSignature-DaRqvEgW.cjs.map +0 -1
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../../verifyScriptPathSchnorrSignature-DaRqvEgW.cjs"),s=require("../../../secp256k1-DDHQ1_za.cjs"),i=require("../wasm/index.cjs"),a=require("../../../verifyKeyPathSchnorrSignature-BjB8Znly.cjs"),r=require("../../../noPayout-4RZB2g1e.cjs"),n=require("../../../challengeAssert-Z7_YULBb.cjs"),e=require("../../../bitcoin-D-O2GjbC.cjs");exports.PEGIN_DEPOSITOR_CLAIM_VOUT=t.PEGIN_DEPOSITOR_CLAIM_VOUT;exports.PsbtSubstitutionError=t.PsbtSubstitutionError;exports.assertPsbtUnsignedTxMatches=t.assertPsbtUnsignedTxMatches;exports.assertScriptPathSchnorrSignature=t.assertScriptPathSchnorrSignature;exports.buildPayoutPsbt=t.buildPayoutPsbt;exports.buildPeginTxFromFundedPrePegin=t.buildPeginTxFromFundedPrePegin;exports.buildPrePeginPsbt=t.buildPrePeginPsbt;exports.computeNumLocalChallengers=t.computeNumLocalChallengers;exports.createPayoutScript=t.createPayoutScript;exports.deriveDepositorClaimDescriptor=t.deriveDepositorClaimDescriptor;exports.deriveDepositorClaimScriptPubKey=t.deriveDepositorClaimScriptPubKey;exports.extractPayoutSignature=t.extractPayoutSignature;exports.assertValidVaultCoreVersion=s.assertValidVaultCoreVersion;exports.computeMinClaimValue=i.computeMinClaimValue;exports.computeMinPeginFee=i.computeMinPeginFee;exports.deriveVaultId=i.deriveVaultId;exports.peginP2aAnchorOutput=i.peginP2aAnchorOutput;exports.supportedTxGraphVersions=i.supportedTxGraphVersions;exports.validatePeginP2aAnchor=i.validatePeginP2aAnchor;exports.assertKeyPathSchnorrSignature=a.assertKeyPathSchnorrSignature;exports.assertReturnedKeyPathSignatures=a.assertReturnedKeyPathSignatures;exports.buildPeginInputPsbt=a.buildPeginInputPsbt;exports.extractPeginInputSignature=a.extractPeginInputSignature;exports.finalizePeginInputPsbt=a.finalizePeginInputPsbt;exports.buildNoPayoutPsbt=r.buildNoPayoutPsbt;exports.buildReclaimPsbt=r.buildReclaimPsbt;exports.buildRefundPsbt=r.buildRefundPsbt;exports.estimateReclaimFeeSats=r.estimateReclaimFeeSats;exports.finalizeScriptPathWithSignatures=r.finalizeScriptPathWithSignatures;exports.reclaimVsize=r.reclaimVsize;exports.buildChallengeAssertPsbt=n.buildChallengeAssertPsbt;exports.canonicalizeBtcPubkey=e.canonicalizeBtcPubkey;exports.deriveBip86ScriptPubKeyHex=e.deriveBip86ScriptPubKeyHex;exports.deriveNativeSegwitAddress=e.deriveNativeSegwitAddress;exports.deriveTaprootAddress=e.deriveTaprootAddress;exports.ensureHexPrefix=e.ensureHexPrefix;exports.formatSatoshisToBtc=e.formatSatoshisToBtc;exports.getSortedXOnlyPubkeys=e.getSortedXOnlyPubkeys;exports.hexToUint8Array=e.hexToUint8Array;exports.isAddressFromPublicKey=e.isAddressFromPublicKey;exports.isValidHex=e.isValidHex;exports.processPublicKeyToXOnly=e.processPublicKeyToXOnly;exports.stripHexPrefix=e.stripHexPrefix;exports.toXOnly=e.toXOnly;exports.uint8ArrayToHex=e.uint8ArrayToHex;exports.validateWalletPubkey=e.validateWalletPubkey;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../../verifyScriptPathSchnorrSignature-BKZihCjk.cjs"),s=require("../../../secp256k1-DDHQ1_za.cjs"),i=require("../wasm/index.cjs"),a=require("../../../verifyKeyPathSchnorrSignature-Gm9EmZkx.cjs"),r=require("../../../noPayout-DAWBQ0eG.cjs"),n=require("../../../challengeAssert-Z7_YULBb.cjs"),e=require("../../../bitcoin-D-O2GjbC.cjs");exports.PEGIN_DEPOSITOR_CLAIM_VOUT=t.PEGIN_DEPOSITOR_CLAIM_VOUT;exports.PsbtSubstitutionError=t.PsbtSubstitutionError;exports.assertPsbtUnsignedTxMatches=t.assertPsbtUnsignedTxMatches;exports.assertScriptPathSchnorrSignature=t.assertScriptPathSchnorrSignature;exports.buildPayoutPsbt=t.buildPayoutPsbt;exports.buildPeginTxFromFundedPrePegin=t.buildPeginTxFromFundedPrePegin;exports.buildPrePeginPsbt=t.buildPrePeginPsbt;exports.computeNumLocalChallengers=t.computeNumLocalChallengers;exports.createPayoutScript=t.createPayoutScript;exports.deriveDepositorClaimDescriptor=t.deriveDepositorClaimDescriptor;exports.deriveDepositorClaimScriptPubKey=t.deriveDepositorClaimScriptPubKey;exports.extractPayoutSignature=t.extractPayoutSignature;exports.assertValidVaultCoreVersion=s.assertValidVaultCoreVersion;exports.computeMinClaimValue=i.computeMinClaimValue;exports.computeMinPeginFee=i.computeMinPeginFee;exports.deriveVaultId=i.deriveVaultId;exports.peginP2aAnchorOutput=i.peginP2aAnchorOutput;exports.supportedTxGraphVersions=i.supportedTxGraphVersions;exports.validatePeginP2aAnchor=i.validatePeginP2aAnchor;exports.assertKeyPathSchnorrSignature=a.assertKeyPathSchnorrSignature;exports.assertReturnedKeyPathSignatures=a.assertReturnedKeyPathSignatures;exports.buildPeginInputPsbt=a.buildPeginInputPsbt;exports.extractPeginInputSignature=a.extractPeginInputSignature;exports.finalizePeginInputPsbt=a.finalizePeginInputPsbt;exports.buildNoPayoutPsbt=r.buildNoPayoutPsbt;exports.buildReclaimPsbt=r.buildReclaimPsbt;exports.buildRefundPsbt=r.buildRefundPsbt;exports.estimateReclaimFeeSats=r.estimateReclaimFeeSats;exports.finalizeScriptPathWithSignatures=r.finalizeScriptPathWithSignatures;exports.reclaimVsize=r.reclaimVsize;exports.buildChallengeAssertPsbt=n.buildChallengeAssertPsbt;exports.canonicalizeBtcPubkey=e.canonicalizeBtcPubkey;exports.deriveBip86ScriptPubKeyHex=e.deriveBip86ScriptPubKeyHex;exports.deriveNativeSegwitAddress=e.deriveNativeSegwitAddress;exports.deriveTaprootAddress=e.deriveTaprootAddress;exports.ensureHexPrefix=e.ensureHexPrefix;exports.formatSatoshisToBtc=e.formatSatoshisToBtc;exports.getSortedXOnlyPubkeys=e.getSortedXOnlyPubkeys;exports.hexToUint8Array=e.hexToUint8Array;exports.isAddressFromPublicKey=e.isAddressFromPublicKey;exports.isValidHex=e.isValidHex;exports.processPublicKeyToXOnly=e.processPublicKeyToXOnly;exports.stripHexPrefix=e.stripHexPrefix;exports.toXOnly=e.toXOnly;exports.uint8ArrayToHex=e.uint8ArrayToHex;exports.validateWalletPubkey=e.validateWalletPubkey;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -44,7 +44,7 @@
44
44
  * - {@link buildPayoutPsbt} - Create payout PSBT for signing
45
45
  * - {@link extractPayoutSignature} - Extract Schnorr signature from signed PSBT
46
46
  * - {@link buildNoPayoutPsbt} - Create NoPayout PSBT per challenger (depositor-as-claimer path)
47
- * - {@link buildChallengeAssertPsbt} - Create ChallengeAssert PSBT per challenger (depositor-as-claimer path)
47
+ * - {@link buildChallengeAssertPsbt} - Create ChallengeAssert PSBT (tooling only; not claimer-signed)
48
48
  *
49
49
  * ### Script Generators
50
50
  * - {@link createPayoutScript} - Generate taproot payout script
@@ -1,8 +1,8 @@
1
- import { P as s, h as t, i as r, j as i, f as o, b as u, a as n, c as P, k as l, d, e as c, g as b } from "../../../verifyScriptPathSchnorrSignature-D_epga4j.js";
1
+ import { P as s, h as t, i as r, j as i, f as o, b as u, a as n, c as P, k as l, d, e as c, g as b } from "../../../verifyScriptPathSchnorrSignature-CpjSTfMj.js";
2
2
  import { a as g } from "../../../secp256k1-D-H9jmd7.js";
3
3
  import { computeMinClaimValue as x, computeMinPeginFee as S, deriveVaultId as y, peginP2aAnchorOutput as f, supportedTxGraphVersions as h, validatePeginP2aAnchor as v } from "../wasm/index.js";
4
- import { a as A, c as V, b as C, e as I, f as O } from "../../../verifyKeyPathSchnorrSignature-BVtNwgK6.js";
5
- import { c as F, a as H, b as R, e as k, f as z, r as D } from "../../../noPayout-DiGr4eas.js";
4
+ import { a as A, c as V, b as C, e as I, f as O } from "../../../verifyKeyPathSchnorrSignature-BQHNhRj6.js";
5
+ import { c as F, a as H, b as R, e as k, f as z, r as D } from "../../../noPayout-qBXWKwav.js";
6
6
  import { b as N } from "../../../challengeAssert-Cp_GeRg8.js";
7
7
  import { c as E, d as U, a as X, b as _, e as j, f as G, g as L, h as W, i as w, j as q, p as J, s as Q, t as Y, u as Z, v as $ } from "../../../bitcoin-C-TuHb-v.js";
8
8
  export {
@@ -2,9 +2,11 @@
2
2
  * Negative-path tests for the PegIn shape assertion inside
3
3
  * `buildPeginTxFromFundedPrePegin`: every bind (header, input, output count,
4
4
  * vault value/script, txid, depositor-claim value/script, anchor validation)
5
- * must reject a doctored WASM result. The WASM boundary is mocked so each
6
- * dimension can be corrupted independently; the happy path against the real
7
- * binary is covered by the golden vectors in `pegin.test.ts`.
5
+ * must reject a doctored WASM result. `buildPeginTxFromFundedPrePegin` also
6
+ * rejects an out-of-range `timelockPegin` before the engine is called. The WASM
7
+ * boundary is mocked so each dimension can be corrupted independently; the
8
+ * happy path against the real binary is covered by the golden vectors in
9
+ * `pegin.test.ts`.
8
10
  */
9
11
  export {};
10
12
  //# sourceMappingURL=assertPeginTxShape.test.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"assertPeginTxShape.test.d.ts","sourceRoot":"","sources":["../../../../../../src/tbv/core/primitives/psbt/__tests__/assertPeginTxShape.test.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG"}
1
+ {"version":3,"file":"assertPeginTxShape.test.d.ts","sourceRoot":"","sources":["../../../../../../src/tbv/core/primitives/psbt/__tests__/assertPeginTxShape.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Differential tests for deriveExpectedPeginPayoutScriptPubKey (CLAUDE.md
3
+ * critical path #9): the TypeScript derivation must equal the real engine's
4
+ * payout connector scriptPubKey over the golden vectors and seeded random
5
+ * inputs, for every supported graph version.
6
+ */
7
+ export {};
8
+ //# sourceMappingURL=deriveExpectedPeginPayoutScriptPubKey.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deriveExpectedPeginPayoutScriptPubKey.test.d.ts","sourceRoot":"","sources":["../../../../../../src/tbv/core/primitives/psbt/__tests__/deriveExpectedPeginPayoutScriptPubKey.test.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
@@ -3,6 +3,7 @@ import { PrePeginResult } from '../../wasm';
3
3
  import { ParsedOutput } from '../../utils/transaction/fundPeginTransaction';
4
4
  import { PrePeginParams } from './pegin';
5
5
  type PrePeginHtlcParams = Pick<PrePeginParams, "depositorPubkey" | "vaultProviderPubkey" | "vaultKeeperPubkeys" | "universalChallengerPubkeys" | "timelockRefund">;
6
+ type PeginPayoutParams = Pick<PrePeginParams, "depositorPubkey" | "vaultProviderPubkey" | "vaultKeeperPubkeys" | "universalChallengerPubkeys">;
6
7
  interface ExpectedPrePeginHtlc {
7
8
  hashlockScript: Buffer;
8
9
  hashlockControlBlock: Buffer;
@@ -15,6 +16,11 @@ interface ExpectedPrePeginHtlc {
15
16
  * Derive the canonical Pre-PegIn HTLC without using vault WASM output.
16
17
  */
17
18
  export declare function deriveExpectedPrePeginHtlc(params: PrePeginHtlcParams, hashlock: string): ExpectedPrePeginHtlc;
19
+ /**
20
+ * Derive the canonical PegIn vault (payout) scriptPubKey without using vault
21
+ * WASM output.
22
+ */
23
+ export declare function deriveExpectedPeginPayoutScriptPubKey(params: PeginPayoutParams, timelockPegin: number): Buffer;
18
24
  /**
19
25
  * Assert the WASM Pre-PegIn sizing result is internally consistent and
20
26
  * matches what the caller requested.
@@ -1 +1 @@
1
- {"version":3,"file":"assertWasmPeginSizing.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/primitives/psbt/assertWasmPeginSizing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAKL,KAAK,cAAc,EACpB,MAAM,YAAY,CAAC;AAMpB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8CAA8C,CAAC;AAgBjF,OAAO,KAAK,EAAE,cAAc,EAAE,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;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,6BAA6B,CAC3C,OAAO,EAAE,SAAS,YAAY,EAAE,EAChC,UAAU,EAAE,SAAS,MAAM,EAAE,EAC7B,iBAAiB,EAAE,SAAS,MAAM,EAAE,GACnC,IAAI,CA2BN;AAED;;;;;;GAMG;AACH,wBAAgB,kCAAkC,CAChD,OAAO,EAAE,SAAS,YAAY,EAAE,EAChC,UAAU,EAAE,SAAS,MAAM,EAAE,EAC7B,iBAAiB,EAAE,SAAS,MAAM,EAAE,EACpC,MAAM,EAAE,cAAc,EACtB,cAAc,EAAE,MAAM,GAAG,SAAS,EAClC,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,GACf,IAAI,CA2FN"}
@@ -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. The
18
- * depositor signs all inputs. Every prevout is derived from the authoritative
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;;;;;;;;;;;;GAYG;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"}
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 VP */
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,+DAA+D;IAC/D,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"}
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 is used in the challenge path after Assert, when the claimer proves validity.
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 is used in the **challenge path** when the claimer proves validity:
135
- * 1. Vault provider submits Claim transaction
136
- * 2. Challenge is raised during challenge period
137
- * 3. Claimer submits Assert transaction to prove validity
138
- * 4. Payout can be executed (references Assert tx)
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;AAEH,OAAO,EAGL,KAAK,OAAO,EACb,MAAM,YAAY,CAAC;AA4CpB;;;;;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;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;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,sBAAsB,CACpC,aAAa,EAAE,MAAM,EACrB,eAAe,EAAE,MAAM,EACvB,UAAU,SAAI,GACb,MAAM,CA+CR"}
@@ -143,7 +143,10 @@ export declare function normalizeAuthAnchorHash(value: string | undefined): stri
143
143
  *
144
144
  * @param params - Build parameters including Pre-PegIn params and funded tx hex
145
145
  * @returns PegIn transaction details
146
- * @throws If WASM initialization fails or parameters are invalid
146
+ * @throws If `timelockPegin` is not a whole number from 1 to 65535, if WASM
147
+ * initialization fails or parameters are invalid, or if the WASM result does
148
+ * not match the request (for example, a vault scriptPubKey that differs from
149
+ * the independently derived payout scriptPubKey)
147
150
  */
148
151
  export declare function buildPeginTxFromFundedPrePegin(params: BuildPeginTxParams): Promise<PeginTxResult>;
149
152
  //# sourceMappingURL=pegin.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"pegin.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/primitives/psbt/pegin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAML,KAAK,OAAO,EACb,MAAM,YAAY,CAAC;AAoBpB;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;;;;OAKG;IACH,gBAAgB,EAAE,MAAM,CAAC;IACzB,yEAAyE;IACzE,eAAe,EAAE,MAAM,CAAC;IACxB,4DAA4D;IAC5D,mBAAmB,EAAE,MAAM,CAAC;IAC5B,kEAAkE;IAClE,kBAAkB,EAAE,MAAM,EAAE,CAAC;IAC7B,0EAA0E;IAC1E,0BAA0B,EAAE,MAAM,EAAE,CAAC;IACrC,+DAA+D;IAC/D,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;IAC7B,sDAAsD;IACtD,cAAc,EAAE,MAAM,CAAC;IACvB,oDAAoD;IACpD,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;IAChC,iGAAiG;IACjG,OAAO,EAAE,MAAM,CAAC;IAChB,6FAA6F;IAC7F,eAA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;CACpB;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,cAAc,GACrB,OAAO,CAAC,kBAAkB,CAAC,CAkE7B;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,MAAM,GAAG,SAAS,GACxB,MAAM,GAAG,SAAS,CAapB;AAED;;;;;;;;;GASG;AACH,wBAAsB,8BAA8B,CAClD,MAAM,EAAE,kBAAkB,GACzB,OAAO,CAAC,aAAa,CAAC,CAwCxB"}
1
+ {"version":3,"file":"pegin.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/primitives/psbt/pegin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAML,KAAK,OAAO,EACb,MAAM,YAAY,CAAC;AAqBpB;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;;;;OAKG;IACH,gBAAgB,EAAE,MAAM,CAAC;IACzB,yEAAyE;IACzE,eAAe,EAAE,MAAM,CAAC;IACxB,4DAA4D;IAC5D,mBAAmB,EAAE,MAAM,CAAC;IAC5B,kEAAkE;IAClE,kBAAkB,EAAE,MAAM,EAAE,CAAC;IAC7B,0EAA0E;IAC1E,0BAA0B,EAAE,MAAM,EAAE,CAAC;IACrC,+DAA+D;IAC/D,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;IAC7B,sDAAsD;IACtD,cAAc,EAAE,MAAM,CAAC;IACvB,oDAAoD;IACpD,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;IAChC,iGAAiG;IACjG,OAAO,EAAE,MAAM,CAAC;IAChB,6FAA6F;IAC7F,eAAe,EAAE,MAAM,CAAC;IACxB,yDAAyD;IACzD,mBAAmB,EAAE,MAAM,CAAC;IAC5B,0DAA0D;IAC1D,aAAa,EAAE,MAAM,CAAC;IACtB,0DAA0D;IAC1D,WAAW,EAAE,MAAM,CAAC;IACpB,sBAAsB;IACtB,OAAO,EAAE,OAAO,CAAC;IACjB;;;;;;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AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,8BAA8B,CAClD,MAAM,EAAE,kBAAkB,GACzB,OAAO,CAAC,aAAa,CAAC,CAsDxB"}
@@ -13,7 +13,7 @@
13
13
  * OP_RETURN commitment.
14
14
  *
15
15
  * The root is bound to the wallet seed, the derivation account AND the
16
- * network (`derive-context-hash.md` §2.1 folds the connected pubkey and the
16
+ * network (the wallet's `deriveContextHash` folds the connected pubkey and the
17
17
  * canonical network name into the HKDF `info`), so all three must match the
18
18
  * ones that created the deposit.
19
19
  */
@@ -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
@@ -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
@@ -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
@@ -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"}