<story><title>Bitcoin From Scratch – Part 1</title><url>https://monokh.com/posts/bitcoin-from-scratch-part-1</url></story><parent_chain><item><author>Jasper_</author><text>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:&lt;p&gt;&amp;gt; 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.&lt;p&gt;[0] &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;bitcoin.org&amp;#x2F;bitcoin.pdf&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;bitcoin.org&amp;#x2F;bitcoin.pdf&lt;/a&gt;</text></item><item><author>sodascripts</author><text>TIL. I wonder why that myth is so commonly perpetuated.</text></item><item><author>nemo1618</author><text>&amp;gt; The PoW is suffice if the hash begins with a certain number of 0s&lt;p&gt;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 &amp;quot;target&amp;quot;). So you &lt;i&gt;do&lt;/i&gt; end up with a lot of leading zeros -- but these are just a side effect, not the thing being measured.</text></item></parent_chain><comment><author>garmaine</author><text>Bitcoin never worked that way. However the original hashcash proposal was specified as leading zeroes. I presume that’s what you are mixing up with.</text></comment>
<story><title>Bitcoin From Scratch – Part 1</title><url>https://monokh.com/posts/bitcoin-from-scratch-part-1</url></story><parent_chain><item><author>Jasper_</author><text>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:&lt;p&gt;&amp;gt; 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.&lt;p&gt;[0] &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;bitcoin.org&amp;#x2F;bitcoin.pdf&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;bitcoin.org&amp;#x2F;bitcoin.pdf&lt;/a&gt;</text></item><item><author>sodascripts</author><text>TIL. I wonder why that myth is so commonly perpetuated.</text></item><item><author>nemo1618</author><text>&amp;gt; The PoW is suffice if the hash begins with a certain number of 0s&lt;p&gt;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 &amp;quot;target&amp;quot;). So you &lt;i&gt;do&lt;/i&gt; end up with a lot of leading zeros -- but these are just a side effect, not the thing being measured.</text></item></parent_chain><comment><author>nullc</author><text>&amp;gt; It used to work this way, but got changed to a less-than check for performance reasons.&lt;p&gt;I don&amp;#x27;t know who told you that, but they were weirdly confused.&lt;p&gt;It not unlikely the case that sometime early in development (long before publication) that it was bits-based, not only is this how the standard hashcash code works-- but the Bitcoin code calls the relevant field that encods the difficulty &amp;quot;bits&amp;quot;.&lt;p&gt;But Bitcoin itself never worked that way, not from the first instant.  Changing it would have been a consensus incompatible change, and Bitcoin is still more or less consensus compatible all the way back. (There are outright bugs that make the old software get stuck, but if you fix those, it follows along).</text></comment>