BIP54 implementation and test vectors

Posted by Antoine Poinsot'

Oct 28, 2025/09:53 UTC

In a recent discussion, the complexities surrounding block validation within the Bitcoin protocol, specifically regarding quadratic hashing and the BIP54 "potentially executed" sigop limit, were brought to light. The conversation illuminated that, beyond quadratic hashing, there are several operations that significantly contribute to the computational expense of validating a block. These include ECDSA signature verifications, modifications to vectors through the FindAndDelete operation, and prevout lookups. Prevout lookups have become notably more costly due to a limitation on scriptPubKey sizes, which has introduced a constant factor increase in lookup costs independent of block size. Despite these various costly operations, it was emphasized that their combined impact remains minor compared to the challenges posed by quadratic hashing.

The focus then shifted to discussing the economic impracticality for miners to exploit the prevout lookup cost due to the extensive preparation required—over a hundred blocks—to create a single problematic block that would only marginally delay validation times on modern computing hardware. This contrasts starkly with the potential for significant delays without the implementation of the BIP54 sigops limit, where a similarly exhaustive effort could lead to validation times exceeding 10 minutes, presenting a feasible attack vector for revenue-maximizing miners.

Furthermore, the BIP54 mitigation strategy was highlighted for its precise targeting of harmful behaviors intended to be prevented, ensuring minimal disruption to legitimate uses of the network. This approach not only renders attacks against competing miners economically unfeasible but also significantly diminishes the attractiveness of the network to attackers motivated by external factors. The conversation underscored the importance of the BIP54 mitigation in maintaining the integrity and efficiency of the Bitcoin network's block validation process.

For those interested in deeper technical insights into the calculations behind DoS blocks and further discussion on this topic, a semi-private thread titled Delving has been made available, offering detailed explorations of these computational challenges and the rationale behind specific mitigation strategies Delving thread. This serves as an invaluable resource for individuals keen on understanding the intricate balance between operational efficiency and security measures within the Bitcoin blockchain.

Link to Raw Post
Bitcoin Logo

TLDR

Join Our Newsletter

We’ll email you summaries of the latest discussions from high signal bitcoin sources, like bitcoin-dev, lightning-dev, and Delving Bitcoin.

Explore all Products

ChatBTC imageBitcoin searchBitcoin TranscriptsSaving SatoshiDecoding BitcoinWarnet
Built with 🧡 by the Bitcoin Dev Project
View our public visitor count

We'd love to hear your feedback on this project.

Give Feedback