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

chapter 6, spelling/typos #62

Closed
smh69 opened this issue Nov 6, 2018 · 1 comment
Closed

chapter 6, spelling/typos #62

smh69 opened this issue Nov 6, 2018 · 1 comment

Comments

@smh69
Copy link

smh69 commented Nov 6, 2018

in the "Why Bitcoin isn’t Turing Complete" sidebar: the second paragraph contains the sentence "Anyone can create a Script program that every full node on the network executes this program." which might read better like "Anyone can create a Script program that every full node on the network must execute."

In the ipynb, the first exercise is missing (to implement op_hash160), so I implemented as follows:
(my implementation deleted) (appears fixed with commit a333e9e)

In the "Longer than 75-byte elements" sidebar, the phrase "There are specific 3 specific OP codes for this" could lose the first "specific".

Just under that last sidebar, the reference link for bitcoin script could be: "https://en.bitcoin.it/wiki/Script"

While explaining the scriptSig of p2pk, it reads "In the case of p2pk, the ScriptSig is just the signature." and I wonder if it would not be more exact to say "In the case of p2pk, the ScriptSig is just the signature, which is comprised of the DER formatted (r,s) signature, and a sighash byte. The sighash byte will later be used during sig-ops to specify how to construct z, that is, what parts of this serialized transaction must be signed"
Similarly, the 01 sighash byte might be colored separately from the length and DERsig.

In "Problems with p2pk", I don't quite understand this sentence: "Later on, Pieter Wuille discovered that the compressed SEC format was existed inOpenSSL, did their use in Bitcoin become more common."

No tests for the last two exercises but I attacked them like:
`

Exercise 1

hex_scriptPk = '767695935687'
hex_scriptSig = '52'
stream = BytesIO(bytes.fromhex('07' + hex_scriptSig + hex_scriptPk))
print(Script.parse(stream))
`
and

`

Exercise 2

hex_scriptPk = '6e879169a77ca787'
hex_scriptSig = '0051'
stream = BytesIO(bytes.fromhex('0a' + hex_scriptSig + hex_scriptPk))
print(Script.parse(stream))
`

Regarding the Pinata (I call them puzzles), this comment is mostly about my own bewilderment. Are these not unsafe? I mean, is not the very best strategy for every node, to look for someone spending these as the tx is relayed, swap out the outputs and swap-in their own output to claim the prize... and so on right up until the miner does it themself? How was the sha1 puzzle claimed if a miner was not helping the one who solved? Don't these fail the isStandard() test for relaying? I wonder if a better pinata might be built with p2sh, where redeem scripts pass recent isStandard() rules and where they are signed by a key which is the solution... then published somewhere online so others can learn about them instead of scanning the utxoset. Your thoughts?

@jimmysong
Copy link
Owner

Yes, the Pinata was very unsafe. However, it was constructed as a p2sh, so it was standard. The miners could have substituted their own address for the output, but the miner that did wasn't, at least back then, sophisticated enough to pull this off.

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

2 participants