Bitcoin the protocol and technology stack

As the Bitcoin user base keeps growing, we have over the last many years read from numerous sources on how it works. In most cases the word Bitcoin is omitted completely, and is instead explained as how the “blockchain technology” or “DLT (distributed ledger technology) underpinning Bitcoin works.

There is however no such thing as a “blockchain technology”, or DLT, nor is there anything in particular that can be copied from Bitcoin into another system to make it partially similar, since the sum of technologies that makes Bitcoin a unique protocol for value transfer, are known and well understood computer science principles.

What does however make Bitcoin unique is the consensus that has formed around using the same protocol rules, which in turn creates a network of operators, each hosting a copy of the transaction history, transacting within the network, and/or minting new coins and distributing said coins on the network. This unique ecosystem is what makes Bitcoin resilient, due to that all pieces in combination gives Bitcoin its unique properties, such as decentralization and permissionless utility.

We will explore some of the moving parts in our series about Bitcoin and The Lightning Network, in order to give a more factual and clear understanding of the technology, with a clear computer science description to it.

Linked Lists
Linked lists is what makes the blocks in the blockchain correspond to one another sequentially. Linked lists span all the way back to the 1950’s and are widely used in computer science for queuing mechanism.

Approaches such as Last-In/First-Out, or First-In/First-Out are widely used mechanisms in lists that need to be processed sequentially or process relationships between objects in a list. In the case of Bitcoin, the linked list format is storing hashes from the previous blocks which produces the sequential ordering of the blocks. As such what most refer to of being a “blockchain” technology is for the most part technology invented in the 1950’s and widely used in computer science today.

A linked list is a linear data structure, not stored in memory and is sequentially processed, while pointers are being used to point to the next portion of the data. In the case of Bitcoin, these are hashes, which are stamped into each block’s header and each block therefore has a perfect history from the first block up to the latest solved block. A theoretical explanation about linked lists can be found here.

Linked lists is what is usually deployed in what is often referred to as a blockchain system, rather than the consensus mechanism found in Bitcoin, which is depending on nodes, miners and the entirety of the network to keep it decentralized. Often the confusion stems from a lack of understanding of how technology works and what fundamental pieces makes something work in a specific way.

Scripting Language

Bitcoin is not just a “token” or a unit of value that is transported across the Bitcoin network by a send command. There is a computer language within Bitcoin, called Script. The language, Script, is what allows something like Bitcoin to be called programmable money, or smart contracts, a term named by Nick Szabo back in the 90s.

The scripting language gives us the option to construct transactions, with attached rules and conditions, thereby making money subjective to become fully programmable, but with build in constrains, maintained by the protocol rules that the full nodes of the network enforce.

Script is a stack based language, and is not Turing complete by design, which results in that all instructions terminate completely, thus limiting attack vectors on a transaction. Rules for every transaction are final, and once executed on the protocol level, meaning once included in the blocks and verified by the rules of the full nodes to be a valid transaction, no further conditions should be assumed about the given transaction, as they are final and have terminated. This makes Bitcoin programmable money, but without the risk of money once transacted behave differently than what settings were programmed into the transaction to begin with.

Script is a language that operates via operational codes, as a stack language, similar to Forth, but without using multiple stacks. Stack languages are very constrained in the way they operate, as pushing and popping data on the stack is allowed only in the top of the stack.

The protocol rules within Bitcoin define which script operations are possible, and what operations must be included in each transaction. It would for instance not be possible to transact a transaction to the network without including an ECC signature, since this is required on protocol level, and thus the transaction would never propagate across the network.

Script on the other hand allows for constructing of elaborate transactions, something that has never been possible, and is unique to Bitcoin. A transaction can for example be partially signed with a digital signature, passed on to another person to co-sign the transaction, and then finally broadcasted to the Bitcoin network. The transaction of a given value, to a given Bitcoin address would then require the very same digital signatures to access the value again. This opens up for possibilities to create smart contracts for value management, maintained by rules in a decentralized network, requiring only digital signatures to manage said funds, and not having to rely on third party arbiters.

The script language is continuously updated by open source developers to expand the capabilities of programmable money, contains a vast amount of possible operations already and is one of the most interesting aspects about Bitcoin itself. Much of it is never exposed to the general audience as the scripting language is often most utilized by wallets to create end-user products, and most of the more elaborate functions are yet to be found on consumer ready platform.

It is however possible to explore the scripting language in depth by reading about it here or here.

From a pure computer science point of view, Bitcoin looks like a giant script or a giant index of scripts that ascribes inputs to digital signatures, if we had to look at the raw output of all the data so far generated within the Bitcoin network. The only reason to why the behavior of said data differs from other systems, is the way that the network itself has agreed upon sharing the same data, in synchronization, ordered by the Bitcoin miners, validated by the full node participants, for the benefit of anyone wanting to use the network as a system for transacting value.

Be the first to comment

Leave a Reply