Bitcoin From Scratch – Part 1
monokh.com
Bitcoin From Scratch – Part 1
1–10 of 77 posts
Re: Bitcoin From Scratch – Part 1
#2This is a common explanation of PoW, but is actually incorrect. If you think about it, this would mean that the PoW difficulty could only increase (or decrease) by a factor of two. In reality, the block hash is simply interpreted as a (very large) number, and this number must be less than some other very large number (the "target"). So you do end up with a lot of leading zeros -- but these are just a side effect, not the thing being measured.
Re: Bitcoin From Scratch – Part 1
#3> The PoW is suffice if the hash begins with a certain number of 0s This is a common explanation of PoW, but is actually incorrect. If you think about it, this would mean that the PoW difficulty could only increase (or decrease) by a factor of two. In reality, the block hash is simply interpreted as a (very large) number, and this number must be less than some other very large number (the "target"). So you do end up…
Re: Bitcoin From Scratch – Part 1
#4> The PoW is suffice if the hash begins with a certain number of 0s This is a common explanation of PoW, but is actually incorrect. If you think about it, this would mean that the PoW difficulty could only increase (or decrease) by a factor of two. In reality, the block hash is simply interpreted as a (very large) number, and this number must be less than some other very large number (the "target"). So you do end up…
I try to keep these concepts rather simplified to ease the reading and learning process. Perhaps there should be a note for these situations.
Re: Bitcoin From Scratch – Part 1
#5Re: Bitcoin From Scratch – Part 1
#6> The PoW is suffice if the hash begins with a certain number of 0s This is a common explanation of PoW, but is actually incorrect. If you think about it, this would mean that the PoW difficulty could only increase (or decrease) by a factor of two. In reality, the block hash is simply interpreted as a (very large) number, and this number must be less than some other very large number (the "target"). So you do end up…
TIL. I wonder why that myth is so commonly perpetuated.
> The proof-of-work involves scanning for a value that when hashed, such as with SHA-256, the hash begins with a number of zero bits.
Re: Bitcoin From Scratch – Part 1
#7Re: Bitcoin From Scratch – Part 1
#8Earlier quoted context omitted.
TIL. I wonder why that myth is so commonly perpetuated.
It used to work this way, but got changed to a less-than check for performance reasons. The Bitcoin whitepaper [0] even has the original approach: > The proof-of-work involves scanning for a value that when hashed, such as with SHA-256, the hash begins with a number of zero bits. [0] https://bitcoin.org/bitcoin.pdf
Re: Bitcoin From Scratch – Part 1
#9> The PoW is suffice if the hash begins with a certain number of 0s This is a common explanation of PoW, but is actually incorrect. If you think about it, this would mean that the PoW difficulty could only increase (or decrease) by a factor of two. In reality, the block hash is simply interpreted as a (very large) number, and this number must be less than some other very large number (the "target"). So you do end up…
(author here) Absolutely. Thanks for pointing this out. If difficulty adjusted in factors of two, the ability of the network to accurately maintain its 10 mins blocktime become impaired. I try to keep these concepts rather simplified to ease the reading and learning process. Perhaps there should be a note for these situations.
Re: Bitcoin From Scratch – Part 1
#10Earlier quoted context omitted.
TIL. I wonder why that myth is so commonly perpetuated.
It used to work this way, but got changed to a less-than check for performance reasons. The Bitcoin whitepaper [0] even has the original approach: > The proof-of-work involves scanning for a value that when hashed, such as with SHA-256, the hash begins with a number of zero bits. [0] https://bitcoin.org/bitcoin.pdf
Performance as in "it takes less time to verify the PoW," or something else? Because the "leading zeros" and "less than target" approaches would both take a negligible amount of time.