The Blockchain explained
By: Rasmus Bøgelund Christiansen
Tags: Distributed Ledgers, Distributed Systems, Blockchain, Ethereum, Bitcoin

This was originally written as paper on my master's degree in Digital Innovation and Management.

The components of Bitcoin (Blockchain 1.0)

To understand how blockchain works, let us first look at how bitcoin works through an example of a simple transaction.

A simple transaction

A wants to transfer money to B. The transaction is represented online as part of a ‘block’. The block is then shared with every node in the distributed network. Nodes (Miners) in the network then approve the transaction, and the block can have access to the chain, alongside with the rest of the transactions, which provides an irreversible and transparent record of transactions. The money then moves from A to B. This is, of course, very simplified, hence, the reason for us to dive deeper into the components of the blockchain. In the white paper by Satoshi Nakamoto (2008) the process is as:

New transactions are broadcast to all nodes. Each node collects new transactions into a block. Each node works on finding a difficult proof-of-work for its block. When a node finds a proof-of-work, it broadcasts the block to all nodes. Nodes accept the block only if all transactions in it are valid and not already spent. Nodes express their acceptance of the block by working on creating the next block in the chain, using the hash of the accepted block as the previous hash.

In the original white paper on the blockchain, a transaction has four components; Owner Public Key, Hash, Owner of Signature and Owner’s Private Key. The four components are explained below.

Blockchain from 1.0 to Blockchain 2.0

Blockchain was first introduced in the source code of Bitcoin. For the sake of the discussion, Blockchain and Bitcoin are distinguished from each other although some authors seem to see it as the same, as blockchain is only alive because of Bitcoin. One could argue that Blockchain 1.0 is used because of Bitcoin, which was a counter-attack to the centralized financial world, whilst Blockchain 2.0 and smart contracts move away from Bitcoin and have created alternative Blockchains such as Ethereum Frontier (Block Chain (Database), Wikipedia. N.p., 2016). Thereby, Blockchain 1.0 was introduced in the usage of Bitcoin, while Blockchain 2.0 was communicated from Satoshi Nakamoto (the creator of Bitcoin), as an opportunity to create alternative technological innovations using the same technology from which Bitcoin was created (Swan, 2015, p. 9). Smart contracts have a longer history than just Blockchain. Smart contracts as a term were coined by Nick Szabo in 1993 (Smart contract, 2016).

With the transformation from Blockchain 1.0 to Blockchain 2.0 a crucial element was needed, if one wanted to use Blockchain for other things than just handling coin — it needed a more robust scripting system: Turing Completeness. A computer is “Turing complete if it can solve any problem that a Turing-machine can, given an appropriate algorithm and the necessary time and memory” (Turing complete, 2016; Kepser, 2004, p. 1)). That means that it is a complete scripting language that can run any coin, script or cryptocurrency project. (Swan, 2015, p. 21). Blockchain 2.0 has extended functionality to the predecessor Blockchain 1.0; Swan (2015) explains Ethereum as being “… a fundamental underlying infrastructure platform that can run all blockchains and protocols, rather like a unified universal development platform. “ (Swan, 2015, p. 21).

Having established the historical context, the next section will focus on the individual parts of Blockchain.

Blockchain and its parts

Distributed network

As one might know, the database, as well as the network in the Blockchain, is a distributed one. Blockchain is often described as “… the public ledger of all Bitcoin transactions that have ever been executed. It is constantly growing as miners add new blocks to it (every 10 minutes) to record the most recent transactions.” (Swan, 2015, pp. ix-x). That said, the blockchain is a giant spreadsheet (ledger) that collects all transactions.

Let us use the example of a bank to explain the term distributed network. When we have a bank, we need to access the bank somehow to make a transaction. That means that we need to go through a centralized entity to do so, and this is what we call a centralized network. However, what if we want to transfer money to a person in a different country that has a different bank? Then we will have more centralized nodes in the network because all transactions have to go through the banks of the sender and the receiver. The way the Blockchain works is to remove the centralized entity (the bank) and distribute the access to all the nodes in the network. That means that if one wants to transfer something to a receiver, the bank does not have to accept the transfer, but all the nodes in the network do.

