• No results found

MODELLING THE EFFECTS OF CONSENSUS PROTOCOLS WITHIN A BLOCKCHAIN BASED IOT APPLICATION

N/A
N/A
Protected

Academic year: 2021

Share "MODELLING THE EFFECTS OF CONSENSUS PROTOCOLS WITHIN A BLOCKCHAIN BASED IOT APPLICATION"

Copied!
59
0
0

Bezig met laden.... (Bekijk nu de volledige tekst)

Hele tekst

(1)

MODELLING THE EFFECTS OF CONSENSUS

PROTOCOLS WITHIN A BLOCKCHAIN

BASED IOT APPLICATION

A thesis submitted for the partial fulfilment of the requirements of the degree

of Bachelor of Science

FNWI

By

NIELS VAN GORSEL June 2018

Supervisor DHR. DR. D. HEINHUIS

ABSTRACT

During this thesis a model visualizing the effects of different blockchain consensus protocols within a specific application is created. The model is created for blockchain based IoT applications. First, an extended explanation provides the reader with knowledge concerning blockchain and ongoing challenges of IoT, and how blockchain could solve these challenges. After providing the reader with knowledge concerning the technologies discussed, the design choices and variables of the model are elaborated. Lastly, the model is tested by applying it to a use case within the logistic industry.

(2)

Table of Contents

Chapter 1 - Introduction ... 4 1.1 Preface...4 1.2 Structure ...5 1.3 Academic relevance ...6 1.4 Business relevance ...6 1.5 Methodology ...7

Chapter 2 – Blockchain explained ... 7

2.1 Blockchain 1.0 ...8

2.1.1 History and challenges of digitizing cash ...8

2.1.2 Byzantine generals’ problem ...9

2.1.3 Bitcoin ... 10

2.1.4 Bitcoin double spend attack example ... 12

2.1.5 Summary... 13

2.2 Blockchain 2.0 ... 13

2.2.1 Smart property ... 14

2.2.2 Smart contracts ... 14

2.2.3 Summary... 15

Chapter 3 – The internet-of-things ... 16

3.1 Problems current IoT architecture ... 16

3.2 Identity management in IoT ... 17

3.2.1 Blockchain for safer OTA updates ... 18

3.2.2 Further benefits of using Blockchain within the IoT ... 19

3.3 Summary ... 19

Chapter 4 – Design choices for the model ... 20

4.1 The axes of the model ... 20

4.2 Quantifying the variables of the model ... 23

4.2.1 Security ... 23

4.2.2 Scalability ... 25

4.2.3 Decentralization ... 26

4.2.4 Energy efficiency ... 28

4.2.5 Confirmation time ... 29

4.3 Reducing the variables of the model to a 5-point scale ... 30

4.3.1 Security ... 30

4.3.2 Scalability ... 31

4.3.3 Decentralization ... 31

4.3.4 Energy efficiency ... 31

4.3.5 Confirmation time ... 32

4.4 The final model ... 32

Chapter 5 - Applying the model in the logistic industry ... 33

5.1 Blockchain use cases for the logistic industry... 33

5.2 Characteristics of a blockchain application designed for asset transfer ... 35

(3)

5.3.1 Proof of work (PoW) ... 36

5.3.2 Proof of Stake (PoS) ... 42

5.4 Obtaining values for the final model ... 49

Electricity efficiency... 49

Scalability ... 49

Decentralization ... 50

Confirmation time ... 50

Security ... 50

5.5 The final model ... 51

5.6 Conclusions ... 52

Chapter 6 Discussion and conclusion of the thesis ... 53

6.1 Discussion ... 53

6.2 Conclusion ... 54

(4)

Chapter 1 - Introduction

1.1 Preface

Blockchain and the internet-of-things (IoT) are both covered by the media as revolutionary technologies. IoT is still facing challenges which can be classified in security issues, privacy considerations, interoperability and standard issues, legal and rights issues and emerging economy and development issues (Rose, Eldridge, & Chapin, 2015). Most recently researchers started exploring the solutions blockchain may offer for these IoT challenges, see figure 1. Due to the cryptographic technology and the decentralized nature of a blockchain, it can mainly solve IoT challenges which are found in its security. The exact solutions blockchain may hold for the security of IoT are discussed in chapter 3 of this thesis.

Figure 1. Google scholar publications that contain the keywords: "blockchain” and "IoT”. Retrieved at 16-05-2018.

Companies that solve IoT challenges using blockchain technology are starting to emerge (“Hdac : Transaction Innovation - IoT Contract & M2M Transaction Platform based on Blockchain,” 2018; Popov, 2017; Waltonchain Team, 2018). These companies differ from each other in the design choices they make while designing a blockchain application for IoT purposes. One of the design choices is the consensus protocol that is used within the blockchain application. It does not matter if the concept of a consensus protocol is still unknown to the reader, this concept will be explained in chapter 2.1.3 of this thesis. The reason that companies apply different design choices, may be due to the fact that the companies are related to different use cases within IoT. However, it is still unclear how different design choices within a blockchain application the final product or service created by the company.

0 500 1000 1500 2000 2500 3000 2012 2013 2014 2015 2016 2017 2018

(5)

During this thesis a model that visualizes the effects of different consensus protocols is created. The model focusses on the consensus protocol within the blockchain application since this is the factor that enables the nodes of a blockchain network to obtain consensus, which is one of the most important factors within a distributed network without a trusted third party. More about this will be explained in chapter 2. IoT markets differ a lot from each other. Therefore, the model is designed in such a way that the reader will have to define a specific use case he is analysing with the model. By analysing an IoT use case and filling in the model in such a way that best supports this specific IoT use case, the differences between consensus protocols within that IoT use case are visualized.

1.2 Structure

This thesis will provide the reader with a clear understanding of the effects various consensus protocols will have within a certain IoT use case. Therefore, the main research question is How can a model be created that visualizes the effects of different consensus protocols within a specific blockchain application, designed for a specific IoT use case?

To answer this main research question, first a variety of sub questions must be answered. These sub questions will guide the reader through the thesis and will help the reader to get a better understanding of the subjects being discussed. The thesis will consist of multiple chapters. In each chapter a sub question is discussed and answered.

1. What exactly is a blockchain and how does it work?

2. What are the ongoing security challenges of IoT, and what security issues may be resolved by implementing blockchain technology?

3. What is the best method to create a model that visualizes the effect of different consensus protocols within a specific blockchain application?

4. What is the best method to apply the model to the logistic industry.

By answering the first two sub questions, an understanding of both blockchain and IoT is created. By answering the third question, the required model is created. By answering the fourth question, the created model is tested by applying it to the logistic industry.

The chapters of this thesis are organized as follows. The last part of this introduction chapter will describe the academic and business relevance of this thesis. Chapter 2 describes and introduces the reader to the blockchain technology. If the reader is already familiar with blockchain technology, the reader is advised to skip this chapter. The blockchain explanation consists of two parts. The first part describes the underlying protocols that make the creation of a blockchain possible. The second part will explain the technologies that emerged from the

