Category Cryptocurrencies and Bitcoin

Slides for Presentation on Bitcoin at ATA56

The slides for my presentation on Bitcoin and Other Cryptocurrencies: Illegal Money or a New Global Payment Option?” are now online. Download them here.

Further information:

Bitcoin and Other Cryptocurrencies: Illegal Money or a New Global Payment Option?

Most translators and interpreters, as well as everybody doing international business, know them well: high bank charges, sometimes coupled with exorbitant exchange fees, endless, complicated forms, long clearance times etc. Then there is the archaic way of paying via check. Given that this is the 21st century, one might think that there should be better, cheaper, faster ways for transferring money from person A to person B. There are, of course, Paypal and similar services, which however also involve non-negligible fees, and their newer relatives Apple Pay, Google Wallet, and the like. Neither of the aforementioned options is truly global. However, there are some new players on the global payment market: Bitcoin, or more generally, cryptocurrencies.

Aside from a somewhat “dark” reputation as a means to finance illegal activities, Bitcoin is surrounded by a certain shroud of mystery, since the common explanation of Bitcoin as a “peer-to-peer currency” is neither particularly transparent nor particularly descriptive. So, what IS Bitcoin? I will elaborate on this question in my presentation ST-6 in the Science and Technology track on Saturday at 11:15 AM – 12:15 PM at ATA’s 56th conference in Miami. In the following you will find a short preview.

Why is it so complicated to transfer money electronically from account A to account B?

All monetary transactions involve the following steps:

  1. Check that the sender actually possesses the required amount of money.
  2. Deduct the amount to send from the sender’s account.
  3. Transmit the specified amount of money to the recipient.
  4. Update the recipient’s balance with the transmitted amount.

Cash exchange between A and B

Cash exchange between two people


It should be obvious that a cash transaction accomplishes this without problems through the exchange of (very special) sheets of paper or pieces of metal that represent a specific monetary value.

Exchange of virtual money

Exchange of virtual money between two people

The electronic equivalent is necessarily more complex, since electronic transmissions always transfer only copies of files and since it is possible to transmit several copies (nearly) simultaneously. Electronic “cash” could therefore be copied and transmitted in arbitrary amounts, creating money out of nothing but electrons. Therefore, traditional electronic monetary transactions—such as ACH, wire transfer, PayPal, etc.—always involve one or more trusted intermediaries (and fees for the intermediaries’ services). The Bitcoin protocol, however, accomplishes electronic monetary transmissions WITHOUT such a trusted intermediary, by employing a peer-to-peer network and various cryptographic techniques—thus the term “cryptocurrency.”

The talk will explain the concept of peer-to-peer transactions and the Bitcoin protocol. It will become clear that the idea behind Bitcoin, the Bitcoin protocol, has the potential to disrupt several industries besides the banking sector. Therefore, venture capitalists are very interested in cryptocurrency R&D, because this disruptive technology can also be used for applications such as smart contracts or even completely decentralized elections. Unfortunately, while the disruptive potential of the idea behind cryptocurrencies is undisputed, the regulatory status of cryptocurrencies is still developing in most countries of the world. Therefore, it remains to be seen whether cryptocurrencies can really grow into a viable option for legal global monetary transactions.

The presentation will give a basic introduction into the aforementioned ideas and concepts such as the block chain, peer-to-peer transactions, cryptocurrency mining, etc. No advanced mathematical or cryptographical knowledge is needed. And there will be chocolate!

If you are unable to attend the talk, you are unfortunately going to miss out on the chocolate, but you can read a series of blog posts on the topic here:

Bitcoin and Altcoin Faucets

Faucets are websites, where generous (or not so generous) people give out BTC, most of the time in exchange for advertisements. Usually, you also have to solve Captchas in order to prove that you are not an automated bot. More often than not, these sites load pop-up windows with occasionally questionable content, but that’s how these sites make money. (I recommend a good anti-virus program!) Usually, you can never get more than a few Satoshis. A Satoshi is 0.00000001 BTC, or one hundred millionth of a BTC, the smallest BTC fraction the algorithm can currently deal with. Since the minimal amount of BTC in a transaction is currently 5430 Satoshis (0.00005430 BTC), these sites usually pay to another site, where the micropayments accumulate until your faucet earnings are over the minimum transaction limit. When you have exceeded the limit, these micropayment sites will pay out to your Bitcoin address.

