Three Fundamental Concepts Behind The Bitcoin Blockchain

bitcoin-2643159_1920.jpg

If you’ve been enjoying my writing, I want to encourage you to subscribe to the notification list so that you never miss when I post a new blog! It may even prompt me to write more often :) And now to the new post!

I have spent some time thinking about the topic of the first blog post. It is not easy to come up with a theme or several topics you can write about regularly. So I decided to use Austin Kleon's advice, from his book 'Show Your Work', by finding something that I want to learn about and committing to learning it in front of others. In my case, this will be cryptocurrencies.

With social and business media being flooded with discussions about Bitcoin and other cryptocurrencies, it is hard to ignore the topic, so then why not learn what it’s all about? 

I want to start this post series with Bitcoin, the first and most widely talked about crypto, and see where the road takes me. Is it a waste of our resources? Is it a speculative bubble? I don't have an answer yet, but let’s see what we can uncover.

In this post I am going to talk about three concepts that may look complex from first glance, but are the main pillars of the Bitcoin blockchain system, and therefore are essential for the journey I am planning to take in understanding the system. 

As a starting point of my learning adventure, I decided to use the quote from Robert Shiller’s latest book - Narrative Economics.

When I encounter Bitcoin enthusiasts I often ask them to explain some of its underlying concepts and theories, such as the Merkle tree or the Elliptic Curve Digital Signature Algorithm, or to describe Bitcoin as an equilibrium of a congestion-queuing game with limited throughput“.

Let me start with the Merkle tree. 

What is the Merkle tree?

Merkle trees are data structures that allow to map an arbitrarily large amount of data and effectively identify any changes that happen to it.

Merkle trees are based on cryptographic hash functions that map data from an arbitrary size input to a fixed size output. The output is called a hash - so-called fingerprints of data. As the output length is the same, large data sets could be easily stored and identified using the resulting hash, leading to storage savings and increased efficiency.

In other words, Merkle trees allow representing an n-number of data pieces (or transactions in the case of Bitcoin) with a single hash. 

To create a Merkle tree, we start with hashing individual transactions to create leaf nodes. Then we work our way up, continuously applying hash functions until we end up with only one hash - the root hash.

So what is the role of Merkle trees in the Bitcoin blockchain?

Merkle trees allow miners to include new transactions into new blocks that are added to the blockchain. The block header contains the hash root of the embedded tree. 

The blockchain network (other miners) can then easily verify the consistency of individual transactions hashing along the tree without looking at the whole set of hashed data pieces.

Elliptic Curve Digital Signature Algorithm

When discussing Bitcoin with someone, you may stumble across the idea of public and private keys. Understanding what these keys are and why the system needs them is the KEY to understanding the Elliptic Curve Digital Signature Algorithm (ECDSA).

The ECDSA is the mathematical operation that involves the use of Elliptic Curves to encrypt a data piece or a Bitcoin transaction. I know, this sounds a little complex, but let’s break it down.

In public-key cryptography, each person has a public key and a private key - a set of numbers with a specific mathematical relationship. 

Some would use the private key to create a digital signature (the method to guarantee any message) for any data piece. The private key performs a mathematical operation (the digital signature algorithm) on a cryptographic hash of the data.

A Bitcoin transaction typically involves a message along the lines of - "I give this Bitcoin to address X". The message is signed by a private key that the sender has and is submitted to the Bitcoin system. The address used is the cryptographic hash of the public key. 

The recipient would then use the public key to check that the private key and the appropriate signature validation algorithm were applied to create the signature.

In Elliptic Curve Cryptography, the public key is an equation of an elliptic curve and a point on this curve.

The equation of the elliptic curve is y^2 = x^3 + ax + b, and it looks like this:

Source: cloudflare.com


I will try to explain only the main aspects of the ECC concept, so please check out this article for a more in-depth explanation.

So, the elliptic curve has two interesting properties:

  • horizontal symmetry - any point on the curve can be reflected over the x-axis

  • and any non-vertical line will intersect the curve in maximum of three places

The second property tells us that any two points on a curve can be connected together by a line (dotted) to produce a third point.

If you take two points and dot the initial point with itself an n number of times you arrive to an arbitrary final point. It is hard to find n knowing only the initial and the final points.

The encryption process will resemble setting the message as x-coordinate and solving for the y-coordinate (using the elliptic curve equation) to get the public point on the curve. The private key is the number of times the public point is dotted or connected with itself.

Congestion-queuing game

The final concept I want to explore is the application of the queuing game in the Bitcoin system. 

Queueing theory is the mathematical study of formations, function and congestions of queues. One of the queuing problems studied is the service station problem. Users are queuing at a service station and are willing to voluntarily pay different transaction fees, based on their waiting costs, to gain priority at a service station. We can apply the same problem to the Bitcoin system. 

The main participants of the Bitcoin system are users, who make transactions with one another, and miners who maintain the system and arrange transactions into blocks. Every 10 minutes the blockchain randomly selects a miner who adds the block, with a maximum of around 2,000 legal transactions (a limit set by the protocol) to the chain by creating a new block. The system's throughput is, hence, capped and does not depend on the number of miners. 

Since the processing rate of transactions is limited, the users have to queue and create congestion. But, the users can pay higher fees to miners to gain priority in the queue.

We can view this whole process as an auction, with users bidding some amount (transaction fee) to spend less time waiting. How much the user is willing to pay depends on how costly it is for them to stand in the queue. 

According to Huberman, Leshno and Moallemi (2017), transaction fees in the Bitcoin system are determined by the equilibrium of the implied queuing game. They also argue that the transaction fees or payments will include the externality of the transaction (costs imposed by transaction A on lower priority transactions in a form of further delays). 

That is the equilibrium of a congestion-queuing game with a limited throughput. 

But why is it relevant for the Bitcoin blockchain? Sufficient congestion is needed to maintain the reliability of the system.

The queuing theory tells us that the greater the congestion of the system, the higher the transaction fees the users are willing to pay.

These transaction fees are one of the revenue streams for miners (the other is Bitcoin rewards), but miners cannot control them. So to maximise profit, miners prefer transactions with the highest associated fees. 

And here comes the answer. Higher congestion leads to higher profit for miners and attracts new miners to the system, therefore, making the system more reliable.

Afterword

I had some doubts about the extent someone needs to understand the concepts described in this blog post. I thought they are some niche areas of the Bitcoin blockchain and would be hard to get my head around. But it turns out that before you can call yourself a Bitcoin enthusiast, you need to understand the Merkle tree, ECDSA and the congestion-queuing game with limited throughput. 

Sources:

Merkle Tree: 101 Blockchains; Binance

ECDSA: Cloudflare

Congestion-queuing game: Queue It; Huberman, Leshno and Moallemi Paper

Mining: Binance

Previous
Previous

What type of energy does Bitcoin consume?