(6)

creation of a blockchain, such as smart property and smart contracts. Chapter 3 introduces the reader to the security challenges IoT is facing today and how blockchain technology could be utilized for solving these challenges. Due to the fact that a lot of theory is explained in chapter 2 and 3, both chapters end with a small summary. In chapter 4 the design approaches for the model are elaborated. Within this chapter the final model that visualizes the effects of different consensus protocols is created. In chapter 5 the model created in chapter 4 is tested by applying it to the logistic industry. Lastly, chapter 6 will consist of a discussion and conclusions of this thesis. During the discussion multiple suggestions for future research are made.

1.3 Academic relevance

Within the academic literature blockchain is increasing in popularity. The first books clearly explaining how the technology works are being published (Swan, 2015). However, since blockchain technologies and especially the effect blockchain could have on the IoT still remain rather vague to most people, this thesis will start off with an extended explanation of blockchain technologies and the effects it could have on the IoT.

Figure 1 made clear that research both including blockchain and IoT as subject is increasing in popularity. However, the research that has been done for the combination of IoT and blockchain is most often limited in its in-dept knowledge about the blockchain. Most publications describe an IoT use case and a variety of problems blockchain could solve within this use case (Dorri, Kanhere, Jurdak, & Gauravaram, 2017; Ferrer, 2016). These papers however make no in-dept distinction between different design choices one can make when creating a blockchain application. In chapter 2 of this thesis the reader will understand the importance of the consensus protocol within a blockchain. This thesis will provide the reader with a clear model that visualizes the effects of different consensus protocols within a specific blockchain application.

1.4 Business relevance

Gartner stated that IoT will increase in popularity. A prediction declared that in 2017 8.4 billion connected things will be in use worldwide. By 2020 this will reach a total of 26 billion devices (Rivera & Van der Muelen, 2013). The world economic forum executed a survey which was carried out among 250 market-leader respondents active in different industries. The survey showed that 72% of the market-leaders believed that the development of the Industrial Internet will be disruptive to their businesses and industries, and more (79% of respondents) think those disruptions will occur within the next five years (O’Halloran & Kvochko, 2015). The total

(7)

number of connected ‘things’ is growing exponentially, and most people are convinced of the disruptive behaviour this technology will have. It is crucial for large companies to keep up with the new evolving technologies. Although large scale operations are not being developed IoT is still facing major security and privacy issues. If blockchain technology indeed holds the answer to these challenges, a model that helps to visualize the effect different consensus could have within a certain application will be demanded. The final model can be used as a guideline for companies to help them choose a consensus protocol that best fits their use case while creating a blockchain based application.

1.5 Methodology

The model created in this thesis visualizes the effects of different consensus protocols. It is important for the reader to know that a blockchain is a complicated mechanism where the value of certain factors influence the value of other factors. The variables of the final model, visualizing the effects of consensus protocols, were chosen by analysing two things. First, the opinions of the most influential people within the blockchain industry. Second, the model is created for applications within the IoT industry. Therefore, characteristics that are most important for IoT devices are also applied to the final variables of the model.

The values of the variables presented in the model are obtained by analysing multiple factors within a blockchain that influence this variable. By applying a value to these factors, the value for the variable is obtained, this process is visualized in figure 8 on page 3 of the thesis. The values of the variables are transformed to a 5-point scale value by applying the ordinal values to it, as described in chapter 4.3. The ordinal values are determined by looking at the IoT use case that is being analysed and the values that are most common within blockchain application. Finally, the created model is tested in chapter 5, by applying it to the logistic industry.

Chapter 2 – Blockchain explained

The goal of this thesis is to model the effects of different consensus protocols within a certain IoT application. To model the effects of a consensus protocol it is first important the reader exactly knows what a consensus protocol is and how a blockchain works. Therefore, in this part of the thesis the following question will be answered. What exactly is a blockchain and how does it work? This explanation consists of two parts. In the first part blockchain 1.0 is explained. Blockchain 1.0 is the decentralization of money and payments. In the next part

(8)

blockchain 2.0 will be explained. “Blockchain 2.0 is for the decentralization of markets more generally, and contemplates the transfer of many other kinds of assets beyond currency using the blockchain.” (Swan, 2015).

2.1 Blockchain 1.0

Nowadays blockchain is seen as a revolutionary technology which truly enables people to directly interact with each other without relying on a third party. Although the blockchain can be used for a countless number of industries, the most obvious use case was to remove the middlemen from a currency. By doing so a digitalized peer-to-peer cash is created. This is the first and most obvious use case for blockchain and is often referred to as blockchain 1.0. To create such a peer-to-peer cash, various technologies are used which will all be elaborated during this chapter. These technologies include; the proof-of-work consensus protocol, private and public key signatures and a Merkle tree.

2.1.1 History and challenges of digitizing cash

In 2008 an autonomous person or group who called him or themselves Satoshi Nakamoto published a paper that introduced the world to the now well-known digital currency Bitcoin. (Nakamoto, 2008) Nakamoto proposed a system for electronic transactions where instead of relying on trust, cryptographic proof was used. By doing so no third party would be needed to confirm transactions.

Although Bitcoin is often referred to as the first paper describing decentralized digital currencies, the concept has been around for decades. The pioneer of decentralized digitized cash is Digicash, created by David Chaum (Chaum, 1983). The currency would be saved on the computer of the user. Digicash invented blind signatures, a cryptographic encryption technique. This technique is widely used in cryptocurrencies today. This technique was also named in the white paper of Nakamoto. “Each owner transfers the coin to the next by digitally signing a hash of the previous transaction and the public key of the next owner and adding these to the end of the coin. A payee can verify the signatures to verify the chain of ownership.” (Nakamoto, 2008). See figure 1. The use of a chain of signatures lacked one functionality. “The problem of course is the payee can’t verify that one of the owners did not double-spend the coin.” (Nakamoto, 2008). A decentralized digital currency can be described as a first-to-file

(9)

system. “If one entity has a certain amount and sends the same amount to A and to B, there is no intrinsic way of determining from two transactions which came earlier.” (Buterin, 2014). For decades this problem known as the double-spend problem delayed the development of a decentralized digital currency. The method to solve this problem is by creating a way in which all the participants of the network agree upon one single shared truth of the history in which order the transactions were received (Nakamoto, 2008). Before Bitcoin solved this problem consensus between two parties in a distributed network could only be made in two ways. The first method exists of each party having its own version of the truth and both parties have to reconcile. The other consists of implementing a trusted third party. This trusted third party would keep a ledger of all the transactions ever made on the network and confirming that each portion of digital cash was spent only once. Companies such as PayPal derived from the need of this trusted third party.

2.1.2 Byzantine generals’ problem

