Posted by Anthony Towns
Oct 27, 2023/07:00 UTC
The email discusses two reasons for considering a specific approach: (a) to facilitate vault operations and (b) to make Bitcoin more programmable. The approach aims to strike a balance between being easy to specify and implement correctly, as well as easy to use correctly. It is mentioned that the proposed approach for vault operations seems overly complicated and not practical, while alternative proposals such as BIP 345 seem more straightforward and usable.
In the context of making Bitcoin more programmable, the email suggests that the current script language is limited and not helpful for implementing novel ideas. The email proposes using a Lisp variant as a potential solution, replacing script's "two stacks of byte-strings" with "(recursive) lists of byte-strings". This change would allow for a more complete programming language with fewer opcodes. The author has been experimenting with this idea and believes it shows promise.
The email also mentions the possibility of experimenting with new SIGHASH modes. The author introduces an opcode called OP_TX, which allows for selecting various information about a transaction. This flexibility enables the selection of different parts of the transaction and passing them through other opcodes like SHA256 for signature checks. The example provided in the email demonstrates how the proposed approach can mimic existing hash constructs.
The author acknowledges that the example code provided may be difficult to read but emphasizes that it could be improved with a higher-level macro-enabled Lisp variation or a parser that allows adding comments. The current implementation is described as an eager interpreter with some tail call optimizations, but the author suggests that a properly lazy interpreter would provide better memory efficiency and support for iteration, recursion, and function calls.
The email concludes by highlighting that using a Lisp-like language provides a more promising approach for experimentation compared to trying to fit everything into the limitations of the script language. The author believes that using opcodes such as OP_TX, OP_CAT, and OP_CSFS within a Lisp-like structure would work well for experimentation.
TLDR
We’ll email you summaries of the latest discussions from authoritative bitcoin sources, like bitcoin-dev, lightning-dev, and Delving Bitcoin.
We'd love to hear your feedback on this project?
Give Feedback