/** * Bitcoin withdrawal fee bounds — size-aware. * * The user-signed `networkFee` (absolute sats, deducted from the payout and paid * to miners) is bounded here so a malicious/buggy fee estimate cannot burn the * borrower's funds. A FLAT absolute cap is wrong: it is an implicit fee-RATE * ceiling that shrinks as the transaction grows, so a large multi-input * consolidation is blocked on any busy-fee day (a 20-input spend at a flat * 100k-sat cap is only ~70 sat/vB) while a tiny withdrawal is under-protected. * * Instead the cap scales with the transaction's virtual size: * maxFee = min(MAX_BTC_FEE_RATE_SAT_PER_VBYTE * estVBytes, * MAX_BTC_FEE_ABSOLUTE_BACKSTOP_SATS) * * The rate ceiling covers essentially every historical fee spike (normal days * are 5–30 sat/vB; even the 2023–24 ordinals/runes peaks rarely sustained above * ~400), while still bounding fee-based griefing proportionally to the work being * done. The absolute backstop is a final catastrophic-loss ceiling for * pathologically large input sets. * * NOTE: this is a Lit Action constant — changing either bound requires a bundle * rebundle + CID rotation ceremony, so the rate is set generously enough to * essentially never need tuning. If genuine operational adjustability is ever * needed, source `MAX_BTC_FEE_RATE_SAT_PER_VBYTE` from an on-chain registry. * * Kept in its own module (imported only by btc-transaction-signer) so editing it * does not rebundle the other importers of modules/bitcoin/transaction.ts. */ /** Max acceptable fee rate for a withdrawal, satoshis per virtual byte. */ export declare const MAX_BTC_FEE_RATE_SAT_PER_VBYTE = 500; /** Final catastrophic-loss ceiling regardless of size (0.02 BTC). */ export declare const MAX_BTC_FEE_ABSOLUTE_BACKSTOP_SATS = 2000000n; /** * Estimate the virtual size (vbytes) of a P2WPKH-input transaction. * @throws if counts are not positive integers. */ export declare function estimateP2WPKHVBytes(numInputs: number, numOutputs: number): number; /** * Maximum acceptable withdrawal network fee (sats) for a transaction of the * given shape: the lesser of the rate-based cap and the absolute backstop. */ export declare function maxWithdrawalFeeSats(numInputs: number, numOutputs: number): bigint; //# sourceMappingURL=fee.d.ts.map