import { Network } from '@babylonlabs-io/babylon-tbv-rust-wasm'; import { BitcoinWallet } from '../../../../shared/wallets/interfaces'; import { DepositorAsClaimerPresignatures, DepositorGraphTransactions } from '../../clients/vault-provider/types'; /** * Authoritative inputs required to construct the depositor's Payout AND every * per-challenger NoPayout PSBT locally. Every field here must come from * trusted on-chain sources, not from the vault provider response. They feed * directly into the Taproot sighash. */ export interface DepositorGraphSigningContext { /** * Vault core (tx-graph) version the vault was registered under — the * vault's stamped on-chain `vaultCoreVersion` from `BTCVaultRegistry`. * Selects which graph's connector scripts every PSBT is rebuilt with. */ vaultCoreVersion: number; /** Raw pegin BTC transaction hex (provides the depositor's signed prevout) */ peginTxHex: string; /** Depositor's BTC public key (x-only, 64-char hex, no 0x prefix) */ depositorBtcPubkey: string; /** Vault provider's BTC public key (x-only hex, no prefix) */ vaultProviderBtcPubkey: string; /** Sorted vault keeper BTC public keys (x-only hex, no prefix) */ vaultKeeperBtcPubkeys: string[]; /** Sorted universal challenger BTC public keys (x-only hex, no prefix) */ universalChallengerBtcPubkeys: string[]; /** Pegin CSV timelock from the locked offchain params version (blocks) */ timelockPegin: number; /** * Tx-graph fee rate (sat/vB) from the locked offchain params version — * bounds the depositor-claimer payout's implicit fee (payout fee band). */ protocolFeeRate: bigint; /** * Assert CSV timelock from the locked offchain params version (blocks). * Sourced from the on-chain ProtocolParams contract via * `ViemProtocolParamsReader.getOffchainParamsByVersion(...).timelockAssert`. */ timelockAssert: number; /** * Security council member x-only public keys (hex, no prefix). Sourced from * the on-chain ProtocolParams contract via * `ViemProtocolParamsReader.getOffchainParamsByVersion(...).securityCouncilKeys`. */ councilMembers: string[]; /** * M-of-N council quorum threshold. Sourced from the on-chain ProtocolParams * contract via `ViemProtocolParamsReader.getOffchainParamsByVersion(...).councilQuorum`. */ councilQuorum: number; /** BTC network (Mainnet, Testnet, etc.) */ network: Network; /** * On-chain registered depositor payout scriptPubKey (hex, with or without * 0x prefix). Used to assert the VP-advertised payout transaction pays to * the depositor's registered address before the wallet produces a signature. */ registeredPayoutScriptPubKey: string; /** * RFC-006 operator payout destinations. Forwarded to `buildPayoutPsbt` for * shape completeness only: this graph is signed under the * `depositor-as-claimer` role, whose payout has two outputs and reads * neither the keeper map nor the VP commission destination. */ vkClaimerPayoutScriptPubKeys: Readonly>; /** See {@link vkClaimerPayoutScriptPubKeys} — unused for this role. */ vpCommissionScriptPubKey: string; } export interface SignDepositorGraphParams { /** The depositor graph from VP response */ depositorGraph: DepositorGraphTransactions; /** Bitcoin wallet for signing */ btcWallet: BitcoinWallet; /** Authoritative inputs used to rebuild every PSBT locally */ signingContext: DepositorGraphSigningContext; } /** * Sign all depositor graph transactions and assemble into presignatures. * * Flow: * 1. Build payout + per-challenger nopayout PSBTs locally * 2. Batch sign via wallet.signPsbts() if available, else sequential signPsbt() * 3. Extract Schnorr signatures from each signed PSBT * 4. Assemble into DepositorAsClaimerPresignatures */ export declare function signDepositorGraph(params: SignDepositorGraphParams): Promise; //# sourceMappingURL=signDepositorGraph.d.ts.map