A typical way to illustrate how multiple nodes in a trustless distributed network such as Bitcoin can reach consensus is by referring to the Byzantine generals’ problem. This is a traditional way to illustrate how multiple parties can coordinate upon doing one action, while communicating over an unreliable link. During the Byzantine generals’ problem multiple generals have to choose to either attack a village or retreat. Some generals choose to attack while others choose to retreat, yet a consensus must be made. If all generals attack the village at the same time they will be able to conquer the village. The problem is complicated by the fact that some generals are traitorous who will not only choose to vote for the opposite strategy but can also choose to send different votes to different generals. An example would be that 5 generals try to reach consensus to either attack or retreat. If 2 generals choose to attack and 2 generals choose to retreat, there is a possibility that the 5th general is traitorous. If the 5th general

chooses to send a message to 2 generals he would like to attack, and he would send retreat to the 2 other generals. 2 generals received 3 out of 5 votes to attack the village, the other 2 generals received 3 out of 5 votes to retreat. This will result in the fact that the army will not attack with its full strength and the village will most likely defeat the army.

When referring to Bitcoin the network exists of users who would like to make transactions with each other. There is no central authority that checks the validity of transactions made on the network. A mechanism is required that enables the honest nodes within the network to come to an agreement concerning the transactions made on the network. The Proof-of-work (PoW) consensus protocol enables the nodes of the network to invest CPU power in the blockchain. This protocol will be explained in more detail in the next subsection

(10)

of this chapter. The honest nodes of the network always consider the longest chain with the most CPU power invested in it as the correct chain and will work on expanding this chain. Therefore, if the attacker would create his own branch, forming a sidechain he would need to obtain > 50% of the CPU power of the whole network to execute a successful double spend attack. By implementing this process Byzantine fault tolerance (BFT) is achieved as long as more than 50% of the networks CPU power is owned by loyal nodes. It is crucial for decentralized applications, which communicate over an unreliable link such as a cryptocurrency, to achieve Byzantine fault tolerance (BFT). If this is not the case the application is vulnerable to double-spend attacks.

2.1.3 Bitcoin

“Bitcoin, at its most fundamental level, is a core breakthrough in computer science, one that builds on 20 years of research into cryptographic currency, and 40 years of research in cryptography, by thousands of researchers around the world.” (Andreessen, 2014). Nakamoto managed to solve the double-spend problem. This was achieved by making changes to the electronic chain of signatures. This was achieved by implementing multiple technologies which will all be elaborated within this subchapter.

First, Bitcoin uses a timestamp server. A “digital timestamp” is a digital certificate intended to assure the existence of a generic digital document at a certain time (Massias, Avila, & Quisquater, 1999). The transactions made on the network are stored in a block. This block is broadcasted to all the nodes of the network. By doing so the nodes will always have an updated distributed ledger of all the transactions ever made. “The timestamp of the new block includes the timestamp of the previous block in its hash, forming a chain, with each additional timestamp reinforcing the ones before it.” (Nakamoto, 2008). This technology was later named “the blockchain.” The blockchain makes sure every node in the network has the same universally shared truth of all the transactions ever made on the internet.

Merkle tree & hashing

A hash is a one-way function that transforms a certain value into a so-called hash, this hash is unique for the input data. Since the hash function is one-way an attacker cannot guess the input data based on the hash. The only way to discover the input data of the hash is by entering random input data in the hash function and checking whether the function gives the same hash as output. The blocks are liked to each other by implementing the hash of the previous block into the hash of the current block.

(11)

The hash of a block is basically a collection of multiple hashes transformed into one hash. This process is visualized in figure 3. This technique is often referred to as a Merkle tree. Within Bitcoin a Merkle tree is used to first

parse all the transactions of one block together in one final hash. This hash is named the root hash. When the root hash is obtained the block hash of the previous block, the hash of the timestamp and the root hash are all parsed into one final hash, named the block hash. By using a Merkle tree that parses the hashes together the blockchain is made immutable. If the data on

a single leaf-hash is changed, the final block hash will not be similar to the original block hash. This is because a hashing function is a one-way and changing the input data even a small bit gives you a whole other hash as output.

Consensus protocol

Another invention that made the creation of Bitcoin possible is nowadays named a consensus protocol. The consensus protocol is basically a method that makes sure all the honest nodes in a decentralized network agree upon one universally shared truth. The consensus protocol decides what node is allowed to create the new block that will be added to the chain. The consensus protocol is required within the blockchain to achieve BFT. Nowadays a variety of consensus protocols exists. However, the first one created by Satoshi Nakamoto is called Proof-of-Work (PoW).

The idea behind PoW was originally created to prevent spam mail (Dwork & Naor, 1992). “Their idea was to have the sender of an email perform a complex computation as evidence that they believe that an email is worth receiving. The sender then proves to the recipient that this processing work has been completed and the email will then be accepted.” (Laurie & Clayton, 2004). The calculation used in PoW is an absolute random manner of scanning for a value that when hashed, begins with a number of zero bits. To obtain a hash starting with the certain amount of zero bits the computer has to use its CPU power to keep on ‘guessing’ which input data corresponds to a hashed output starting with a certain amount of zero’s. Bitcoin implemented this mechanism by letting each node undertake the following steps.

- The Bitcoin network would send new transactions to every node of the network. - Each node of the network collects new transactions in a node.

(12)

- When a node has created a suggestion for a new block it has to guess the correct hash that starts with a certain amount of zero’s. If the node finds the correct hash it broadcasts the block to all the other nodes of the Bitcoin network.

- The other nodes accept the block if all the transactions in the block are valid and not already spend.

- “The 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 previous hash.” (Nakamoto, 2008). The process of guessing the correct hash and adding new block to the blockchain is named mining. No arbitrary changes can be made in the blockchain because of the hash of the previous block that is included to current block. Since the nodes of the network solve the hash with their CPU power, they basically vote for the next block using their CPU power. A traitorous node only has a 100% chance of double-spending his transaction if he possesses >50% of the total CPU power of the whole network (Rosenfeld, 2012a). The nodes of the network always consider the longest chain to be the correct one and will keep working on extending it.

2.1.4 Bitcoin double spend attack example

To get a better understanding of blockchains the process of executing a double spend attack is explained. As explained earlier, the blockchain is immutable. Therefore, the attacker cannot change data which is stored in the blockchain. It is however possible for an attacker to double spend his currency. The honest nodes always work on expanding the longest chain. A malicious node could decide to buy a product, the transaction for buying this product is stored in block 39, visualized in figure 4. The attacker creates a branch of the blockchain, starting before the moment he created the transaction to buy a certain product, which is block 38.

