/** * Far-side verification of Taproot KEY-PATH Schnorr signatures a wallet * returned, over the PSBT we requested (trusted prevouts) — the key-path twin * of `assertScriptPathSchnorrSignature`. Reference: btc-vault * `crates/btc-wallet-remote/src/client.rs check_signatures_valid` (output key taken * from the prevout scriptPubKey, all prevouts committed). The wallet's * success/finalization is never trusted on its own (CLAUDE.md §8). * `assertReturnedKeyPathSignatures` additionally dispatches P2WPKH-funded * inputs to `verifyP2wpkhEcdsaSignature` (client.rs's * `verify_finalized_p2wpkh_spend` sibling), so a Native SegWit software * wallet's signatures no longer pass through unchecked. * * Why verify against the *requested* PSBT: `assertPsbtUnsignedTxMatches` pins * the unsigned transaction but deliberately skips per-input metadata, so a * wallet could rewrite `witnessUtxo` in its response and make a wrong-message * signature self-validate. Prevout scripts and values therefore come from the * PSBT we built; only the signature bytes come from the wallet. * * @module tbv/core/primitives/psbt/verifyKeyPathSchnorrSignature */ export interface AssertKeyPathSchnorrSignatureParams { /** Hex of the PSBT we built and sent (trusted prevout scripts/values). NOT the wallet's. */ requestedPsbtHex: string; /** 64- or 65-byte signature, hex. */ signatureHex: string; /** Index of the input the signature is for. */ inputIndex: number; } /** * Assert that `signatureHex` is a valid BIP-340 Schnorr signature over the * Taproot key-path sighash of `requestedPsbtHex` input `inputIndex`, under the * tweaked output key taken from that input's prevout scriptPubKey. * * @throws If the input is not a key-path P2TR spend, the requested PSBT lacks * the prevout data needed to recompute the sighash, or the signature * does not verify. */ export declare function assertKeyPathSchnorrSignature(params: AssertKeyPathSchnorrSignatureParams): void; export interface AssertReturnedKeyPathSignaturesParams { /** PSBT we built locally and asked the wallet to sign. */ requestedPsbtHex: string; /** PSBT the wallet returned after signing. */ returnedPsbtHex: string; } /** * Verify every key-path-eligible and P2WPKH input of the REQUESTED PSBT * against what the wallet RETURNED. Key-path: `tapKeySig`, or the single * finalized witness item for wallets that auto-finalize — and when both are * present they must be the same bytes. P2WPKH: `partialSig`, or the finalized * 2-item witness, verified as ECDSA over the BIP-143 sighash * ({@link assertReturnedP2wpkhSignature}); a failure throws but the input is * NOT counted. Any other input type (script-path, P2WSH, ...) throws — no * verifier here covers it, so it cannot be treated as verified. * * @returns How many inputs were verified KEY-PATH. A caller that knows every * input is taproot key-path (e.g. an approval wallet) must assert * this equals its input count — P2WPKH inputs never count toward it, * so that gate stays exact. * @throws If the input counts differ, an input is neither key-path P2TR nor * P2WPKH, an eligible input carries no signature, a finalized witness * disagrees with its `tapKeySig`/`partialSig`, or any signature does * not verify. */ export declare function assertReturnedKeyPathSignatures(params: AssertReturnedKeyPathSignaturesParams): number; //# sourceMappingURL=verifyKeyPathSchnorrSignature.d.ts.map