delvingbitcoin

What happens after we "run out" of script flags?

What happens after we "run out" of script flags?

Original Postby moonsettler

Posted on: January 12, 2025 19:29 UTC

In the Bitcoin Core codebase, script flags are defined as a 32-bit unsigned integer.

This design choice imposes a limitation on the number of unique flags that can be represented. With the proposed addition of 11 new script verification flags, including those for template verification, signature from stack operations, internal key checks, pair commit validations, and concatenation operations, the system approaches its maximum capacity. Each new flag is allocated a bit position from 21 to 31, indicating that adding more flags under the current system would soon exhaust available space.

The proposal implicitly raises a critical question about the future scalability of script flags within the Bitcoin Core infrastructure. The suggestion to transition from a 32-bit to a 64-bit representation for script flags is introduced as a potential solution to accommodate further expansion. This change would significantly increase the capacity for new flags, ensuring the system's ability to evolve and incorporate additional functionalities or security measures as needed. However, such a transition also implies considerations regarding backward compatibility, memory usage, and overall impact on the system's performance and security.

Bitcoin Logo

TLDR

Join Our Newsletter

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

Explore all Products

ChatBTC imageBitcoin searchBitcoin TranscriptsSaving SatoshiBitcoin Transcripts Review
Built with 🧡 by the Bitcoin Dev Project
View our public visitor count

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

Give Feedback