The standard practice for a merchant is to wait for n confirmations (mostly 6) of the paying transaction, and then provide the product.” (Rosenfeld, 2012a) A confirmation is a new block being added to the blockchain. A merchant will only provide the buyer with his product if the transaction is made 6 blocks ago. Therefore, the attacker will need to wait until the longest chain is 6 blocks ahead of his branch. After this the attacker is provided with his product. Since the attacker is now provided with his product he can expand his branch while not including his transaction he created to buy the product. Once the attack his branch surpasses the longest chain the honest nodes will recognize his branch as the longest chain and will start working on expanding the attacker his branch. The attacker is provided with the product, although the transaction used to buy the product was never added to his branch. Therefore, the attacker is now able to double-spend the amount used to buy the original product.

(13)

Figure 4. Visualizing a double spend attack.

This may seem as a design fault but to surpass the longest chain while creating a branch that is 6 blocks behind, you would need to have the majority >50% of the total CPU power of the whole network. “Since the node that adds a new block to the network gets rewarded with new coins that are being taken in circulation he would have to choose between using it to defraud people by stealing back his payment or using it to generate new coins. He ought to find it more profitable to play by the rules that favour him with more new coins than everyone else combined, than to undermine the system and his validity of his own wealth.” (Nakamoto, 2008)

2.1.5 Summary

By creating a digitalized cash named Bitcoin a new type of currencies was born. Bitcoin removes the need for a middle man when transferring money from one to another. Although all transactions in the blockchain are visible, the public addresses are not directly linked to any personal information, making it anonymous. The disadvantages of Bitcoin are that it is not very scalable and rather slow, The maximum throughput of the whole Bitcoin network is currently set on 3.3 – 7 transactions/sec. (Croman et al, 2016)

2.2 Blockchain 2.0

Since the very beginning of Bitcoin people recognized that the blockchain could be utilized for more than just decentralizing money. Blockchain enables people to create peer-to-peer application and facilitates people in sharing certain goods peer-to-peer without the need for a middleman. “Blockchain 1.0 can be seen as the underlying TCP/IP transport layer of the web, with the opportunity now available to build 2.0 protocols on top of it (as HTTP, SMTP and FTP were in the internet model).” (Swan, 2015) The 2.0 protocols build on top of the blockchain either use the Bitcoin blockchain or created their own blockchain. The most influential technique build on top of a blockchain is named smart contracts. This concept will be explained by first introducing the reader to the attempts made to record more than just digitalized cash on a blockchain.

(14)

2.2.1 Smart property

The first blockchain 2.0 applications were extensions build on top of the Bitcoin blockchain. People started to create ways to record property on the blockchain. A property can differ from a physical house to an asset of a company. The idea was that “any asset registered in the blockchain, and thus its ownership can be controlled by whoever has the private key. The owner can then sell the asset by transferring the private key to another party.” (Swan, 2015).

Coloured coin was created to record more than just currency on a blockchain. Coloured coins use the infrastructure of Bitcoin to link a specific asset to certain bitcoins. The asset is valued due to the value of the bitcoins it is linked to. Due to this process properties such as cars can be linked to Bitcoins and can be traded on the blockchain, creating smart property. “Such coloured bitcoins can be used for alternative currencies, commodity certificates, smart property, and other financial instruments such as stocks and bonds.”(Rosenfeld, 2012b).

2.2.2 Smart contracts

The need for smart contracts emerged from smart property. “In the blockchain context, contracts or smart contracts mean blockchain transactions that go beyond simple buy/sell currency transactions, and may have more extensive instructions embedded into them.” (Swan, 2015) A contract is basically nothing more than a written document that defines the rules for a certain interaction between two people. In the document the rules one person must adhere to are defined. If the rules are met, the final transaction is made, and the contract is completed. Before smart contracts there was no peer-to-peer method to confirm a specific transaction only if certain conditions have been met. The person transferring the money had to either trust the other person that the conditions were met or needed to introduce a third party that would check whether the conditions were met. The goal of smart contracts was to introduce a piece of computer code that would check whether the conditions were met. If the conditions were met, the smart contract would approve the transaction between the two users. By doing so the need for trust or a third party is removed for peer-to-peer contracts.

Earlier when someone wanted to create his own smart contract, this contract needed to be built on top of the Bitcoin blockchain or the person would have to create his own blockchain in order to track the ownership of the smart property. This process takes a lot of time. Therefore, a programming language that supports the creation of smart contract within blockchain was created. This programming language needed to be Turing complete and must prevent infinite loops from happening.

(15)

The process of undertaking all these steps took a lot of time, this is why platforms were created. People can use the smart contract language and the blockchain of this platform to create their own smart contract and record their smart property. The most popular smart contract platform today is Ethereum. “Ethereum does this by building what is essentially the ultimate abstract foundational layer: a blockchain with a build-in Turing-complete programming language, allowing anyone to write smart contracts and decentralized applications where they can create their own arbitrary rules for ownership, transaction formats and state transition functions” (Buterin, 2014). “The smart contracts are stored on the blockchain itself with their own unique address. A smart contract can be triggered by addressing a transaction to it. It then executes independently and automatically in a pre-described manner on every node in the network.” (Christidis & Devetsikiotis, 2016).

Decentralized autonomous organizations

Due to the smart contract it is possible to execute certain tasks only if a user completes predefined tasks. Due to this process a decentralized autonomous organization (DAO) can be created. A DAO is an organization with a certain number of shareholders. The DAO is defined by the smart contract code. If a set number of shareholders agree upon a change in the smart contract code, this change will be implemented. The DAO consists of only shareholders but no people actually owning the company. The company is not controlled by people but by computer code defined in a smart contract instead. DAO companies can vary from prediction markets to cloud computing companies such as Golem.

Golem enables people create a distributed supercomputer. A user can choose to donate a certain amount of CPU/CPU power to the network. If calculations on the network are made, the users who donated CPU/GPU power to the network are awarded with the currency golem (GNT). The golem currency (GNT) has an economic value which can be exchanged for other currencies. (Zawistowski, 2016).

2.2.3 Summary

By building a smart contract layer on top of the bitcoin layer it is now possible to transfer smart property peer-to-peer only when certain conditions have been met. Decentralized applications that run on every computer simultaneously without relying on a centralized server are made possible.

(16)

Chapter 3 – The internet-of-things

The goal of this thesis is to model the effects of different consensus protocols within a blockchain-based-Internet-of-things (IoT) application. To understand why this model would be useful it is important to know the security challenges IoT is facing today, and how blockchain technology could contribute to the solution of these challenges. Therefore, the following question will be answered in this part of the thesis. What are the ongoing security challenges of IOT, and what security issues may be resolved by implementing blockchain technology?

The IoT is broadly covered by the media as a revolutionary technology. Recent years, researchers and organizations created many definitions for IoT. The definition used in this thesis was defined during the future internet symposium. IoT is defined as “A world where physical objects are seamlessly integrated into the information network, and where the physical objects can become active participants in business processes. Services are available to interact with these ‘smart objects‘ over the Internet, query their state and any information associated with them, taking into account security and privacy issues.” (Haller, Karnouskos, & Schroth, 2009).

