/** * Post-sign PKP-binding assert for the BTC transaction signer (C-38 / ISSUE-012 E-2). * * Deliberately its OWN module, not part of `signature.ts`. That file carries * `ethereumSignatureToBtcSignature`, whose DER encoding does * `require("bip66")` — a package that is NOT in the bundler's `external` list * and is not resolvable at bundle time. Nothing bundled imported that file * before this assert existed, so the broken require had never faced esbuild; * importing the assert from `btc-transaction-signer` pulled it into a * production bundle for the first time and broke the build (caught by CI, not * by the unit suites — a bundle failure is invisible to jest). * * Keeping the assert here means the signer bundles the check and nothing else. * `signature.ts` is left exactly as it was: its only consumers are a dev README * and a mocked test, so its require stays dead rather than being "fixed" by * marking a package external on an unverified claim about the Lit runtime. */ /** * Post-sign guard: prove the signature we are about to hand back was produced * by the PKP we claim it was (C-38 / ISSUE-012 E-2). * * WHAT THIS PREVENTS. The btc-transaction-signer builds the transaction from a * `publicKey` jsParam — that key derives the vault's P2WPKH address, the input * scriptPubKeys, the change output, and is checked against the position's * on-chain vault address. It then signs with a SEPARATE object: the private key * `Lit.Actions.getPrivateKey({ pkpId })` returns for the caller-named `pkpId`. * Nothing tied those two together after the fact. If they ever diverge — a * pkpId/publicKey mix-up in the server, a key-rotation race, a Lit-side * regression, or a caller who found a pkpId whose binding check passed for the * wrong key — the action would happily return signatures that do NOT satisfy * the scripts of the transaction it just built, against a real vault's UTXOs. * Recovering the public key from the signature and comparing it to the key the * transaction was built from turns that silent mismatch into a refusal BEFORE * anything is broadcast, which is the only moment it is still cheap. * * It is a cryptographic check of the signature itself, so it cannot be * satisfied by anything except the right key actually having signed. * * @param digest 32-byte sighash that was signed (0x-prefixed). * @param signature The joined signature returned for that digest. * @param expectedPkpPublicKey Uncompressed PKP public key the tx was built from. * @param context Short description used in the thrown message (e.g. "input 0"). * @throws If the recovered key differs from the expected one, or either input * is malformed. Never returns a "close enough" result. */ export declare function assertSignatureFromPkp(digest: string, signature: string, expectedPkpPublicKey: string, context: string): void; //# sourceMappingURL=pkp-signature-assert.d.ts.map