Bitcoin Faucets

I list a few (OK, one…) of the more trustworthy faucets below:

Yes, there are referral commissions involved, these faucets are a bit like pyramid schemes… Still, I have obtained a few fractions of BTC this way, and if you want to just play around with BTC or other cryptocurrencies, this is a good way to get started without having to invest in mining equipment or get burnt in exchanges.

Get free crypto, guaranteed

You’ll notice that there aren’t many active faucets around anymore. Plus you really need to click a lot to make any reasonable amount of money. However, there is the Coinbase Earn program, where you can actually make anywhere from $50-150 a year. (Yes, I get a referral commission here, too.) In June 2021, you can earn $28 right now, simply by watching introductory videos on various crypto tokens.

For more information on Bitcoin, see my blog post series:

Bitcoin Part 4 – Wallets, Sending and Receiving Bitcoins, Faucets, Exchanges

This is part 4 of my series on Bitcoin. Part 1 featured an introduction and can be found here, part 2 discussed the mysterious operation of creating Bitcoins, called mining, and part 3 explained the public ledger, the block chain. For those of you for whom this was all a bit too theoretical and/or esoterical, what with all the Byzantine generals floating around, here’s a practical guide.

Disclaimer: The legal situation regarding cryptocurrencies is constantly changing in many countries, and in others, even the possession of Bitcoin and other cryptocurrencies is outright illegal. Therefore, nothing you read here can be construed as legal or financial advice. It is your own responsibility to know and follow all applicable laws.

Bitcoin Wallets

Let’s begin with the first thing you need to obtain Bitcoins, a wallet. A Bitcoin wallet has the same function as its physical counterpart, namely to store money, which can then be transferred. Actually, as explained in part 3, a Bitcoin wallet doesn’t store Bitcoins, but in fact transaction receipts. However, for all practical purposes it can be viewed as the equivalent of a physical cash wallet. And like a cash wallet, your money is gone when the wallet is stolen or lost, therefore, it is highly recommended that you secure your wallet by encrypting it with a password and backing it up.

You can get wallets from the source, Bitcoin.org. If you download the Bitcoin Core, you’ll get a full Bitcoin client, which transforms your computer into an active node on the Bitcoin network, and which you can also use for mining. Here, the drawback is that you need to download and store the entire block chain on your computer. The block chain is currently 40 GB in size and growing. The download can take a while and updates can take a while as well.

There are all sorts of alternative, lightweight wallets, mobile wallets, online wallets, and even paper wallets. Online wallets should be used with caution, because these are always the targets of hackers, like every other financial institution. Unlike traditional financial institutions, however, in most cases, the money that is stolen is irretrievable, since Bitcoin transactions are not reversible and cannot be traced easily (as is evident from part 3 of this blog post series). You can find a good list of wallet options here.

If you decide to go with the full client, you should periodically check Bitcoin.org for updates. While this does not happen frequently, it does happen occasionally that the block chain forks, that is, that there is no common consensus among the nodes about which block is valid when two blocks are discovered simultaneously (see part 2 of the post series). If you continue to use an outdated client/wallet, you may be on the wrong fork after the block chain is reconciled, and any transactions you made in the meantime will be invalid. In fact, such a (rare) fork happened just two days ago.

Below, I am showing my Bitcoin Core wallet running on a Mac. The versions for other operating systems look fairly similar. I blacked out the balances and transactions for obvious reasons. In the lower right corner you see the status of the client. My client is locked and encrypted, and the block chain synchronization is up to date.

Bitcoin Core wallet

Bitcoin Core wallet

As mentioned above, the first thing you should do is encrypt your wallet. This is accomplished in the Mac version by clicking on Settings > Encrypt wallet. You will be asked to enter the passphrase every time you make an outgoing transaction.

Transactions