The definition of IoT clearly differentiates two aspects of the technology. - Services that provide interaction between these physical objects. - The physical objects itself consisting of sensors and such.

Blockchain is a technology that enables communication in a trustless distributed network. Therefore, only the security issues that have something to do with the interaction between the physical IoT objects will be elaborated during this thesis.

3.1 Problems current IoT architecture

The amount of physical IoT devices are expected to grow exponentially, but the architecture is outdated. “Current Internet has a five-layered architecture, running with TCP/IP-protocols, which has worked well for a long time. However, in the Internet of Things billions of objects are connected which will create much larger traffic and

need much more data storages.” (Lu Tan & Neng Wang, 2010). The internet was designed in 1970 on the basis of the TCP/IP protocol. The TCP/IP protocol works in a centralized way known as a server/client architecture. This protocol is visualized in figure 5. A user sends a request to

Figure 5. Clients communicating with a server via the internet.

(17)

a server, the server executes the task and provides the user with the needed information. This server-client architecture has several drawbacks concerning the upcoming IoT technology. First of all, the server within the internet’s architecture forms a bottleneck, all the information requested by the users has to be provided by the server. This server also creates a single point of failure. If the server goes offline then information hosted by the server is no longer accessible.

A prime example of how a server-client model creates a single point of failure, is the massive distributed denial of service (DDoS) attack that occurred in 2016. During a DDoS attack the single point of failure within a client/server model is misused. Thousands of nodes simultaneously send requests to a certain server with the purpose to overload the server. By doing so the server will become unreachable and the content provided by the host will no longer be accessible. In October 2016 the US-based DNS provider faced major distributed denial of service (DDoS) attacks. Because of these attacks major internet services including Spotify, Twitter, PayPal, Reddit, SoundCloud and various others were difficult to impossible to reach. Dyn stated that they were hit by tens of millions of IP addresses. Some of these IP addresses belonged to printers, DVRs and other everyday objects connected to the internet, collectively known as the “Internet of Things” (“3rd Cyberattack ‘Has Been Resolved’ After Hours of Major Outages,” 2016).

With the explosive growth of IoT devices, this internet’s architecture is no longer applicable for data transfer between IoT devices. The centralized servers create bottlenecks and are vulnerable due to the single points of failure. Therefore, a decentralized solution is required.

3.2 Identity management in IoT

An implementation that is necessary to keep IoT devices secure is identity management. “While there exist a somewhat imperfect systems for establishing personal identity in the real world, in the form of identity document, driver’s licenses and even passports, there is no equivalent system for securing either online authentication of our personal identities or the identity of digital entities.” (Jacobovitz, 2016).

Identity management is required for a variety of reasons. By creating an identity for devices and manufacturers, the device can assure a certain command or task originates from a person who is allowed to send such a message. For IoT devices it is especially important that automatic over-the-air (OTA) updates originate from the manufacturer.

In order to keep devices up to date concerning their security and usability, updates are required. OTA updates enable manufactures to update a device that is already located at a client

(18)

without the need to physically be in range of that device. “Prior to OTA updates, you had to go out and retrieve the device, take it apart, connect it to your computer, reprogram it, put the device back together, and then take the device back. “ (Lee, 2017). Although OTA updates can cut a lot of costs by removing the need of physically updating the device, it also introduces new security vulnerabilities. The device must be sure the received update originates from the manufacturer. If this is not the case, the device might update itself with malware.

3.2.1 Blockchain for safer OTA updates

To achieve secure OTA updates a device must ensure the firmware update originates from the manufacturer. The public and private key addresses within a blockchain architecture can be utilized to create an identity.

All the IoT devices of a manufacturer would have to operate on one blockchain, each device with its own public and private key. Within the blockchain there is one address owned by the manufacturer. This address is used as a smart contract address. If the devices query the smart contracts’ address the devices will discover whether a new firmware update is available. If an update is available, the smart contracts’ address will send a hash to the devices which is a link to the new downloadable firmware. To assure the firmware update is valid and not infected the interplanetary file system (IPFS) is used (Christidis & Devetsikiotis, 2016). IPFS is a new way to share files from one device to another. The current internet uses the HTTP protocol. The problem with the current system, is the single point of failure. If the server goes offline the file becomes unreachable. The IoT device will have to make a request to the server for a new firmware update. The distance from the device to the actual server may result in latency.

IPFS works as a decentralized peer-to-peer file sharing platform. It is comparable to the peer-to-peer file sharing system named Bittorrent (Cohen, 2009). IPFS utilizes the Bitcoin blockchain protocol to create a hash for each downloadable file. If a device would like to download the file, it firsts checks whether the current hash matches the original hash when the file was originally uploaded. If this is not the case, changes have been made and therefore the device can detect that the file is corrupt. The IPFS files are voluntarily stored on the devices of other users. If user x requests a download for a specific file, it is possible user y stored this file on his device. User y can provide user x with the requested file, without relying on a server and therefore removing the risk for a single point of failure (Benet, 2014). If a device that stored a file goes offline and a user would like to download this file. The user can always request the device from another device that also stored this file. When making a request for a certain file

(19)

IPFS always checks the nearest nodes first, this reduces the possibility of latency caused by geographical distance.

3.2.2 Further benefits of using Blockchain within the IoT

Reduce DDoS attacks: Identity management can be utilized to prevent the further growing of botnets. A large proportion of botnets consists of IoT devices. “A blockchain can be used to store the cryptographic hash of individual device firmware, creating a permanent record of device configuration and state. This record can then be used to verify that a given device is genuine and that its software haven’t been tampered with before allowing it to connect to other devices or services.” (Kumar, 2017). If an IoT device is infected with a virus the input of the hash will be changed and the hash will no longer match the hash stored in the blockchain. Therefore, the device will no longer be able to connect to other devices or services.

Feeless billing layer: Within a blockchain all the data stored on it is distributed and immutable. Trust between users is created by the consensus protocol within the blockchain. As explained in chapter one of this thesis, these characteristics ensure that the creation of a distributed billing layer is possible. Blockchain technology could however also realize the creation of a peer-to-peer feeless billing layer. With the rapidly developing IoT industry the importance of micropayments will increase. Micropayments often occur in machine-to-machine (M2M) transaction where a micropayment is made for a small amount of data obtained by a specific sensor. Currently the fee of the micropayment itself is often larger than the actual amount of value being transferred, this of course makes no sense at all. A blockchain platform focussed on M2M transactions is named IOTA.

If a user of IOTA would like to issue a new transaction, users must first work to approve other transactions. Therefore, there are not two distinct types of participants as is the case with Bitcoin. The two types exist of those who issue transactions, and those who approve transactions. By obligating a node to first approve transactions before it is able to send a transaction the incentive for miners is removed and a network without the existence of transaction fees is created (Popov, 2017).

3.3 Summary