Cryptography

One of the reasons for blockchain to be so secure is because of cryptography which “… arose as a means to enable parties to maintain the privacy of the information they send to each other, even in the presence of an adversary with access to the communication channel.“ (Bellare & Rogaway, 2005, p. 7). Cryptography derives from Greek, and it means hidden language. The art of cryptography is to hide language and thereby secure communication so that no third party can interfere when a message is sent from A to B. For this to happen we make use of protocols. The protocol is “ … a collection of programs (equivalently, algorithms, software), one for each party involved. “ (Bellare & Rogaway, 2005, p. 8). Regardless, for the parties to communicate, they need to speak the same language. These protocols make sure that the sender and the receiver speak the same language when the sender encrypts the message, and the receiver decrypts the message to read it. However, this is not that simple, and there is more to this than explained here. In cryptography, there are two trust models: Symmetric (shared key model) and the asymmetric (public key model). This paper will only go into depth with the asymmetric model since this is the one used in the Blockchain technology.

Public Key, Private Key, and Digital Signature

As mentioned above, the Blockchain makes use of the asymmetric (public key) model. In the following section, I will explain the function of Private -and Public Keys.

The Public Key is public, while the Private key is only known by the owner of the key. Since these keys are generated, the keys correspond, and the “Public Key may only be decrypted by its corresponding Private Key and vice versa” (Public Keys And Private Keys, Comodo, 2016; blog.vrypan.net., 2013). We can explain it as: Alice has a set of physical keys. Key A that can only turn clockwise from A (locked) to B (open) to C (locked), and Key B that can only turn anticlockwise from C (locked) to B (open) to A (locked). Key A is Alice’s private key. Key B is distributed: the public key. If Bob leaves a message to Alice, Bob uses Alice’s Public Key (key B) to do so. Bob leaves a letter and turns the key in locked position A. Alice then opens the lock with her key (Key A) that turns from A-B-C. This system secures that Alice is the only one who can unlock the lock with the Private key (Keyblog.vrypan.net., 2013). That is, of course, a simplified example, and if we put this into the context of IT, the process will sound a bit different. However, the principle is the same: the receiver is assumed to know the Public Key, and whom it belongs to. When the sender wants to send a message, the sender attaches some bits, which is called a signature for the message. The bits are computed as a function of M and the Private Key by applying a signing algorithm. When the receiver receives the message and the attached bits, he/she checks if the message is okay with the use of the Public Key of the sender by applying a verification algorithm. If the algorithm accepts the message it goes through, otherwise, the receiver sees the message as an attempted forgery (Bellare & Rogaway, 2005, p. 11). Katz & Lindell describe the process as being “… comprised of three algorithms: the first is a procedure for generating keys, the second procedure for encrypting, and the third procedure for decrypting.” (Katz & Lindell, 2014, pp. 5–6). The code of the Digital Signature is specified when the keys are generated.

Hash

A hash function is a function that takes alphanumeric input and outputs characters with predetermined length (“Bitcoin — CFB Scientific Translations And Consulting”, 2016; Katz & Lindell, 2014, p. 121). To be more precise, it is a function “… that compresses, meaning the output is shorter than the input. Often, such a function takes an input of arbitrary or almost arbitrary length to one whose length is a fixed number, like 160 bits.” (Bellare & Rogaway, 2005, p. 139). That means that all the keys will look alike in length. However, they are totally different. These hashes are the ones we can see on Blockchain.org. All of these are around 40 digits long, however, neither of them are the same.

When using a hash, one can experience what in computer science in called hash-collision. That means that two types of data are given the same hash-value, and this is, of course, a non-desirable situation to find oneself in. Therefore, when working with hash, we work with what is called collision-resistance: How can we prevent this collision from happening. Thereby, with the usage of hash, there are typically different levels of security considered, where one of these is collision resistance. (Katz & Lindell, 2014, p. 124). Due to security issues, the hash-function has been developed over the past years, and the technology of Bitcoin is using SHA-2 (256 bits), which is an upgrade from it predecessor SHA-1. The upgrade adds more characters, which then makes more combinations possible.