In order to make transactions, in particular, to receive Bitcoins, you need to create a receiving address. This can be done via the menu, for Mac the option is File > Receiving addresses, as shown below. After clicking on “New”, you are asked to create a label for the address, which is just for you to distinguish the transactions and not broadcast. The client creates an address automatically when you click OK.

Receiving addresses

Receiving addresses

Likewise, you can create an address book of addresses you want to send Bitcoins to, as shown below. Note that it is your responsibility to check that these addresses are valid and belong to the correct recipients. The Bitcoin network does not check this for you!

Send to addresses

Send to addresses

Sending and receiving is now pretty straightforward via the two send and receive tabs, as shown below. When sending Bitcoins, you can increase or decrease the transaction fee. Unless you are an expert, I would leave the default, since the transaction fee determines the confirmation priority in the mining process. You do not need to be online to receive Bitcoins, since everything is handled automatically by the Bitcoin network. You also do not need to stay online to wait for confirmation after pressing the send button in your client.

Bitcoin core "Send" tab

Bitcoin core “Send” tab

Bitcoin core "Receive" tab

Bitcoin core “Receive” tab

The remaining functions of the Bitcoin Core client are pretty self-explanatory. The Help menu contains a debug window and advanced command line options, which go beyond this introductory post.

Now you have set up a wallet and some addresses. How do you actually obtain Bitcoins?

Bitcoin Exchanges

One option is to exchange regular currency into Bitcoin at an online exchange. However, proceed with caution, since not all exchanges are operated legally, and assets can be frozen at any time by the authorities. Depending on your location, even using an exchange may not be legal. Furthermore, exchanges are frequently the target of hackers, and many people’s assets have disappeared irretrievably in the past.

Moreover, thanks to speculation, the Bitcoin exchange rate is fluctuating wildly, even as we speak. The exchange rate to US Dollars as a function of time is shown below. Some of the exchange rate “crashes” are in fact due to large quantities of BTC being stolen from exchanges. The BTC exchange rate and the entire economical microcosm would probably make for a few interesting economics studies and publications, but I digress.

BTC USD exchange rate

BTC USD exchange rate

Your safest bet to obtain some BTC to play around with is therefore to obtain them from so-called faucets (see next section). Alternatively, a safe exchange option is Coinbase, which, however, has some fairly large fees. OTOH, Coinbase has the Coinbase Earn program, where you can actually make anywhere from $50-150. An alternative for US-residents is Robinhood, where you can trade stocks and cryptocurrencies commission-free. However, Robinhood does not currently allow you to transfer or send your cryptocurrencies outside of Robinhood. (Yes, I get a referral commission here, too.)

Faucets

Faucets are websites, where generous (or not so generous) people give out BTC, most of the time in exchange for advertisements. Usually, you also have to solve Captchas in order to prove that you are not an automated bot. More often than not, these sites load pop-up windows with occasionally questionable content, but that’s how these sites make money. (I recommend a good anti-virus program!) Usually, you can never get more than a few Satoshis. A Satoshi is 0.00000001 BTC, or one hundred millionth of a BTC, the smallest BTC fraction the algorithm can currently deal with. Since the minimal amount of BTC in a transaction is currently 5430 Satoshis (0.00005430 BTC), these sites usually pay to another site, where the micropayments accumulate until your faucet earnings are over the minimum transaction limit. When you have exceeded the limit, these micropayment sites will pay out to your Bitcoin address.

I list a few (OK, one…) of the more trustworthy faucets below:

Yes, there are referral commissions involved; these faucets are a bit like pyramid schemes… Still, I have obtained a few fractions of BTC this way, and if you want to just play around with BTC or other cryptocurrencies, this is a good way to get started without having to invest in mining equipment or get burnt in exchanges.

Get free crypto, guaranteed

You’ll notice that there aren’t many active faucets around anymore. Plus you really need to click a lot to make any reasonable amount of money. However, there is the Coinbase Earn program, where you can actually make anywhere from $50-150 a year. (Yes, I get a referral commission here, too.) In June 2021, you can earn $28 right now, simply by watching introductory videos on various crypto tokens.

This concludes part 4 of the Bitcoin blog post series. Next, we’ll look at altcoins, cryptocurrencies that differ more or less from the Bitcoin protocol, and other alternative uses of the block chain.