Due to the dependency of servers within the current internets client-server architecture, the internet is vulnerable to a single point of failure. The server also creates a bottleneck. Blockchain in combination with IPFS could create a distributed data communication

(20)

architecture for IoT devices, removing the single point of failure and reducing potential latency of the network.

By utilizing the private and public keys of the Blockchain architecture and creating a hash that refers to the current state of an IoT device, identity management can be achieved. Identity management creates the possibility to execute safe OTA updates and prevents the expansion of botnets under IoT devices. All nodes present within the blockchain architecture agree upon the same immutable dataset. Therefore, a peer-to-peer billing layer can be added to the blockchain application to provide M2M transactions.

Chapter 4 – Design choices for the model

The main goal of this thesis is to create a model that can visualize the effects of different consensus protocols within a specific IoT use case. There are no models that predict certain characteristics of an application based on the consensus protocols used. Therefore, the model must be created from scratch. The axes that measure the effects of a certain consensus protocol consist of the most important characteristics of a blockchain. These characteristics are based on the opinion of the most influential people within the industry. By combining these characteristics with the characteristics that are most valuable for an IoT application, the axes for the final model are selected. By doing so the following question will be answered in this chapter: what is the best way to create a model that measures the influence of a consensus protocol within a blockchain based IoT application?

This chapter shows a comprehensive explanation of how the data represented on the axes should be measured as well. General characteristics such as security and scalability will be reduced to a measurable characteristic.

4.1 The axes of the model

The created model has to measure the most important characteristics that are present within a blockchain. A widely discussed topic is the ongoing trilemma within a blockchain. The trilemma is described by multiple people, it states that within a blockchain only two of the three attributes can be optimized.

(21)

- Decentralization, defined as the system being able to run in a scenario where each participant only has access to a limited amount of resources in terms of computer power, i.e. a regular laptop or small VPS.

- Security, defined as being secure against attackers with up to the total computational power of the network.

- Scalability, defined as when the efficiency of the transactions is bigger than the computational power of each node.

Trent McConaghy (McConaghy, 2016).

- Decentralized where no single entity controls the network. - Consistent, where the network aims to keep data in sync.

- Scale. The Big “S” is a planetary scale. This means that there have to be sufficient performance characteristics to serve planet-scale or enterprise-scale needs, as typically seen in “big data” distributed databases.

The two trilemmas are very similar. In the context of a blockchain, being consistent is basically the same as being secure. As long as the blockchain is consistent, no double spend attacks can be executed and therefore the blockchain is secure. For this thesis the definition provided by McConaghy was chosen with a small adjustment. Being consistent is too vague and therefore it was replaced with the security definition provided by Buterin.

Figure 6. Trilemma triangle of blockchains, as used within this thesis. Blockchains can only be two of three things: scalable, decentralized or secure.

The trilemma between decentralization, scalability and security exists because if more nodes are allowed to suggest new blocks being added to the blockchain, the higher the degree of decentralization within the application. However, all nodes within the network have to check

(22)

the transactions added in the new block to the blockchain. This process reduces the speed of the application and therefore the scalability. Limiting the number of nodes that are allowed to approve transactions can increase the scalability of the network, but it limits the degree of decentralization. Reducing the percentage of nodes that have to check the transactions added in the new block increases scalability but reduces security.

Scalability, decentralization and security are the three factors that are most often used to measure the characteristics of a certain blockchain application. Therefore, these attributes were chosen to form the first three axes of the model.

The model is based on blockchain applications which are active within the IoT industry. Therefore, it is important to apply attributes to the model that measure characteristics which are important for the IoT industry. Most often low resource consumption is seen as one of the most important factors to make IoT devices a reality. “the things composing the IoT will be characterized by low resources in terms of both computation and energy capacity.” (Yang, Liu, & Liang, 2010). Low computational resources are necessary since difficult computations will drain the battery of an IoT device. Energy efficiency can be seen as the main factor merging both computation and energy capacities. Therefore, energy efficiency was chosen as the fourth characteristic to measure the effects of consensus protocols. If a blockchain is designed in such a way that it is very energy-inefficient, it will not be beneficial for most IoT devices to use this blockchain application. This is why energy efficiency will form the fourth variable of the model.

Confirmation-time is the time that it takes until your transaction made on the blockchain is confirmed. If a transaction is confirmed. The transaction will be approved, and the buyer will be provided with the product. Although the necessity for a fast confirmation time differs per IoT market the consensus protocol can have a big influence in it. Therefore, confirmation time was chosen as the fifth axis of the model.

The final model used to measure the effects of a consensus protocol is visualized in figure 7.

(23)

Figure 7. Model used to measure the effects of a consensus protocol

4.2 Quantifying the variables of the model

The five variables; security, decentralization, scalability, confirmation time and energy efficiency were chosen to visualize the effects of different consensus protocols. The values of these variables arise from the values of multiple factors that are present within a blockchain. The values of these factors eventually determine the values of the variables presented in the model. The values for the factors are determined by analysing the context of the IoT use case and deciding what value would best suit the IoT use case.

4.2.1 Security

There are large differences between consensus protocols. Therefore, the method to measure security for a consensus protocol depends on the type of the consensus protocol that is being analysed.

Security for PoW consensus protocols

Proof of Work (PoW) consensus protocols work by solving cryptographic puzzles named hashes. One of the most common method to test the security of a PoW consensus protocol is by analysing the costs for successfully executing a double spend attack. Read chapter 2.4 for more information on double spend attacks. There are multiple factors that determine the costs of executing a double spend attack.

Total hash rate of the network: The measurement used for computers to measure how fast it can solve a hash is named hash rate. The attacker would need to obtain > 50% of the total hash rate of the network to be guaranteed of a successful double spend attack. If the total

(24)

hash rate of the network is higher, the double spend attack will be more expensive since the attacker would need to obtain more hashing power.

Confirmation time: If a blockchain applies 6 confirmations, a certain transaction is only approved by the other party once it has been made 6 blocks ago. To successfully execute a double spend attack, the branch of the attacker would have to surpass the length of the longest chain. An attacker can only start expanding his branch once his transaction is accepted by the other party. The block time is the time it takes until a new block is appended to the blockchain. If the confirmations are multiplied by the block time, the confirmation time is obtained. The confirmation time is the time it takes until the other party accepts the product transferred on the blockchain.

When the total hash rate of the network is known, the costs of executing a 51% attack can be found by analysing the price for obtaining this hash rate. Nicehash is a marketplace where users can sell or buy computing power on demand. To perform a 51% attack, the attacker needs to have access to more than the actual hashing power of the network. If the hashing power of a network is 100, the attacker needs to obtain a hashing power of 101 to execute a 51% attack. This is because the hashing power of the attacker is added to the hashing power of the network, resulting in a total hashing power of 201.

