Friday, August 24, 2018

A Somewhat Disappointing Description of Bitcoin

The article "What Is the Blockchain?" appeared in the April 2018 issue of IEEE Computing Edge, authored by Massimo Di Pierro.  It also originally appeared in the September/October 2017 issue of IEEE Computing in Science & Engineering.

I was somewhat surprised and disappointed that this article was published in its current form.

The section describing what a Bitcoin fundamentally is and how it is created is not correct.  It is incorrect even when you allow for simplification in order to explain it to a reader without specific domain experience in this area.

The text of this section is as follows:
"A unit of bitcoin is nothing other than a number, but only some numbers are valid bitcoins.  These numbers are solutions solutions of a well-defined equation, and whoever finds a new solution owns it (this process is called mining).  Once a bitcoin is discovered, it can be traded, with transactions stored in a ledger.  Transactions are digitally signed with the credentials of the seller to avoid nonrepudiation.  There is no centralized ledger because users wouldn't trust one and because there are too many transactions to store them all in one place.  Hence bitcoin and other cryptocurrencies provide a distributed ledger in which every computer involved in the transaction of a specific coin (or fraction of a coin) keeps a copy of the history of that coin's transactions.  The blockchain technology makes sure that no party storing this history can tamper with it without being detected."


1) Each Bitcoin not assigned a number.  And they are not created by finding one of these magic numbers.  While this description does align with the term "mining" (which to me has never seemed like an accurate description of what was actually occurring), it is not correct.

    a) "Mining" is actually a race to validate the next set of transactions, gathered in a block.  The kicker here is that a successful "mining" operation, in addition to validating the transactions, also has to calculate a qualifying hash (using the hash function SHA256) of the block.  The block header has fields built in that can be iterated upon in order to vary the hash result.  The current race is won when a "miner" has successfully found a qualifying hash value.  As more computing power is devoted worldwide to mining, the calculation difficulty of what counts as a "qualifying" hash is periodically adjusted (every 2016 blocks) so that rate at which new blocks are turned out remains at approximately once every 10 minutes.  Bitcoins are created when the winner of the current block race assigns himself a number of Bitcoins through an additional transaction (called the coinbase transaction).  This reward was originally 50 per block but is currently 12.5 and is cut in half every 210,000 blocks, which is approximately every four years.  This is the established reward for doing the block validation work and winning the current validation race.

    b) Bitcoins are not individually identified - they are only identified as quantities in transactions.  Therefore, you can't actually trace a bitcoin in the system, only the transactions.  This becomes even more evident when you pay attention to the fact that the smallest unit of currency the system will transact is not a bitcoin, but rather 1/100,000,000th of a bitcoin, which is known as a satoshi.

2) There is in fact a centralized ledger.  Not centralized in that there is only one copy, but centralized in that all transactions in the system can be stored on a single node.  Note that transactions are stored, not the Bitcoins themselves.  A person (wallet id, actually) can create outgoing transactions to spend Bitcoins (or fractions thereof) by referencing incoming transactions.  While not all nodes on the Bitcoin network maintain a full, up-to-date copy of the Bitcoin blockchain, many do.  These are full nodes and they can autonomously and authoritatively verify any transaction without external reference.  The size of the full blockchain can be found by conducting an internet search (ex. "bitcoin full blockchain size").  One site listing the historical size is: https://www.statista.com/statistics/647523/worldwide-bitcoin-blockchain-size/ .  According to this site, "The size of the Bitcoin blockchain has been growing since the creation of the Bitcoin virtual currency in 2009, reaching approximately 173 gigabytes in size by the end of June 2018."


Additionally, not worth mentioning on its own but as long as we are here, there is a typo in the article author's first Python function code example.  The function converts the parameters into a combined "token" object, but then does does not use that object in the hash function computation, instead using one of the function's input parameters.


For those wanting a whole book's worth of how Bitcoin works, I recommend the book "Mastering Bitcoin: Programming the Open Blockchain" by Andreas M. Antonopoulos.