Bitcoin Part 3 – Hashes, Public Key Cryptography “for Dummies” and the Block Chain

This is part 3 of my series of blog posts on the topic cryptocurrencies. The first, introductory part can be found here. The second part on mining can be found here.

Recap – Bitcoin = direct electronic transactions without intermediary

To recap, I explained the main idea behind the Bitcoin protocol, which allows electronic peer-to-peer transactions without an intermediary. In brief, the process works as follows:

  1. I own a certain amount of Bitcoin. This can be publicly verified, because every Bitcoin transaction since the very first one is entered into a public ledger called the block chain. So I can’t pretend to have more money than I have.
  2. I can send a certain amount of Bitcoin to a recipient, and I can’t cheat while doing that, because the transaction is publicly broadcast to all nodes in the network.
  3. I could simultaneously send out more Bitcoins than I have, but the network decides through a process that is a bit like voting (and in reality involves solving a complex math problem) called mining, which transactions are valid and which ones aren’t.
  4. The transactions that are chosen as valid are entered into the block chain, the public ledger, and become final. And once I’ve depleted my verifiable amount of Bitcoins, I can’t spend more than I have (or double-spending), because everybody knows that I’ve got nothing.

The two key elements in the Bitcoin process are the public ledger, the block chain and the “voting” process called mining, which is actually carried out by the computers forming the nodes of the network in form of solving a complex mathematical problem. Mining was discussed in the previous blog post, which can be found here. Let’s now look at the “public ledger”, the block chain.

The Block Chain

As mentioned previously, the block chain is a public ledger with all Bitcoin transactions that have ever taken place since the very first one, the so-called Genesis Block. Every active node in the Bitcoin network has a copy of the block chain. And every time a new “block” is discovered via mining, it is appended to the block chain, as the name suggests. In other words, the block chain is a big list of Bitcoin transactions.

Roughly speaking, and translated from crypto-geek speak into plain English, a block consists of the following main elements (plus a few others, which are technical details):

  • A timestamp
  • A reference to the previous block — thus the name chain
  • The transactions that are being confirmed in this block and thus being finalized and publicly broadcast
  • A statement of a new complex mathematical problem to be solved for the miners

The block chain can be publicly accessed via a local API, that is, a Bitcoin client, or searched via the web-based API with a web-browser at https://blockchain.info/en, shown below.

Blockchain.info

Blockchain.info

What you see in the web-based API, is the block height, which is nothing else but the block number, the age of the block (corresponding to the timestamp), the number and total value of the transactions in this block, the name of the computer (or mining pool) that managed to solve the mathematical problem (discover the block while mining) and the storage size of the block. Below this list is a list of the latest transactions on the left as well as a search box on the right, where you can search for transactions, and a news-feed.

When you click on a particular block (the number in the column “block height”), detailed information about the block and the transactions in that block is displayed, as illustrated below (click to enlarge). If you click on the map, you can even see where these transactions came from, obviously to be interpreted with care, since a lot of BTC users use VPNs to mask their true location, partly, because the legal status of Bitcoin is not entirely settled in most countries and not necessarily, because they use it for money laundering, but that happens, too.

Detailed block information

Detailed block information

When you scroll further down, you get to a list of transactions, as shown below. Each transaction is also numbered with a funny numbering value, called a hash, more on that below. The first transaction “647b…” shows the reward for mining this particular block, in this case 25 BTC. You can see that this is the mining reward, because there is no transaction input, which means, the coins are mined.

Transactions in the block

Transactions in the block

The other transactions show inputs and outputs and the amount of BTC that are transacted. The inputs and outputs are labeled with Bitcoin addresses, also encoded as hashes. Bitcoin addresses generally start with a “1”, in some cases with a “3”. The addresses serve basically the same function as a common bank account number, however, there are significant differences to bank account numbers, which generally do not change between transactions. Before I can explain the rest of the elements of the block chain in detail, I have to answer the following question:

How are these funny addresses obtained, and what is a hash?

Hash Functions