If the attacker obtains a hashing power of 51%. The branch of the attacker will on average expand 2% faster than the longest chain owned by the honest nodes, which has 49% of the networks hashing power. The branch of the attacker will have to surpass the main chain starting with a backlog that is equal to the confirmation time. The average required time the attacker would need to have access to the majority of the networks hashing power can be calculated by applying the following formula:

𝐴𝑣𝑒𝑟𝑎𝑔𝑒 𝑟𝑒𝑞𝑢𝑖𝑟𝑒𝑑 𝑡𝑖𝑚𝑒 =𝑐𝑜𝑛𝑓𝑖𝑟𝑚𝑎𝑡𝑖𝑜𝑛 𝑡𝑖𝑚𝑒 ( 𝐻𝑃𝐴 − 𝐻𝑃𝑁𝐻𝑃𝐴 + 𝐻𝑃𝑁)

Where HPA stands for the hashing power of the attacker and HPN stands for the hashing power of the network.

The final costs for executing a successful double spend attack can be calculated by multiplying the average required time with the price that corresponds to the required hashing power on Nicehash.

Security for proof of stake

Proof of Stake (PoS) consensus protocols work by making sure a certain node has a certain stake within the network until it is allowed to mine. During this thesis the two most discussed

(25)

PoS consensus protocols, Delegated PoS and Casper TFG, were analysed. Within Delegated PoS the mining nodes are selected in a political manner. The community decides by voting what number of nodes are allowed to produce blocks and validate transactions within the blockchain. The weight of each vote is determined by the stake the user has in the network. This means that if a user has a stake of 5% in the network, his vote will count twice as heavy as the vote of a user with 2.5% stake in the network. The nodes who receive the most votes from the network are allowed to mine the blockchain. The security of the application can be measured by analysing the process of becoming a validator.

Within Casper TFG, just the nodes that own a certain amount of coins used within the network are allowed to mine the blockchain. The idea behind this process is that nodes that own a major part of the network will not attack the network. Attacking the network will most likely decrease the value of the network. The nodes that are allowed to mine the network will have the most negative effect from this value decrease, therefore they will not attack the network and security is provided. The security of the application can be measured by analysing the amount of money that is required to become a validator within the network.

4.2.2 Scalability

Scalability is measured by analyzing the maximum throughput of the application. As defined in chapter 4.1 the application is fully scalable when it has sufficient performance characteristics to serve planet-scale or enterprise-scale needs. Multiple factors influence the scalability of the application. Therefore, it is important to first apply a value to these factors. The values for the factors are determined by analysing what value best suits a specific factor within the IoT context.

Average internet connection speed within the IoT context. The maximum throughput of the blockchain application can only be determined once the average internet connection speed within the IoT context is known.

Average internet connection speed per node. Every node that is mining the blockchain will need to have its own downloaded copy of the blockchain. If the throughput of the blockchain is higher than the maximum download speed of the average node within the IoT context, the nodes will stay synchronized with the blockchain. Therefore, it is important to know the average internet speed of the nodes in order to determine the maximum throughput of the blockchain.

Average size of one transaction. The size of one transaction is affected by the amount of data that is stored within one transaction.

(26)

Block size. The block size determines the amount of data that can be stored within one block. If the block size is increased, the maximum throughput of the blockchain is increased. Increasing the block size however decreases the amount of decentralization since better hardware is required for running a mining node.

Block time. The block time is the time it takes until a new block is appended to the blockchain. Originally Bitcoin created a block time of ten minutes. The block time was set at ten minutes to reduce the potential computational power lost due to latency. When the latency within a distributed network such as bitcoin is one minute, all nodes will continue to work for one minute on solving the hash for the block although the solution was already found by another node. Therefore, when the block time is 10 minutes and the latency 1 minute this will result in a computational power loss of 10%. When the GHOST (Greedy Heaviest Observed Subtree) protocol was invented, the nodes could keep working on expanding the blockchain without worrying about investing computational power in a block that is already solved (Sompolinsky & Zohar, 2015). This is why nowadays the block time can be lowered to the actual maximum latency within a distributed network. The block time of Ethereum is therefore set at only 17 seconds.

4.2.3 Decentralization

When during research the decentralization within blockchain application is measured, this is mostly done by analysing applications that are already online and being used, such as Bitcoin and Ethereum. In one paper the decentralization of bitcoin was analysed by detecting clusters within the nodes of the blockchain network (Gencer, Basu, Eyal, van Renesse, & Sirer, 2018). Another paper measures decentralization by creating a Lorenz-curve for multiple factors within the blockchain application. After creating a Lorentz-curve for multiple variables, the Gini coefficient for all Lorentz-curves is calculated. By combining all Gini coefficients into one final variable, the number for decentralization is obtained (Srinivasan & Lee, 2017).

Both approaches are focused on blockchain applications which are already online and being used. However, this thesis analyses the effect of consensus protocols while still designing the application. It is impossible to quantify decentralization by observing how the application is actually being used. Therefore, within this thesis, decentralization will be measured by analysing 4 factors and applying a 5-point scale value to these factors.

Number of nodes which work on expanding the blockchain. The number of nodes heavily decides the degree of decentralization that is present within an application. A value is applied to this variable by looking at the total amount of numbers which are present in the

(27)

blockchain environment and by analysing what percentage of the total number of nodes are mining the blockchain. A 5-scale rating will be applied to this.

1. < 0.1% of nodes are mining the blockchain.

2. < 10 % and ≥ 0.1% of nodes are mining the blockchain. 3. < 50% and ≥ 10% of nodes are mining the blockchain. 4. < 90% and ≥ 50% of nodes are mining the blockchain. 5. ≥ 90% and of nodes are mining the blockchain.

Necessary hardware. Decentralization is heavily based on the hardware that is required in order to become a mining node. If very simple hardware is required to become a mining node within the blockchain application, decentralization is bound to grow. The average costs of the hardware are analysed. The average costs of the hardware a mining node uses are analysed for the following reason. If it is possible to mine the network with hardware that only costs $10 but all other mining nodes have hardware that is worth $1000, the cheap node will will not be able to mine the blockchain due to the increased difficulty for solving the hash.

1. Costs of average hardware used in a mining node > 2500$.

2. Costs of average hardware used in a mining node ≤ 2500$ and > 1000$. 3. Costs of average hardware used in a mining node ≤ 1000$ and > 500$. 4. Costs of average hardware used in a mining node ≤ 500$ and > 100$. 5. Costs of average hardware used in a mining node ≤ 100$.

Geographical distribution of nodes. Research has indicated that geographical distribution is an important factor to measure decentralization within a peer-to-peer network. Clusters are defined as nodes which have a bandwidth capacity of a maximum of 100 Mbps. Since this is the typical bandwidth of home and EC2 users (Gencer et al., 2018). It is important to analyse whether a lot of nodes are clustered within one specific area. A specific area is defined as an area of 10 km2, which is equal to 3.86 mi2.

