/** * Spend-input confirmation gate for btc-transaction-signer (Phase 2). * * Every input the PKP is about to sign must be a real, unspent, correctly-valued * output of the vault that has reached the SPEND confirmation depth * (`policy.minBitcoinSpendConfirmations`, mainnet 6). This module holds the pure * assertion so it can be unit-tested without the Lit runtime. * * `confirmedKeys` is ALWAYS the set of outpoints confirmed at spend depth under * MULTI-PROVIDER CONSENSUS (VaultBalanceConsensus.confirmedUtxoConsensus over the * providers registered in the on-chain BitcoinProviderRegistry), so a single * compromised/MITM'd provider cannot attest a fake depth. There is deliberately * NO single-provider fallback: on non-hardhat chains the signer fails closed when * the registry is unavailable rather than trusting one endpoint's word. On hardhat * the same consensus path runs with the single dev provider (minConsensusProviders=1). * * Keys are normalized outpoints `${normTxid(txid)}:${vout}`. */ export interface SignerInput { txid: string; vout: number; value: number; } export interface OnchainOutput { txid: string; vout: number; satoshis: bigint; confirmations: number; } /** * Assert every input exists on-chain as a vault output, matches its declared * value exactly, and is present in `confirmedKeys` (confirmed at spend depth). * Throws (fail-closed) on the first violation. * * @param inputs The full input set about to be signed (`utxos[]`). * @param onchainByKey Vault UTXOs keyed by `${normTxid(txid)}:${vout}`. * @param confirmedKeys Normalized outpoint keys confirmed at spend depth. * @param normTxid Canonical txid normalizer (lowercase + strip 0x). * @param minSpendConf Spend-confirmation depth (for error messages). */ export declare function assertEveryInputConfirmed(inputs: SignerInput[], onchainByKey: Map, confirmedKeys: Set, normTxid: (t: unknown) => string, minSpendConf: number): void; /** * Build the normalized set of outpoint keys that are confirmed at spend depth, * from a primary provider's UTXO set, filtered by a `confirmedRawKeys` predicate * (the consensus result, keyed by the primary's raw `${txid}:${vout}`). Used to * translate `VaultBalanceConsensus.confirmedUtxoConsensus` output into the * normalized keyspace `assertEveryInputConfirmed` expects. */ export declare function toNormalizedConfirmedKeys(primaryUtxos: OnchainOutput[], confirmedRawKeys: Set, normTxid: (t: unknown) => string): Set; //# sourceMappingURL=spend-confirmation.d.ts.map