On Graph Based Cryptocurrency Systems
Total Page:16
File Type:pdf, Size:1020Kb
Erlend Lid Helland On Graph Based Cryptocurrency Systems Master’s thesis in Communication Technology Supervisor: Colin Alexander Boyd, Chris Carr June 2019 Master’s thesis Master’s NTNU Engineering Communication Technology Communication Department of Information Security and Department of Information Faculty of Information Technology and Electrical Technology of Information Faculty Norwegian University of Science and Technology of Science University Norwegian Erlend Lid Helland On Graph Based Cryptocurrency Systems Master’s thesis in Communication Technology Supervisor: Colin Alexander Boyd, Chris Carr June 2019 Norwegian University of Science and Technology Faculty of Information Technology and Electrical Engineering Department of Information Security and Communication Technology Title: On Graph Based Cryptocurrency Systems Student: Erlend Lid Helland Problem description: In recent years doubt has started to rise around Bitcoin’s capability to deliver on being a global digital currency for everyday use, due to its limitations. In the group of challengers to this position, a subgroup has formed of systems that swap out the blockchain as a distributed data ledger in favour of Directed Acyclic Graphs (DAGs). This results in cryptocurrencies that instead of storing their data in a blockchain, store it in a graph structure where the data is located in the vertices of the graph. The change directly affects different properties of the system such as throughput, consensus and latency. This thesis aims to explore how the change in data structure affects the properties of cryptocurrency systems, both through a literature study and experiments on different live systems. It will look at how different real world cryptocurrencies deal with the switch of data structure and the implication it has for the overall system. To help decide if this can solve the current challenges of blockchain based systems, a discussion of the advantages and disadvantages introduced will be conducted. The thesis will also consider how the findings compare to the promises and expectations raised by the proponents of this shift from blockchain to graphs. Responsible professor: Colin Alexander Boyd, IIK Supervisor: Chris Carr, IIK Abstract This thesis investigates and compares metrics of cryptocurrencies based on blockchains to those based on Directed Acyclic Graphs (DAG). Blockchain- based cryptocurrencies are facing multiple challenges in domains such as scalability, decentralization and resource utilization. This thesis investi- gates whether cryptocurrencies utilizing a DAG as their data structure can offer solutions to these issues. To answer this question, both a the- oretical study and experiments involving different cryptocurrencies are carried out. The theoretical study is aimed at gathering data on different systems for comparison of the different solutions and implementations. The experiments are aimed at the DAG-based systems since these are much younger and have minimal research looking into them. The result of the thesis shows that in terms of scalability, DAGs do offer better solutions in most regards. The thesis also points out multiple challenges faced by DAG based cryptocurrencies, such as a denial of service attack and the lack of incentives in the system. The most significant advantage to blockchain solutions is identified as being their proven security and longevity in this space. This thesis emphasizes the trade-offs made when moving from a blockchain to a DAG as the data structure in a cryptocurrency system. In summary, DAG systems offer better scalability but do not provide the same trust assumptions as the previous blockchain solutions. Sammendrag Denne oppgaven undersøker og sammenligner trekk ved kryptovaluta basert på blokkjeder med kryptovaluta basert på Rettede Asykliske Grafer (RAG). Blokkjedebasert kryptovaluta møter utfordringer på felt som skalering, desentralisering og ressursutnyttelse. Denne oppgaven undersøker om kryptovaluta som bruker en RAG som sin datastruktur kan løse noen av disse utfordringene. For å besvare dette spørsmålet ble både en teoretisk studie og forskjellige eksperimenter på ulike kryptovalutaer gjennomført. Den teoretiske studien ble gjennomført for å skaffe data på de forskjellige systemene til bruk i sammenligninger mellom dem. Eksperimentene fokuserte på RAG-systemene, siden disse er mye nyere og har mindre forskning enn systemene basert på en blokkjede. Resultatene i denne oppgaven viser at RAG systemer generelt sett har bedre løsninger for skalerbarhet. Oppgaven viser også til flere utfor- dringer disse RAG baserte systemene har, som for eksempel distribuert tjenestenektangrep og en mangel på insentiver i systemene. Oppgaven peker på demonstrert sikkerhet og lang levetid som de største fordelene blokkjedesystemene har over RAG-systemene. Oppgaven legger vekt på valgene som er gjort når man går fra blokkjede til RAG som datalager i en kryptovaluta. Det konkluderes med at RAG-systemer tilbyr bedre skalerbarhet men de har ikke samme tillit blant brukere som blokkjedesys- temene. Preface This thesis is submitted at the Department of Information Security and Communication Technology at Norwegian University of Science and Technology (NTNU). This work constitutes the masters thesis for the MSc program in Communication Technology with specialization in Information Security. The duration of the thesis was 20 weeks, performed in the Spring of 2019. I would like to thank my supervisor Chris Carr and responsible professor Colin Boyd for our meetings and their constructive feedback throughout the process of writing this thesis. Trondheim, 6th of June 2019. Erlend Lid Helland, Contents List of Figures x List of Tables xiv 1 Introduction 1 1.1 Motivation . 2 1.2 Objective . 3 1.3 Scope and Limitations . 4 1.4 Thesis Outline . 5 2 Background 7 2.1 Graph Theory . 7 2.2 Blockchain Basics . 8 2.3 Introduction to Bitcoin . 10 2.3.1 The Economics of Bitcoin . 10 2.3.2 The Technology of Bitcoin . 11 2.4 Challenges Faced by Blockchain . 13 2.4.1 Scalability . 13 2.4.2 Decentralization . 17 2.4.3 Resource Utilization . 19 3 Methodology 21 3.1 Trustworthiness and Reliability of Sources . 21 3.2 Nano Mainnet . 22 3.3 IOTA IRI Main network . 24 3.4 Experiments . 26 3.4.1 Scalability Metrics in DAG systems . 28 4 DAG based systems 33 4.1 Commercial Implementations . 33 4.1.1 Nano . 33 4.1.2 IOTA . 36 4.1.3 Byteball . 38 vii 4.2 Proposed Academic Implementations . 39 4.2.1 SPECTRE Protocol . 39 4.2.2 PHANTOM and GHOSTDAG Protocol . 42 4.3 Security in DAGs . 44 4.3.1 Denial of Service and Spam Attacks . 45 4.3.2 51% Attacks and Double Spending . 47 5 Experimental Results 51 5.1 Max Theoretical Throughput . 51 5.2 Average Measured Throughput . 52 5.3 Maximum Measured Throughput . 55 5.4 Minimum Theoretical Delay . 57 5.5 Median Measured Delay . 58 5.6 Time to Stability . 60 5.7 Node Storage . 61 5.8 Initial Download . 62 5.9 Scalability Summary . 64 6 Discussion 67 6.1 Max Theoretical Throughput . 67 6.2 Maximum Measured Throughput . 68 6.3 Minimum Theoretical and Measured Delay . 68 6.4 Time to Stability . 70 6.5 Challenges faced by DAG systems . 71 6.5.1 Lack of Incentives . 71 6.5.2 Lack of Experience . 72 6.5.3 New Attack Vectors . 73 7 Conclusion 75 7.1 Contribution . 76 7.2 Future work . 77 7.3 Summary . 77 References 79 List of Figures 2.1 Simple example of a Directed Acyclic Graph. It can be observed that there is no way of moving from right to left in this graph. Arrows on the edges indicated that they are directed, and can only be traversed in the indicated direction .................................... 8 2.2 An illustration of a general blockchain, where each block contains some data and a reference to its predecessor. This figure is a modified and generalized version from [17]. ........................ 9 2.3 Distribution of hash rate in Bitcoin from the four most recent days as of the 6th of February 2019. It is observed that the four largest mining pools control 53% of the total hash rate of the network. Data from Blockchain.com [50]. ............................. 19 3.1 Size of Nano ledger on disk of the node after it caught up on blocks from the main network. .............................. 23 3.2 Image from IOTA Node statistics after 72 hours of uptime. Graphs made with Grafana interface for nodes. ...................... 26 3.3 Image from IOTA Node statistics after downloading external database snapshot and restarting the node. Graphs made with Grafana interface for nodes. Image captured on the 8th of April. 26 3.4 Central node statistics after the node has caught up to the rest of the network. This shown by the LMI and LSMI counters being equal. Image captured in the 22nd of April. ........................ 27 4.1 Nano’s DAG, the Block-lattice. A,B and C are individual accounts, nodes are either Send(S) or Receive(R) transactions. Figure taken from [13]. 34 4.2 Percentiles of transactions that fall under different confirmation times. At February 22nd Nano released their latest update leading to a significant increase in transaction speed. Figure taken from [61]. 35 4.3 The IOTA tangle. Gray boxes are transactions awaiting confirmation. Figure taken from [19]. ............................ 37 x 4.4 The Byteball consensus algorithm. Protocol decides to keep the coloured transaction labeled ’5’ since it is referenced in the main-chain (represented in bold) before its conflicting transaction. Figure taken from [5]. 39 4.5 Vote counting in the blockDAG of SPECTRE. Nodes 1-12 vote on con- flicting blocks X and Y. Image is a modified version from [22] . 41 4.6 Ordering of a DAG with k=3 in Phantom. One possible ordering of this is: A, D, C, G, B, F, I, E, J, H, K. Figure taken from [23] . 43 5.1 TPS (green) and CTPS (blue) observed on the IOTA mainnet on the 9th of April 2019. Graphs from [60]. ...................... 53 5.2 The block count observed by our node, divided by type, on the 24th of March at 12:11.