1. ≥ 90% of the nodes which are expanding the blockchain are all present within ≤ 10 large clusters.

2. ≥ 90% of the nodes which are expanding the blockchain are all present within ≤ 100 and > 10 large clusters.

3. ≥ 90% of the nodes which are expanding the blockchain are all present within ≤750 and > 100 large clusters.

4. ≥ 90% of the nodes which are expanding the blockchain are all present within ≤ 5 000 and > 750 large clusters.

(28)

5. The nodes of which are expanding the blockchain are present in > 5 000 clusters. Allowance of contributing to the blockchain. The process of producing blocks and validate transactions on the blockchain is called mining. By doing so the node is making a contribution to the blockchain. By analysing the percentage of nodes that is maximally allowed to mine the blockchain, the value for this factor is obtained. Notice that this is different compared to the factor number of nodes expanding the blockchain. Within that factor the actual percentage of mining nodes is analysed.

1. < 0.01 % of the nodes are maximally allowed to mine the blockchain.

2. < 0.1% and ≥ 0.01% of the nodes are maximally allowed to mine the blockchain. 3. < 10% and ≥ 0.1% of the nodes are maximally allowed to mine the blockchain. 4. < 100% and ≥ 10% of the nodes are maximally allowed to mine the blockchain. 5. 100% of the nodes node within the network is allowed to mine the blockchain.

4.2.4 Energy efficiency

Energy efficiency is a variable that can be quantified by calculating the total power consumption of the network. While designing the application it is important to take into account that within PoW consensus protocols the mining node that adds the new block to the blockchain is rewarded: “The first transaction in a block is a special transaction that starts a new coin owned by the creator of the block.” (Nakamoto, 2008). Although this creates an incentive for nodes to support the network, the reward may also result in an arms race between nodes of the network. This arms race is about obtaining the highest amount of computational power in order to receive most rewards. This effect is seen in multiple blockchain application such as Bitcoin, Ethereum and many more. This results in an extreme high-power consumption of the network. The total power consumption of the network can be calculated by analysing the number of nodes within the network and multiplying this with the average amount of electricity one node consumes. Multiple factors influence the total electricity consumption of the network.

Hash rate (only PoW): When working with PoW consensus protocols it is important to decide how much hashing power a node needs to have. The hashing power measures the amount of hashes a node can execute within one second. If the total hashing power of the network is very high, it will be difficult to execute a double spend attack. However, a higher hashing power also means that the node will consume more electricity.

Number of nodes: To measure the total electricity consumption within the network it is crucial to know the number of nodes in the network. When the network consists of fewer nodes, decentralization goes down. However, fewer nodes within a network may enable the network

(29)

to increase the maximum throughput of the network which enables the network to obtain a higher scalability.

Average watt consumption of a mining node: It is important to decide what the watt consumption of the average mining node is within the network. Only the watt consumption of the mining nodes is analysed, since the watt consumption of the non-mining nodes will always be the same for all consensus protocols. Once the average watt consumption of a mining node is known, the electricity consumption can be calculated by multiplying this number with the total number of mining nodes within in the network.

4.2.5 Confirmation time

Confirmation time is the time it takes until a certain transaction placed on the network is accepted by the other party. Confirmation time is determined by the block time and the amount of confirmations the network persists.

The block time is the amount of time it takes for the network to assign a new block to the blockchain. “There is no guarantee of the amount of time it actually takes for the network to assign a new block. It is just a value the network aims to hit, and it does this by adjusting the so-called block difficulty. The block difficulty is regulated each time a new block is found. If a block is found “too quickly”, the difficulty of finding the next block goes up”

The amount of confirmations the network persist increases the security of the network against a double spend attack. As explained in part II of this thesis when an attacker would like to perform a double spend attack, the attacker would have to create a branch starting before the moment he made the transaction to the merchant. This branch would have to surpass the longest chain. As can be seen in table 1, the chances of successfully executing a double spend attack dramatically decrease when the network is checking for multiple confirmations.

The average confirmation time can be calculated by applying the following formula. 𝐴𝐶𝑇 = 𝑛 ∗ 𝐵𝑇

Where ACT stands for ‘average confirmation time’, BT stands for ‘block time’ and n is the amount of confirmations the network persists.

(30)

Table 1. The probability of a successful double spend, as a function of the attacker's hashrate q and the numer of confirmations n. (Rosenfeld, 2012a)

Two factors heavily decide the amount of confirmations that the network will persist. Total hash rate of the network (only PoW): The total hash rate of the network determines the difficulty for executing a double spend attack. If the total hash rate of the network is higher, executing a double spend attack is more expansive. The costs of executing a double spend attack can be increased by increasing the amount of confirmations the

network persists.

Selection of delegates (only PoS): Within a PoS consensus protocol it is not possible for a normal node to execute a double spend attack since only a number of selected nodes are allowed to make contributions to the blockchain. Since the nodes which contribute to the blockchain are trusted, the confirmation time can be lowered to only a few seconds.

4.3 Reducing the variables of the model to a 5-point scale

The last step of creating the model is to reduce the variables to a 5-point scale, so the radar chart visualized in figure 7 can be filled in. The radar chart will model the characteristics of different consensus protocols within a certain IoT application. It is important to model the differences of consensus protocols based on the context of the IoT application.

4.3.1 Security

In most consensus protocols security can be measured by analysing the costs required to perform a double spend attack. The costs for executing a double spend attack can be rescaled to a 5-point scale by comparing it to the average price of a product transferred within the specific IoT context. It is important to visualize when the costs of executing a double spend are only 1/10th of the cost of the product. However, it is not important to visualize when the costs

Referenties

GERELATEERDE DOCUMENTEN

• How is dealt with this issue (change in organizational process, change in information system, extra training, etc.).. • Could the issue have

Nagenoeg alleen voor onderzoek waarbij met grote groepen dieren gewerkt moet worden, komen praktijkbedrijven in aanmerking.. Gedragsonderzoek bij kippen onder praktijk

enkele woorden omschrijven: wij moeten voor Stevin het eenige monument oprichten, waardoor 'men iemand, die de resultaten van zijn werk in geschriften heeft neergelegd, werkelijk

Methods Between 2011 and 2013, 403 consecutive patients who underwent kidney transplantation were invited to complete the Caroline Comfort Scale (CCS) and Visual Analog Scale (VAS)

Scriptie bachelor Onderwijskunde: Slaapverwekkend schoolbeleid: Over de mogelijkheden van middelbare scholen bij slaperige leerlingen in de klas..

By proposing a reading of the role of Breach in The City &amp; The City as sustaining of the border that exists between the two cities in which this story takes place,

Answer categories are presented as drop-down-menus in which people can select a labelled value ranging from 1 to 7 (see coding below). The order of items within batteries

(b) to create a fair and realistic situation which should help the employee to achieve this improvement in performance.” If this performance improvement cannot be achieved and if