pull down to refresh

A few months ago, I took a crack at trying to solve a Satoshi puzzle that resurfaced in 2013. Satoshi’s private November 2008 draft code was revealed by Ray Dillinger on BitcoinTalk, receiving acclaim from the likes of @peterktodd and others.
This code was originally shared privately by Satoshi with James Donald, Ray Dillinger and Hal Finney. The code was only a draft work in progress, incomplete. It was not yet polished or ready for deployment. But it was where Satoshi was beginning to form his thoughts on Bitcoin's network details, eventually refined and deployed in January of 2009.
After the 2013 BitcoinTalk thread died down, the code was left unexamined in detail for years, forgotten again. But one day, @francispouliot_ tweeted about the v0.0 code. Being curious, I thought I’d take a look to see if there were any differences in this private v0.0 code versus the Bitcoin code published as v0.1 in January of 2009.
There were huge differences. The most outstanding ones included:
You can see more details about this journey down the rabbit hole of v0.0 code in my earlier part one here: https://medium.com/@Fiach_dubh/1-99-billion-bitcoin-not-21-million-fad9f5550659
Recently, I received some very nice feedback from @lev1tas35619 on this part one, with there interpretation of the Bitcoin v0.0 supply numbers being different from mine. Lev1tas assumed a Bitcoin supply of 20 million units, referring to the COIN variable as supporting evidence for this.
This COIN variable, though defined, is not used at all in the v0.0 code. I've looked for it's usage in the three available files (main.cpp, main.h and node.cpp), and not found it being utilized anywhere.
To Lev1tas’ credit, they sniffed out something I didn’t feel like explaining all that much in my first article. The fact that bitcoin is not defined at all in v0.0.
Satoshi’s are what are defined in Bitcoin’s code, and from their bitcoin is inferred. In v0.1 this inference is expressed by the following code found in the file util.cpp
The most important line here is “n /= CENT” which converts the amount from "satoshi’s" to Bitcoin by dividing it by CENT(a constant defined as 1000000). This is used to show "50.000000" bitcoin as the balance in the Bitcoin GUI for someone who successfully mined one of the first Bitcoin blocks.
The issue is that this above code to define the decimal place demarcating Bitcoin’s versus Satoshi’s is nowhere to be found in v0.0 (a lot of code is missing actually). So we are left to assume.
I assumed that if we ported over this above v0.1 code to v0.0, we’d get numbers and decimal places as described in part one. (1.99 Billion Bitcoin & 1.9 Trillion Satoshi’s).
Lev1tas assumes that COIN is used in place of CENT here for v0.0, even though this “n/=COIN” code is missing from v0.0. So there’s kind of two leaps of assumption they’re making here, versus my one assumption. They’re both assuming a port over of this above code, AND and change from the use of CENT to COIN?
But neither of us is really right here, since we don’t really know, the code is missing. What we can at least say for sure though is that the number of Satoshi’s increased from 19.9 Trillion in v0.0 to 2.1 Quadrillion in v0.1.
The number of bitcoin in v0.0 is unknown, since it was never defined. Or more accurately, the file and lines of code that defined bitcoin for v0.0 was never revealed publicly by Satoshi. Only the Satoshi’s were known. I want to say a special thank you to Lev1tas for taking the time to engage with me on this interesting bit of Bitcoin history. It’s so fun going through this early Satoshi work, looking at details, and it gets so much better when someone else coinjoins. You mean I’m not the only nerd who likes this stuff?
You sniffed out one of my assumptions, good job! But maybe I’m wrong somewhere and missed something? Please let me know what you all think!
For the medium link of this article: https://medium.com/@Fiach_dubh/satoshis-2008-bitcoin-source-code-v0-0-had-less-bitcoin-4db33fd0e6c9