Timestamp Server

Nakamoto explains a timestamp server as a server that “… works by taking a hash of a block of items to be timestamped and widely publishing the hash, such as in a newspaper or Usenet post [2–5].“ (Nakamoto, 2008, p. 2). To understand it better let us look at an example: when we use our NetBank, we trust in a central entity to make sure that the money we spend can only be spent once. That is done by the bank, which checks the accounts of the sender and receiver to see if there is enough on the correct account to make the transaction. Since in the blockchain we have ruled out the centralized entity, we need another way to account for the double-spending problem: A TimeStamp Server.

A timestamp server is: “… the process of securely keeping track of the creation and modification time of a document. Security here means that no one — not even the owner of the document — should be able to change it once it has been recorded provided that the timestamp’s integrity is never compromised.”(Trusted Timestamping”, Wikipedia, 2016). That means that every time we make a transaction, a timestamp is created. That facilitates that we can make sure that every part of the transaction is approved accordingly to a given moment. That means that even though a block only happens when there is enough transaction to create a block, one will still get the benefit of making the transaction at a specific moment, and not when the transaction goes through.

Miners

The last part of the Blockchain is also an important one. The name is taken as an analogy of Gold Miners (Nakamoto, 2008, p. 4), which is due to the fact that when Bitcoin was created, the resources were limited, and these resources had to be ‘mined’ to be put into use. Miners work “to create a block, a node … (…) to solve a computationally intense proof-of-work problem (the proof-of-work computation essentially consists of guessing inputs to a cryptographic hash function which succeeds only probabilistically (…)” (Lewenberg et al., 2015, p. 2). That means that the miners either work alone or in pools to compute a complex mathematical equation. This is, as explained above, a part of the verification process to secure the transaction in the block. Miners have to be seen in the context of a process, and they do work for the network, hence the reason the one(s) who solves the mathematical equation is awarded a prize. That is, in Bitcoin Universe, done by awarding them an amount of Bitcoin for their work.

There are two ways of mining: Proof-of-work and Proof-of-Stake. These are both explained below.

Proof-of-work

Proof-of-Work is not a new thing and is dated back to 1993 by Dwork & Naor (1993). Proof-of-work was first introduced as a way of fighting spam in Emails (Liu & Camp, 2006, p. 3). Proof-of-work works a bit differently in the Blockchain because it is done with the use of Merkle-tree. That was introduced as “… a new proof-of-work solution-verification scheme based on Merkle trees with an almost constant effort and null variance for the client.” (Coelho, 2008, p. 1).

The requester returns such a partial tree to show that selected leaves belong to the tree and were indeed computed. However, what particular leaves are needed must not be known in advance, otherwise, it would be easy to generate a partial tree just with those leaves. Returned leaves are selected based on the root hash, so as to depend on the tree computation. With this method, we can make sure that the packages of data are not altered, and find blocks of data that are fake or malicious.

Hash trees can be used to verify any data stored, handled and transferred in and between computers. Currently, the main use of hash trees is to make sure that data blocks received from other peers in a peer-to-peer network are received undamaged and unaltered and even to check that the other peers do not lie and send fake blocks. (Merkle, 1998). The server does the verification and checks the tree by recomputing the hashes and leaf numbers. These have to add up to the root hash (Coelho, 2008, p. 1).

To put this in the context of blockchain: “you earn coin and transaction fee rewards according to the number of blocks you mine” (Coin Pursuit, 2016).

Proof-Of-Stake

Proof-of-Stake (PoS) is similar to the way that companies give away stocks to high profile employees as part of their salary. That is done with the thought that if they have a significant stake in the company, hopefully, that will make them perform better.

While PoW works with the idea that people who own 5 percent will mine 5 percent, the Proof-of-Stake works a bit differently. A “proof-of-stake (POS) systems vary in that a person can “mine” depending on how many coins they hold.” So instead of dividing the work through ownership, PoS divides that work accordingly to the stake people have in the currency. The more stake one has in the currency, the more one can earn. One of the reasons for alternative cryptocurrencies to use PoS instead of PoW is that a 51% attack is less likely to happen (Graydon, C. & Graydon, C., 2014; Slock.It Takes DAO to ‘IoT’, 12:20).

References

Articles

Barab, S., & Squire, K. (2004). Design-based research: Putting a stake in the ground. The journal of the learning sciences, 13(1), 1–14.

Beck, R., Weber, S., & Gregory, R. W. (2013). Theory-generating design science research. Information Systems Frontiers, 15(4), 637–651.

Coelho, F. (2008). An (almost) constant-effort solution-verification proof-of-work protocol based on merkle trees. In Progress in Cryptology–AFRICACRYPT 2008 (pp. 80–93). Springer Berlin Heidelberg.

Czepluch, J. S., Lollike, N. Z., & Malone, S. O. (2015). The Use of Block Chain Technology in Different Application Domains. Retrieved 16 April 2016, from http://www.lollike.org/bachelor.pdf

Dwork, Cynthia; Naor, Moni (1993). “Pricing via Processing, Or, Combatting Junk Mail, Advances in Cryptology”. CRYPTO’92: Lecture Notes in Computer Science №740 (Springer): 139–147.

Eisenhardt, K. M. (1989). Building theories from case study research. Academy of management review, 14(4), 532–550.

Hype springs eternal. (2016). The Economist. Retrieved 16 April 2016, from http://www.economist.com/news/finance-and-economics/21695068-distributed-ledgers-are-future-their-advent-will-be-slow-hype-springs

IBM ADEPT Practictioner Perspective — Pre Publication Draft — 7 Jan 2015. (2016). Scribd. Retrieved 17 March 2016, from http://www.scribd.com/doc/252917347/IBM-ADEPT-Practictioner-Perspective-Pre-Publication-Draft-7-Jan-2015

Kepser, S. (2004). A Simple Proof for the Turing-Completeness of XSLT and XQuery. In Extreme Markup Languages®.

Kosba, A., Miller, A., Shi, E., Wen, Z., & Papamanthou, C. (2015). Hawk: The blockchain model of cryptography and privacy-preserving smart contracts. Cryptology ePrint Archive, Report 2015/675, 2015. http://eprint. iacr. org.

Kramer, A. D., Fussell, S. R., & Setlock, L. D. (2004). Text analysis as a tool for analyzing conversation in online support groups. In CHI’04 Extended Abstracts on Human Factors in Computing Systems (pp. 1485–1488). ACM.

Lewenberg, Y., Sompolinsky, Y., & Zohar, A. (2015). Inclusive block chain protocols. In Financial Cryptography and Data Security (pp. 528–547). Springer Berlin Heidelberg

Liu, D., & Camp, L. J. (2006). Proof of Work can Work. In WEIS.

Nakamoto, S. (2008). Bitcoin: A peer-to-peer electronic cash system. Retrieved April 26 2016, from https://bitcoin.org/bitcoin.pdf

Piercy, K. (2015). Analysis of semi-structured interview data. Retrieved April 26 2016, from http://konference.fdvinfo.net/rc33/2004/Data/PDF/stream_03-15.pdf

Ron, D., & Shamir, A. (2013). Quantitative analysis of the full bitcoin transaction graph. In Financial Cryptography and Data Security (pp. 6–24). Springer Berlin Heidelberg.

SORRELL, W. H., GENERAL, A., & General, V. O. A. (2016). BLOCKCHAIN TECHNOLOGY: OPPORTUNITIES AND RISKS.

The trust machine. (2015). The Economist. Retrieved 16 April 2016, from http://www.economist.com/news/leaders/21677198-technology-behind-bitcoin-could-transform-how-economy-works-trust-machine

Wang, F., & Hannafin, M. J. (2005). Design-based research and technology-enhanced learning environments. Educational technology research and development, 53(4), 5–23.

Books

Bellare, M., & Rogaway, P. (2005). Introduction to modern cryptography. UCSD CSE, 207, 207.

Chuen, D. L. K. (2015). Handbook of digital currency: Bitcoin, innovation, financial instruments, and big data (D. L. K. Chuen). Academic Press.

Deacon, D., Pickering, M., Golding, P., & Murdock, G. (1999). Researching communication. London: Arnold.

Katz, J., & Lindell, Y. (2014). Introduction to modern cryptography. CRC Press.

McCracken, G. (1988). The long interview (Vol. 13). Sage.

Swan, M. (2015). Blockchain: Blueprint for a New Economy. “ O’Reilly Media, Inc.”.

Wattenhofer, R. (2016). The Science of the Blockchain (1 edition ed., Inverted Forest Publishing). CreateSpace Independent Publishing Platform.

Yin, R. K. (2013). Case study research: Design and methods. Sage publications.

Webpages

Bitcoin — CFB Scientific Translations And Consulting. Cfbtranslations.com. N.p., 2016. Web. 19 Mar. 2016.

Block Chain (Database). Wikipedia. N.p., 2016. Web. 17 Mar. 2016.

Buterin, V. (2014). Side Chains: The How, The Challenges and the Potential. Bitcoin Magazine. Retrieved 23 April 2016, from https://bitcoinmagazine.com/articles/side-chains-challenges-potential-1397614121

Cryptography. Wikipedia. N.p., 2016. Web. 19 Mar. 2016.

Ethereum Project. (2016). Ethereum.org. Retrieved 30 March 2016, from https://www.ethereum.org/

Graydon, C. & Graydon, C. (2014).Bitcoin’s Future: Proof-of-stake vs Proof-of-work. CCN: Financial Bitcoin & Cryptocurrency News. Retrieved 10 May 2016, from https://www.cryptocoinsnews.com/bitcoins-future-proof-of-stake-vs-proof-of-work/

Hash — Bitcoin Wiki. En.bitcoin.it. N.p., 2016. Web. 21 Mar. 2016.

IBMVoice: How To Provide Secure And Trustworthy Blockchain Networks In The Cloud. (2016). Forbes. Retrieved 3 May 2016, from http://www.forbes.com/sites/ibm/2016/04/29/how-to-provide-secure-and-trustworthy-blockchain-networks-in-the-cloud/#51f3faf7e82d

John Plansky, and Kimberly Richards. “A Strategist’S Guide To Blockchain”. strategy+business. N.p., 2016. Web. 17 Mar. 2016.

Ledger. Wikipedia. N.p., 2016. Web. 21 Mar. 2016.

Merkle, Ralph C. “A Digital Signature Based On A Conventional Encryption Function”. Advances in Cryptology — CRYPTO ’87 (1988): 369–378. Web. 21 Mar. 2016.

Proof-of-Work and Proof-of-Stake Mining | Coin Pursuit. (2016). Coinpursuit.com. Retrieved 9 May 2016, from https://www.coinpursuit.com/pages/proof-of-work-proof-of-stake-bitcoin-mining/

Public Key Infrastructure. Wikipedia. N.p., 2016. Web. 19 Mar. 2016.

Public Keys And Private Keys — Comodo. comodo.com. N.p., 2016. Web. 19 Mar. 2016.

Public-Key Cryptography For Non-Geeks. blog.vrypan.net. N.p., 2013. Web. 19 Mar. 2016.

Slock.It Takes DAO to ‘IoT’ — Decentralized Autonomous Organizations 101. (2016). YouTube. Retrieved 14 May 2016, from https://www.youtube.com/watch?v=3gEMvhyES1k

Smart contract. (2016). Wikipedia. Retrieved 15 May 2016, from https://en.wikipedia.org/wiki/Smart_contract

Trusted Timestamping. Wikipedia. N.p., 2016. Web. 21 Mar. 2016.

Turing complete. (2016). Wikipedia. Retrieved 29 March 2016, from https://simple.wikipedia.org/wiki/Turing_complete