Nov 7 - Nov 28, 2025
This initiative aims to preemptively allocate computational resources across all operations within the Bitcoin script execution process. By linking this budget to the transaction weight, it ensures a proportionate distribution of compute units, specifically allocating 5,200 units per weight unit of the transaction. This methodical allocation is designed to safeguard against denial-of-service attacks by preventing excessive computational time and memory usage before any computationally intensive operations are reinstated or other script limits are relaxed. The computation of the varops cost for each opcode is meticulously determined by considering the length of its arguments and the nature of its action on the data, such as copying, comparing, moving, performing hashing, or executing arithmetic operations. Further insights into this proposal can be explored in the Bitcoin Improvement Proposal (BIP) documented on GitHub, providing a comprehensive overview of the objectives and mechanisms underlying this approach (view the BIP).
The discourse around blockchain development, especially pertaining to Bitcoin's scripting enhancements, delves into the complexities introduced by newer versions of script. It underscores the challenges of adding multiple dimensions of constraint to block assembly, which could potentially render the problem NP-hard. This complexity emerges prominently in the transition from tapscript (V1) to tarscript (V2), where tarscript V2 introduces a novel varops constraint alongside the existing sigops constraint, complicating the optimization process in block assembly. In contrast, Simplicity, another scripting language for blockchain, maintains a single dimension of constraint solving by employing a unified budget mechanism for cost calculations. This approach, inherited from tapscript V1, opts for static rather than dynamic computation of costs, highlighting a preference for simplicity and predictability over the dynamism of runtime evaluation. Such discussions illuminate the trade-offs between advancing functionality through additional constraints and preserving computational simplicity to avoid overcomplicating block assembly.
Further, in addressing technical specifics, the implementation details regarding the transition from SigVersion::TAPSCRIPT to SigVersion::TAPSCRIPT_V2 highlight a significant shift. The introduction of the varops budget replaces the original sigops constraint, necessitating adjustments in how costs are calculated and applied within the script evaluation process. This change aims to simplify and make more predictable the cost calculation process by proposing that the varops cost deduction occur irrespective of the outcome of checksig operations. However, this adjustment, along with the broader proposal, requires thorough review and validation. Community involvement is encouraged to support this initiative, particularly through running benchmarks using a prototype implementation available on GitHub (check out the GSR prototype). By enabling benchmarks and executing specified commands, contributors can generate pivotal data to refine and validate the proposed varops budget approach, ensuring its efficacy and alignment with the overarching goal of maintaining script execution time within acceptable limits.
Thread Summary (2 replies)
Nov 7 - Nov 28, 2025
3 messages • 2 replies
TLDR
We’ll email you summaries of the latest discussions from high signal bitcoin sources, like bitcoin-dev, lightning-dev, and Delving Bitcoin.
We'd love to hear your feedback on this project.
Give Feedback