delvingbitcoin

64 bit arithmetic soft fork

64 bit arithmetic soft fork

Original Postby EthanHeilman

Posted on: February 2, 2024 18:46 UTC

Variable-length numbers in programming can lead to elegant solutions, but concerns may arise about the computational costs associated with processing larger numbers, especially in the context of fee pricing for operations.

It's noted that bigger numbers necessitate more computation than smaller ones; however, there are ways to streamline this process. For instance, large numbers can be efficiently placed on a stack with compact opcodes such as HASH256. Using 64-bit chunks is suggested as an effective method to account for the increased cost associated with operating on larger numbers, as it would require additional opcodes.

Upon reflection, the initial concern regarding the cost of operations seems less significant. In Bitcoin, allowing operations on very large numbers appears to be acceptable, since there are more efficient methods to utilize computational resources than arithmetic operations when aiming to reduce code fees. It's hypothesized that the computational burden of arithmetic operations on significantly large numbers, like those consisting of 520 bytes, is likely lower than the cost incurred by executing certain single-opcode instructions, including HASH160 or CHECKSIG. However, concrete performance data to support this claim is not provided. This suggests that the efficiency of arithmetic operations on large numbers might not substantially impact overall computational costs within certain programming environments.