Hash functions have nothing to do with potatoes and cooking. If you are not mathematically inclined, no worries, you do not have to run for the hills, I will try to keep the explanation in plain English. A hash or hash value is the result of a hash function. Mathematically speaking, hash functions take an alphanumeric input, perform some computational magic, and spit out another alphanumeric value of a predetermined length.

Hash function

Suppose you took the well-known phrase “To be, or not to be” of Shakespeare’s Hamlet and input it into a specific hash function called SHA-1, you obtain the output
03c6691ebdd161363457e3c73a8ed44186536cf9.

Suppose Shakespeare and his editor are having a disagreement about punctuation, and the latter inputs “To be or not to be” without the comma into SHA-1. The result he gets is
6025f94596c2445f0a776d9bac929829de3c948d.

Now, suppose Shakespeare is transported in time to the 21st century and texts “2B~not2B“. The output of SHA-1 now gives
5ed97a13c423c7abea25de49472f7043f156d31c.

As you can see above, all the messages have hashes of the exact same length, regardless of the length of the input. In addition, all the messages have hashes that are entirely different from each other, even though they have the exact same meaning, and even if two of them only differ in one comma.

In summary, hash functions have the following properties:

  • A given input has a precisely predictable output of a specified length, usually, but not necessarily much shorter than the input.
  • Even if the input is only slightly changed, the output differs dramatically.
  • If the hash function is of the cryptographic variety, it is very difficult, if not practically impossible, to infer the original input, given only the output. The degree of difficulty/impossibility depends on the strength of the encryption used.

The astute reader will have noticed that if the input is much longer than the fixed-length output, but consists of the same (alphanumeric) characters, then there is the possibility that several different inputs give the same output, since it’s a many-to-one mapping. This is called a collision. In the example above, SHA-1 is an algorithm with 160 bits, i.e. with 160 positions that can be either 0 or 1. So, there are 2^160 or more than 10^48 (that’s a 1 with 48 zeroes) different values. Without going into all the gory mathematical details, it suffices to say that for most of the algorithms used today a collision is extremely unlikely.

Going back to the block chain transaction example shown above, a Bitcoin address hash is nothing more than a way to label the sender and the recipient of each transaction. However, since everybody can publicly access the public ledger, everybody can also see who sent whom how much money, from where to where, and at what time. If this sounds too Orwellian 1984-ish for you, no worries, Bitcoin has a certain pseudonymity, if not anonymity built in. Before I can explain how Bitcoin addresses are actually created, however, I have to explain another cryptographic concept.

Public Key Cryptography or The Return of the Byzantine Generals

Yes, the Byzantine generals of part 1 are back by popular demand in this attempt to explain public key cryptography. I borrowed (and slightly modified) the following excellent explanation from Panayotis Vryonis, because I could not come up with a better non-mathematical analogy myself.

Suppose there is a Byzantine general, who communicates with his lieutenants via a secret mailbox. Now, since this is taking place in the olden days, said secret mailbox is a physical mailbox with a physical lock. But not just any lock, a very special lock with 3 positions, A, B, and C, as illustrated below. In positions A and C, the mailbox is locked, in position B, the mailbox can be opened.

Lock with 3 positions

Lock with 3 positions, A and C are locked, B is open.

The general has some very special keys for this lock. A set of (identical) keys that he distributes among his lieutenants, which can only be turned counterclockwise, from C to B to A. We’ll call them public keys. And a special, unique key that he keeps for himself, which can only be turned clockwise, from A to B to C, his private key.

Byzantine key

Byzantine key

If the general now wants to leave a message for his lieutenants, he writes it on some parchment and locks it into the mailbox with his (private) key, turning the lock clockwise all the way to C, the second locked position. The next lieutenant who happens to come along uses his (public) key to open the mailbox, turning the lock counterclockwise to position B to open the mailbox and read the message. It just so happens, that this lieutenant is plotting to overthrow the general. As part of his evil plan he puts his own message into the mailbox, pretending to come from the general, and turns the key counterclockwise, such that the lock ends up in position A, because that is the only direction his (public) key will turn. However, thanks to the fiendish cleverness of the general, the only person who can open the lock now is the general himself with his private key, since this is the only key that turns clockwise. This way, the only person who can put messages into the box that can be read by anyone with the public key is the general himself, thus ensuring the authenticity of the messages to his lieutenants.

