Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Diagrams depicting Script commands and elements stacks can be confusing #292

Open
salmonberry7 opened this issue Jan 5, 2025 · 0 comments

Comments

@salmonberry7
Copy link

These diagrams are used from chapter 6 onwards where they are introduced on p113, and they are used quite a lot in Chap. 8. They are somewhat confusing since the script commands are depicted as a vertical column (with the first command on top), but the elements stack that these Script commands operate on (as stated in 'How Script Works' on p105) are also depicted as such a vertical column.

In the latter case a vertical column is the natural way to depict a stack structure. But for a sequence of commands constituting a Script program it would maybe be better to display them in left to right format, as is done in Antonopolous Mastering Bitcoin 2nd Ed Chap. 6 (eg Fig 6.5, p137), since this brings out the contrast between the actual Script code and the element stack that the code is operating upon. For example on p113-114 <signature> as a push data type Script command appears exactly as <signature> as a stack element, and similar ambiguity occurs in Chap. 8 in the Bare Multisig section.

It could make sense to depict Script code in vertical format as this is how program source code appears within a text editor, however in this book it does bring to mind a stack structure as the stack structure is illustrated next to it in the exact same style. If the left hand vertical column was designed differently to look more like a source code script, so it contrasted from the stack structure on the right, it would help bring out the difference.

So either having Script code commands displayed left to right as in Antonopolous, or have it vertically displayed but with a different design template than is used for the elements stack, would clarify it I think. Just a suggestion, a great book overall, has been incredibly helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant