Examining ScriptPubkeys in Bitcoin Script

Posted by Rusty Russell

Oct 22, 2023/04:16 UTC

In an email exchange, Brandon Black discusses the challenges he faces while writing scripts for evaluation. He expresses discomfort with not having tested the scripts he has written so far. One specific issue he highlights is the difficulty of performing N-input evaluation without iteration. Despite this challenge, he believes it would be valuable to attempt such evaluations as they may shed light on OP_TXHASH input selection. He suggests the possibility of incorporating an "all but one input" mode for this purpose.

Brandon also mentions that dealing with satsoshi amounts in scripts is possible but messy, which he plans to explore further in a future post. He provides examples that demonstrate how OP_MULTISHA256 is nearly as powerful as OP_CAT, but without the limitations of stack size. He concludes by stating that OP_2SHA256 is not generally sufficient for CScriptNum generation, making it a premature optimization to save two opcodes.

Overall, Brandon's email highlights the challenges and considerations involved in script writing and evaluation, particularly in relation to input selection and opcode efficiency.

Link to Raw Post
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