This is precisely how public key cryptography works, except the keys are created digitally and not made of bronze. The computerized equivalent of the above procedure is called a digital signature, where the asymmetry between private and public keys ensures the authenticity of the signature.

Again, to summarize the process of public key cryptography in bullet points:

  1. A unique pair of a public and a private key is created.
  2. The public key is broadcast to all recipients.
  3. The private key is kept secret.
  4. All messages or (in the case of Bitcoin) transactions are encrypted with the private key, the equivalent of locking them into the mailbox above.
  5. The message is then sent to the recipient(s).
  6. The message (or transaction) can be authenticated and decrypted by anyone with the public key.
  7. It is (next to) impossible to fake messages (or transactions) without knowledge of the private key. Impostors are out of luck. (Of course, with enough computing power, any currently known encryption can be cracked. For the commonly used algorithms, however, enough computing power means more computing power than currently exists on the entire planet, unless somebody finally manages to construct a functioning large-scale quantum computer.)

Warning: Since Bitcoin transactions involve private keys, whatever you do, do NOT give out your private key. Furthermore, if you lose your private key, you’re out of luck as well! Any transactions made with that private key will be forever lost.

The Blockchain Revisited

Let’s look again at a few transactions:

Transactions in the block

Transactions in the block

Every transaction involves Bitcoin addresses in form of hashes, which are basically derived from public keys. Thus, every address is linked to a private key that is owned by somebody and generally stored in a so-called wallet. For every private key, you can generate an essentially unlimited supply of public addresses, if you want to, a separate address for every single transaction you make. The key point here is that you don’t have a Bitcoin address; you have a private key that is associated with a large number of public addresses. Since every transaction is public, along with the address, it is recommended to not use the same address for every transaction.

Let’s look at the second transaction, “7cdb…” in the picture above. Here, address “1M4sn…” sends 1.2 BTC to address “1A83Re…”. What about the 28.79999671 BTC that are shown as being sent to address “18TLH…” in the same transaction? This is the BTC equivalent of getting change back. Before you get too confused, I need to explain that Bitcoins are NOT stored as coins, in units of BTC, or even Satoshis (0.00000001 BTC, or one hundred millionth of a BTC, the smallest BTC fraction the algorithm can currently deal with). Bitcoins are in fact not stored anywhere, the only thing that’s being stored are transactions, via the block chain. The transactions can be looked up by anybody, as we just did above. Let’s look at this particular transaction in more detail, which you can do by clicking on the hash identifier of the transaction. The result is shown below.

Bitcoin transaction detail

Bitcoin transaction detail

Suppose you are new to Bitcoin and start from scratch. You get yourself a wallet (I’ll explain how to do that in part 4 of the series), set up your private key and generate one or more receiving addresses. A (very) kind soul sends you 30 BTC. Now, you have 30 BTC in your wallet. You want to send 1.2 BTC to somebody, in this case, address “1A83Re…”. So you set up the transaction, but the Bitcoin algorithm only works with whole transactions, so the algorithm gobbles up the entire 30 BTC that you have, sends 1.2 BTC to “1A83Re…” and sends the change of 28.8 BTC minus the mining fee of 0.00000329 BTC, that is, 28.79999671 BTC back to you, thereby creating a new address “18TLH…” for you. Think of the 30 BTC as a (large) banknote. Let’s say you have 30 Dollars in your real-life wallet, in form of a fictitious 30 Dollar bill. If you want to give somebody 1.2 Dollars, you don’t tear off 4% of the paper bill and give it to the person, you give them the whole bill and they give you change back. The same happens with BTC. You hand over the entire “bill”, and get a “bill” worth 28.79999671 BTC back, and the whole thing is recorded in the block chain.

You can now use the address “18TLH…” to send those 28.79999671 BTC or a fraction thereof to somebody else, or you can create a completely new address to send these coins. The proof that you actually own those BTC or essentially, that the transaction is yoursremember, you don’t actually own Bitcoins, you own the equivalent of transaction receipts — is performed with the address, which only you can create with your private key, and a digital signature in the transaction, which also only you can create, and both of whose ownership can be verified by everybody else via the public key that goes along with your private key.

