Bitcoin and the UTXO Model

The Original Blockchain

In our journey towards interpreting blockchains as distributed computers, it makes sense to examine to examine Bitcoin, the first blockchain. Although Bitcoin's capabilities are limited, its simplicity allows us to understand the VM that powers Bitcoin in its entirety.

History of Bitcoin

2008 is a landmark year if we talk about significant impact across a wide variety of aspects of the world. Be it the Global Financial Crisis, the Presidential Election which resulted in the first African American, Barack Obama, elected as the President of the United States, or the Large Hadron Collider which was successfully launched to study the fundamental properties of matter.

What people came to recognize in subsequent years was another landmark event from 2008 which set the course for not only an alternative currency, but also revolutionized the the world by giving birth to Blockchain Technology. This is about the 8-pages that shook the world of Finance, to start with. Here’s a link to the Bitcoin Whitepaper hosted by the USSC: https://www.ussc.gov/sit...

This whitepaper led to the emergence of Bitcoin as a decentralized digital currency and a distributed ledger technology – Blockchain. Bitcoin is a decentralized digital currency that operates on a peer-to-peer network, eliminating the need for intermediaries such as banks or financial institutions. This definition itself implies an overhaul of the finance system as we’ve known since decades. We have always known to trust a central, regulatory agency such as a bank or the Central Bank of a country.

It is not like digital currencies were not in existence before the 2008 Bitcoin whitepaper launch. However, they suffered from a typical central issue – the problem of double- spending, which implies that a single digital token in a digital cash protocol can be spent more than once.

Bitcoin was able to solve this problem by defining the fundamental principles and mechanisms of a networking and architectural brilliance which later came to be known as Blockchain Technology – a decentralized ledger that records all transactions in the format of a chain of blocks, where each new block is linked to the previous block by means of a cryptographic hash, forming a chronological chain.

Few of the most important characteristics of blockchain got defined by this very design of the technology. It ensures that every piece of data (transactions) is immutable, transparent, and verifiable by anyone who’s a participant of the blockchain network. This tamper-proof nature of the technology is what made blockchain significantly different from vanilla databases.

So, how was the problem of double-spending solved by blockchain, specifically Bitcoin? The concept at the core of this is Mining. As a matter of fact, Bitcoin as a digital currency was created largely as an incentive to network participants who would work towards validating the transactions and keeping the network secure. This process of validation is called mining. For this to happen, the miners (nodes involved in the process of mining) harness substantial computational power to tackle complex mathematical puzzles, eventually facilitating the process of validating transactions and subsequently adding new blocks to the blockchain. As a reward for their contributions, miners receive newly minted bitcoins. This ingenious incentivization system serves as a driving force, motivating participants to contribute their computational capabilities, thus reinforcing the robustness and incorruptibility of the blockchain's security and integrity.

The first ever transaction was committed by a pseudonymous “Satoshi Nakamoto” on January 3, 2009. You can find the intricate details of the block that contained this transaction here: https://blockchair.com/bitcoin/block/0

Bitcoin as a currency also expounds what the first generation of blockchain technology looks like. Knowing the history of the most popular cryptocurrency will help form a very deep understanding of second generation which was brought about by the second-most popular blockchain – Ethereum. This entire course is about how Ethereum changed the world one more time over.

Script

The language that Bitcoin uses to allow developers to carry out all potential functionalities on the Bitcoin blockchain network is significantly different from what the language used in the case of the Ethereum blockchain network (more on this later). The Bitcoin Script is the programming language used for constructing transactions on the Bitcoin network and can help cover activities from sending funds between Bitcoin wallets to creation of multiple accounts. The Bitcoin Script is not a Turing complete language. A Turing- complete system is able to simulate the computational aspects of any possible real-world

system, provided the limitation of finite memory is ignored. This helps the Bitcoin Script to avoid infinite loops or execution scenarios that can consume a huge hash rate and slow down the entire network. This is very different from most of the languages in today’s world (most of which are practically Turing-complete), however, this behavior is what also makes it very secure as there is a hard limit on the kinds of operations it can support.

The UTXO Model

Bitcoin transactions work by using something called UTXOs (Unspent Transaction Outputs). These are basically outputs from previous transactions that can be used as inputs in subsequent transactions.

This approach towards handling transactions by the Bitcoin network is very different from the State-based model that is used by the Ethereum network.

To understand the UTXO model better, let us take a very simple example. When you visit a shopkeeper and are looking to buy a product worth USD 7, it might mean that you shall provide a USD 10 note to the shopkeeper and receive three USD 1 notes in return. In a nutshell and a very simplistic view, these three USD 1 notes will become outputs that will be available with you to be used as inputs the next time you’re looking to buy something where you could use any of these three notes.

However, the technology behind this works slightly differently. In the above example, if it were to happen on the Bitcoin network, each and every output (the USD 1 notes) you would have received would contain a combination of two kinds of scripts – a locking script and subsequently, an unlocking script. The locking script is called scriptPubKey, while the unlocking script is called scriptSig.

The locking script provides necessary conditions to the output which the unlocking script needs to fulfill to be able to use that particular output as an input in a subsequent transaction and be able to “spend it”. Largely, this is how the combination of the locking and the unlocking scripts look:

As you can see, the unlocking script contains the digital signature as well as the public key which are required to be able to unlock the input. The locking script, on the other hand, contains the Bitcoin address or the public key hash.

Last updated