The Bitcoin developers recommend using a new address for every transaction for the sake of anonymity, but that’s totally up to you. Remember, all transactions ever made since the very first Genesis transaction are publicly accessible on the block chain, just like the ones we looked at above. There are completely legitimate reasons that you may want to stay somewhat anonymous, even if you don’t launder money or are involved in dubious transactions. I don’t have a problem that everybody knows that I just bought a pile of broccoli at the grocery store, but hypothetically speaking, perhaps I wouldn’t like to announce to the world, and especially not to a nearby bike thief, that I just bought a new racing bike.

If your head is spinning after parts 1, 2, and 3, it’s really not that complicated. Yes, the practical implementation is complicated, which includes hash functions and cryptography, but the basic idea still is to provide the world with digital money with the equivalent simplicity of cash while preventing evil forces to steal everybody’s money. This involves a public “voting” system called mining, verification of ownership via public key cryptography, and some form of anonymity via cryptographic hash functions.

In the next installment, I’ll discuss how to actually get a wallet, and how to actually send and receive Bitcoins, which is really quite simple. However, as mentioned previously, in some places cryptocurrencies are illegal, and in some places (such as California) the legal situation is in constant flux, so nothing you read here can be construed as legal or financial advice, simply because I’ve already got a full-time job and several intensive part-time hobbies, and trying to keep up with the legal situation in regards to cryptocurrencies is a full-time job in its own right.

Bitcoin Part 2 – Bitcoin Mining

This is part II of my series of blog posts on the topic cryptocurrencies. The first, introductory part can be found here.

Recap – Bitcoin = direct electronic transactions without intermediary

To recap, I explained the main idea behind the Bitcoin protocol, which allows electronic peer-to-peer transactions without an intermediary. In brief, the process works as follows:

  1. I own a certain amount of Bitcoin. This can be publicly verified, because every Bitcoin transaction since the very first one is entered into a public ledger called the block chain. So I can’t pretend to have more money than I have.
  2. I can send a certain amount of Bitcoin to a recipient, and I can’t cheat while doing that, because the transaction is publicly broadcast to all nodes in the network.
  3. I could simultaneously send out more Bitcoins than I have, but the network decides through a process that is a bit like voting (and in reality involves solving a complex math problem) called mining, which transactions are valid and which ones aren’t.
  4. The transactions that are chosen as valid are entered into the block chain, the public ledger, and become final. And once I’ve depleted my verifiable amount of Bitcoins, I can’t spend more than I have (or double-spending), because everybody knows that I’ve got nothing.

The two key elements in the Bitcoin process are the public ledger, the block chain and the “voting” process called mining, which is actually carried out by the computers forming the nodes of the network in form of solving a complex mathematical problem. I’ll discuss the block chain in the next post, here I’ll focus on mining.

Mining without Shoveling Coal

The key issue that the mining algorithm needs to solve is to ensure that the “voting”/confirmation process is such that nobody with bad intentions can influence it in their favor. And this is exactly what the mining process accomplishes.

Coal mining

Traditional form of mining (Picture donated by the company Eickhoff Engine Works and Iron Foundry, Bochum.)

Mining denotes the process by which a set of new transactions are confirmed and finalized by appending a record of these transactions to the block chain, the public ledger. It is also the process by which new bit”coins” are minted, thus the term “mining.” New Bitcoins are minted and transactions are confirmed in form of chunks of data, so-called “blocks,” that are appended to the block chain. The Bitcoin algorithm is such that new blocks are discovered roughly every 10 minutes.

Roughly, the process works as follows:

  1. The Bitcoin network consists of lots of active nodes on which the Bitcoin client is run. When a block is discovered it is added to the block chain, and every node in the network receives information about that new block within fractions of seconds. Roughly speaking, that block also contains a statement with the next computational problem that is to be solved in order to discover the next block.
  2. People send their as of yet unconfirmed transactions, that is, transaction proposals out into the network, along with a transaction fee. Naturally, because computer transmissions are happening in finite time, not every node will receive all these transactions in the same order. Therefore, the new potential additions to the ledger, the transaction proposals, will not be the same list for every node in the network.
  3. Meanwhile, the active Bitcoin nodes all start to compute the solution to the problem stated in step 1, whereby there is a certain randomness involved, so that not everybody computes the same thing. I will discuss the mathematical details in a separate blog post.
  4. After on average 10 minutes, one of the nodes discovers the solution to the problem in step 1 and broadcasts the solution to the network along with its particular copy of the new additions to the ledger.
  5. The rest of the nodes validate the solution and this particular copy of the new transaction proposals, thereby confirming the transactions that that particular node has received.
  6. After 100 nodes have confirmed that everything is in order, the lucky (and/or computationally powerful) node that found the solution collects the transaction fees mentioned in step 2, as well as gets a certain amount of newly minted Bitcoins (BTC). This is the incentive for the general public (the nodes) to participate in the network and go through the trouble of validating other people’s transactions.
  7. And we begin again with step 1.
Bitcoin mining

Bitcoin mining

Why do the miners need to solve a math problem?

The explanation above leaves many open questions, the one in the section header above among them. The math problem is there to insert a certain (but carefully designed) randomness into the process, such that nobody can predict which node will be the one to confirm the next block. This makes it much harder to rig the system. This process is referred to as proof of work. There is one way that the system can be unduly influenced, with a so-called 51% attack, see below.

But why is the algorithm such that a new block is found every 10 minutes, why not faster? If the process were significantly faster, the problem of a fork in the block chain, when multiple nodes discover a solution simultaneously, would be exacerbated. Occasionally it happens in the current scheme that two or more nodes discover a new block at the same time, but the timing of 10 minutes between blocks is enough to avoid a complete forking of the block chain, which would create two or more independent public ledgers. With the current scheme, these forks are usually discovered before a whole new chain can form and contain only one new block. These blocks are removed from the block chain by consensus and are called orphaned blocks.

Another question that arises is: If there are new Bitcoins minted with every block, doesn’t this automatically lead to inflation? No, because the amount of new Bitcoins created in every block halves every 210,000 blocks. At the time of writing (June 2015), 25 new BTC are minted with every block. By 2017, this will be halved to 12.5 BTC per block. The current number of BTC in circulation is shown in the following graph (Data source: Blockchain.info). Eventually, the amount of new BTC will go to 0 and the total amount of BTC will be capped at 21 million BTC. This will happen sometime in 2140, so not anytime soon. By that time, the miners will get only the transaction fees as reward. More info about the 21 million cap can be found here.

Number of BTC in circulation (Data source: Blockchain.info)

Number of BTC in circulation (Data source: Blockchain.info)

Then, the question arises: Couldn’t you buy so much computing power to completely overpower all the other nodes in the system, which would enable you to enter arbitrary amounts into the block chain, which you could confirm yourself and thereby making you infinitely rich? This is called a 51% attack and the Bitcoin equivalent of counterfeiting. In order to take over the Bitcoin network, you’d need at least 51% of the network’s computing power. However, this is increasingly unlikely, since veritable BTC mining farms have been built due to the speculative value of BTC, which at one time was over $1000 per BTC (see graph below, click to enlarge). At that time, it made economic sense to invest heavily in server farms such as the one shown below. However, because the difficulty of the mathematical problem to be solved in order to mine (mint) new blocks (coins) is algorithmically adjusted such that on average only every 10 minutes a new block is found, regardless of how much computing power is thrown at the problem, this arms race led to an exponential increase in the difficulty, as illustrated in the last graph below (click to enlarge). Thus, a 51% attack is unlikely, unless many miners pool together in so-called mining pools. In fact, this is what most people mining BTC do these days, because it is next to impossible for an average person who doesn’t own a supercomputer server farm to mine a block solo, thanks to the increase in difficulty.

BTC market capitalization in USD (Data source: Blockchain.info)

BTC market capitalization in USD (Data source: Blockchain.info)

BTC mining difficulty (Data source: blockchain.info)

BTC mining difficulty (Data source: blockchain.info)

This concludes part 2 of my Bitcoin blog series. Stay tuned for part 3, where I will discuss the public ledger, the block chain, and how to read the information contained therein in more detail.