Universitas Indonesia



THE EFFECT OF LATENCY ON SELFISH-MINER ATTACK ON BLOCK RECEIVE TIME BITCOIN NETWORK USING NS3 Bellia Dwi Cahya PutriRiri Fitri SariDepartemen of Electrical EngineeringDepartemen of Electrical EngineeringUniversity of Indonesia, DepokUniversity of Indonesia, DepokIndonesiaIndonesia bellia.dwi@ui.ac.idriri@ui.ac.id Abstract - Bitcoin holds the largest market share among all digital currencies. Transaction security is secured in Bitcoin by using blocks with a hash-based Proof of Work (PoW) mechanism. Bitcoin PoW takes an average of 10- minutes to complete and 6 consecutive blocks are recommended for a single transaction in the system. PoW is a functional protocol that validates every incoming data to overcome spam attacks and DDoS attacks (Distributed Denial of Service). Selfish miner is an attack on the integrity of the Bitcoin network. The selfish miner succeeds because the honest miners are forced to spend part of their computing cycle on blocks that are destined not to be in the public chain. To achieve higher scalability, network latency must be low, that is the time required for the protocol to confirm the transaction should be effectively reduced. In this study, the author will make a simulation of the effect of latency on block receive time on Bitcoin with selfish-miner attack using NS3. The experimental results show the use of the latency variation and the more number of generated blocks, the lower the MBRT value. The average MBRT of each parameter shows the required receive time by the block number of about 15 minutes to 16 minutes. This amount exceeds the PoW's tolerance time limit when making a transaction. This is due of selfish-miner attack and Latency.Keywords: Bitcoin, PoW, Selfish-miner, Latency, NS3.INTRODUCTIONThe use of internet has penetrated in many fields. One is the economic field. Trading on the Internet almost entirely relies on financial institutions as a trusted third party to process electronic payments. There is an additional cost when transactions made to the institution are unconsciously such costs are made commonplace by most people. What is required is an electronic payment system based on a non-trust cryptographic book that allows two parties willing to transact directly without the need for a third party [1]. The system then makes Bitcoin into one digital currency that does not require a third party in the transaction.Bitcoin holds the largest market share among all digital currencies. Transaction security is secured in Bitcoin by using blocks with a hash-based Proof of Work (PoW) mechanism. Bitcoin’s PoW takes an average of 10 minutes to complete and 6 consecutive blocks are recommended for a single transaction in the system. It Provided that the majority (> 50%) of the computing power in the network is honest [2].Despite the fame of Bitcoin transactions, security-related issues became an important point in the study. Several previous studies have challenged the security assumption of Bitcoin. Eyal et al., [3] shows that miners who control more than 33% of the total computing power of a network can gain substantial mining profits in the network. Heilman et al., Shows how to attack bitcoin mining protocols by monopolizing node connections within the system. Gervais et al., [2] experimented with tampering block delivery and transactions in bitcoins with DoS attacks. Their analysis results show resource-constrained Adversary may abuse the scalability measures that exist in Bitcoin clients to deny information about blocks and transactions generated for 20 minutes. Adversary can increase their mining profits on the network, double-spending and easily increase DoS attacks. Selfish miner is an attack on the integrity of the Bitcoin network. Where a miner or a mining pool, does not publish and distribute a valid solution across the network. The selfish miner continues to mine on the next block and maintain its lead. When the rest of the network will catch up with a selfish miner, it releases part of the broken block into the network. The result of their chain and PoW is longer and harder so that the rest of the network adopts their block solution and claims block reward [12].In an increasingly advanced trading technology, a millisecond difference can result in enormous losses. This is where the effect of latency on transactions in Bitcoin have a role. Latency is the time required to confirm a transaction. Professors in A New York University Business, Joel Hasbrouk and Gideon Saar distinguish three components of latency measurement; the time gap between the information sent, the algorithm in analyzing the information and the implementation in the transaction [13]. In this study, the author will make a simulation of the effect of latency on block receive time on Bitcoin with selfish-miner attack using NS3. This paper shows the effect of the latency variation in selfish miner attack on Mean Block receive Time in Bitcoin transaction. The author changed some parameters of a selfish-miner code from Arthur Gervais [4] and simulated using NS3. In chapter 2 will be explained about the concept of Bitcoin transactions. Chapter 3 will be explained about scenarios and experiments. Chapter 4 will be explained about experiment and discussion results. Chapter 5 is about conclusions.CONCEPT OF BITCOIN TRANSACTIONSThis chapter consists of several sub-chapters which will be explained about the definition of Bitcoin in 2.1, in 2.2 will be explained about transactions on Bitcoin, in 2.3 will be explained about the security against attack on Bitcoin, in 2.4 will be explained about selfish miner and at 2.5 will be explained about NS3.BitcoinBitcoin is the digital currency. The motto behind the development of the encryption algorithm is to make it difficult to destroy [5]. Satoshi [1] defines, the electronic coins as a digital signature chain. Each owner transfers the coin to the next by digitally signing the hash of the previous transaction and the public key of the next owner and adding it to the end of the coin. The pay receiver can verify the signature to verify the ownership chain.Figure SEQ Figure \* ARABIC 1 Process of digital signature AlgorithmThe Bitcoin protocol uses a digital signature which is a public key cryptography application. Digital signatures, such as normal signatures, are used to validate the source and integrity of generated messages. The Bitcoin address is basically the public key and private key associated with each Bitcoin address. The private key is used to unlock the public key. To make transactions using Bitcoins in an address, transactions must be signed or authorized using the private key associated with that address. Public key cryptography ensures secure binding of digital signatures. To verify the source document, the recipient only needs to provide the public key, documents and signatures associated with the document. The cryptographic algorithm in Bitcoin used elliptic curve cryptography. The cryptographic elliptic curve can be seen as a huge succession of points. The generator, which is a known point, marks the beginning of the elliptic curve protocol. What makes this algorithm simple to use and difficult to solve is the underlying computational complexity. It's easy and quick to calculate the public key for a given protocol private key. This is done using multiple and multiply algorithms. However, it is very difficult to calculate the private key given the public key. This problem is a typical example of discrete logarithmic problems. Before using the elliptic curve algorithm, the parameters for the elliptic curve should be established. These parameters include the curve coefficients a and b, the prime p plane and the generator A showing the starting point of the curve. Several parameters based on the level of security available to help decide and set arguments for this protocol. Satoshi chose the standard parameter secp256k1 for Bitcoin. The digital signature algorithm of the ECDSA elliptic curve which is a combination of the elliptical curve protocol and the DSA algorithm is an actual signature scheme implemented in Bitcoin as shown in figure 2[5].Figure SEQ Figure \* ARABIC 2 Algoritma Digital Signature Eliptic Curve ProcessBlockchain and Transaction of BitcoinBlockchain is a technology introduced with Bitcoin which was originally used to record Bitcoin financial transactions. Blockchain is also a data structure that cannot be changed and can only be added. Each data from blockchain is connected to each other where if there is a change in one of the data block it will affect the next data.Every transaction from Bitcoin is stored in an open ledger distributed into the Bitcoin network. Each blockchain will be distributed to each computer connected to the network. Each addition of data will be check whether the data is valid or not, which is usually called mining process or known as Proof of Work (PoW). In the blockchain there are several elements such as hash, block and PoW.Hash is a digital fingerprint or the identity of a digital data. Any data or digital object in the data block will be hashed with SHA-256 algorithm. Blockchain is a collection of multiple data blocks. This data block is the data of the transaction made. In a block will have a digital identity that will be in hash. The hash data is of two kinds: the hash of the current block and the hash of the previous block. PoW is a functional protocol that validates every incoming data to overcome spam attacks and DDoS attacks (Distributed Denial of Service). The usual PoW used in blockchain is to ensure the string "0000" on each hash of data from each block. That way the incoming data will be validated in advance whether it already contains certain requirements or not [6].The concept of Bitcoin has the advantage of absolute privacy, which allows each individual user to fully sovereign ownership. Bitcoin does not rely on conventional banking systems, because the owner absolutely controls and manages privately with the private dominant.Bitcoin is like real-life cash, which is applied digitally in the digital world. Transactions require bookkeeping, as is the use of bitcoin as a transaction tool. All Bitcoin transactions are recorded in a ledger called Blockchain. Blockchain recording system is open and leaves a digital footprint. Digital footprint in Blockchain recording allows everyone to check every Bitcoin transaction that has taken place. Thus, Blockchain can minimize all forms of transaction crime, because of the digital footprint in its recording system. To be able to save Bitcoin, it takes a kind of wallet, or an electronic wallet. Wallet has an address that allows Bitcoin owners to receive and send their Bitcoin to another party. Bitcoin wallet address is a series of combination of numbers and letters [7].Latency of BitcoinDefined as the time required to confirm a transaction. The Bitcoin protocol requires an average 10-minute confirmation time for transaction confirmation. To achieve higher scalability, network latency must be low, that is the time required for the protocol to confirm the transaction should be effectively reduced [5]. Sirer and Eyal indicate that miners can increase their share of overall revenue by hiding new blocks and making them available for systems in their private networks. It speeds up the discovery process and trims mining-related infrastructure issues, such as network latency and electricity costs.In bitcoin trading, network speed, firewall, VPN or other factors allow will have a latency of about 300ms. It may be very low, just a blink of an eye, however, it has been a very long period of time in high-frequency trading terms. Attempts to reduce latency can be done. Transaction times in different countries have different latencies. As an example; someone did a ping test to a web with a server in Frankfurt getting a result of latency of 29 ms. And he did a ping test with a server in New York City, getting 80ms of latency. Licenses are slightly higher than New York than from Germany because BitMEX is hosted at Amazon data centers in Ireland [8].Bitcoin Network SecurityBlockchain adopts an asymmetric encryption mechanism to allow users to encrypt data with their own private key. In addition, the user's public key hash value is calculated and serves as a user ID indicator. On the one hand, hash values ??have no relationship to the user's original identity, thus maintaining the security of the user's personal information as shown in figure 4. On the other hand, the process of calculating the hash value can be reversed, meaning the adversary cannot know the public key of the user from the public user address and calculating the private key of the public key is not possible. Therefore, blockchain maintains user privacy and privacy [9].Figure SEQ Figure \* ARABIC 3 Privacy Protection on BlockchainSelfish-minerThe selfish miner is a Bitcoin mining strategy where miner groups collude to increase their income. Bitcoin was created to decentralize the production and distribution of money. However, selfish-miners can generate centralization of bitcoin mining operations.Security protocol consensus can be damaged when the client node is a rational majority and honest. Bitcoin's reference implementation mandates that every few miners produce valid blocks, it distributes throughout the network. Eyal and Sirer indicate the selfish miner may obtain an unfair part of the reward block by deviating from the reference client. In particular, miners with computing power of more than 33% can gain disproportionately by retaining personal blockchain and retaining mined blocks. This forces the honest miners to perform the wasted calculations on the public branch stale. The selfish miner succeeds because the honest miners are forced to spend part of their computing cycle on blocks that are destined not to be in the public chain [10].Network Simulator 3 (NS3)NS3 is Network Simulator 3 which is an open source simulator, research-oriented and supported by the community to test network protocol. It has been developed for many years and supports almost all communication protocols such as MQTT, Zigbee, Bluetooth and others. It also supports various modules that allow parallel simulation, distributed simulation and others. Can be extended easily to support and test various applications [11]. EXPERIMENTAL SCENARIOSThis research will test the influence of latency on selfish miner attack against block receive time in Bitcoin. The parameters to be tested are variation of latency and Target Number of Blocks, it will be seen the effect to block receive time according to table 1. Experiments have been done using NS3 simulator and using source code from Arthur Gervais’s github [4].Table SEQ Tabel \* ARABIC1 Parameter Experimental ScenariosParameterValueTarget block100, 200, 300Latency (ms)50, 100, 200, 300Bandwidth 4Hash Rate 0,3Iteration 1EXPERIMENTAL RESULTS and DISCUSSIONThe experimental results have done the same pattern. Latency and blocks generated on MBRT (Mean Block Receive Time). Table 2 shows the result of the experiment with Target parameter block = 100 and latency = 50ms.Table SEQ Tabel \* ARABIC2 Parameter with Target Block 100 and Latency 50msTarget BlockLatency(ms)Block GeneratedMBRT (s)10050ms771173.840801106.150841073.030861054.590881029.640901009.88093964.02596947.10298922.81599914.025From the table above, it will be represented in the graph. Figure 4 shows the graph of the Target Block parameter = 100 and Latency = 50ms.Figure SEQ Figure \* ARABIC 4 Number of block generated vs Mean Block Receive Time of the Target Block parameter = 100 and Latency = 50msTable 3 shows the result of the experiment with Target parameter block = 200 and latency = 50ms.Tabel SEQ Tabel \* ARABIC 3 Parameter with Target Block 200 and Latency 50msTarget BlockLatency(ms)Block GeneratedMBRT (s)20050ms1701057.7901761022.700184978.157187965.272188960.015190951.832191939.482192938.704196915.629200899.131Figure 5 shows the graph of the Target parameter = 200 and Latency = 50ms.Figure SEQ Figure \* ARABIC 5 Number of block generated vs Mean Block Receive Time of the Target Block parameter = 200 and Latency = 50msTable 4 shows the result of the experiment with Target parameter block = 300 and latency = 50ms.Tabel SEQ Tabel \* ARABIC 4 Parameter with Target Block 300 and Latency 50msTarget BlockLatency(ms)Block GeneratedMBRT (s)30050ms2701003.030272996.487276975.762277974.037278968.550289935.639292921.980295917.955298901.588300887.094Figure 6 shows the graph of the Target parameter = 300 and Latency = 50ms.Figure SEQ Figure \* ARABIC 6 Number of block generated vs Mean Block Receive Time of the Target Block parameter = 300 and Latency = 50msTable 5 shows the result of the experiment with Target parameter block = 100 and latency = 100ms.Tabel SEQ Tabel \* ARABIC 5 Parameter with Target Block 100 and Latency 100msTarget BlockLatency(ms)Block GeneratedMBRT (s)100100ms781150.310811056.670891021.45091990.78393979.67195951.58396950.85597927.68598913.77599897.576Figure 7 shows the graph of the Target parameter = 100 and Latency = 100ms.Figure SEQ Figure \* ARABIC 7 Number of block generated vs Mean Block Receive Time of the Target Block parameter = 100 and Latency = 100msTable 6 shows the result of the experiment with Target parameter block = 200 and latency = 100ms.Tabel SEQ Tabel \* ARABIC 6 Parameter with Target Block 200 and Latency 100msTarget BlockLatency(ms)Block GeneratedMBRT (s)200100ms1611117.1001701053.1801751038.5801781011.420183996. 109185964. 118189956. 123193936.471195927.327199901.975Figure 8 shows the graph of the Target parameter = 200 and Latency = 100ms.Figure SEQ Figure \* ARABIC 8 Number of block generated vs Mean Block Receive Time of the Target Block parameter = 200 and Latency = 100msTable 7 shows the result of the experiment with Target parameter block = 300 and latency = 100ms.Tabel SEQ Tabel \* ARABIC 7 Parameter with Target Block 300 and Latency 100msTarget BlockLatency(ms)Block GeneratedMBRT (s)300100ms2571051. 1602621025.590272990.873277975.870279968.705281960.000282957.737286943.026292924.354296906.379Figure 9 shows the graph of the Target parameter = 300 and Latency = 100ms.Figure SEQ Figure \* ARABIC 9 Number of block generated vs Mean Block Receive Time of the Target Block parameter = 300 and Latency = 100msTable 8 shows the result of the experiment with Target parameter block = 100 and latency = 200ms.Tabel SEQ Tabel \* ARABIC 8 Parameter with Target Block 100 and Latency 200msTarget BlockLatency(ms)Block GeneratedMBRT (s)100200ms751188.460771141.680801140.520811091.690821091.060871040.510901000.59092973.43193964.99295917.769Figure 10 shows the graph of the Target parameter = 100 and Latency = 200ms.Figure SEQ Figure \* ARABIC 10 Number of block generated vs Mean Block Receive Time of the Target Block parameter = 100 and Latency = 200msTable 9 shows the result of the experiment with Target parameter block = 200 and latency = 200ms.Tabel SEQ Tabel \* ARABIC 9 Parameter with Target Block 200 and Latency 200msTarget BlockLatency(ms)Block GeneratedMBRT (s)200200ms1621114.2101731045.7801741034.5001781008. 1801801000.500186966.056188959.593190949.837193939.728194925.688Figure 11 shows the graph of the Target parameter = 200 and Latency = 200ms.Figure SEQ Figure \* ARABIC 11 Number of block generated vs Mean Block Receive Time of the Target Block parameter = 200 and Latency = 200msTable 10 shows the result of the experiment with Target parameter block = 300 and latency = 200ms.Tabel SEQ Tabel \* ARABIC 10 Parameter with Target Block 300 and Latency 200msTarget BlockLatency(ms)Block GeneratedMBRT (s)300200ms2671001.4202691001.360273984.833277972.079278971.550279967.115281964.412290932.724293924.154296910.951Figure 12 shows the graph of the Target parameter = 300 and Latency = 200ms.Figure SEQ Figure \* ARABIC 12 Number of block generated vs Mean Block Receive Time of the Target Block parameter = 300 and Latency = 200msTable 11 shows the result of the experiment with Target parameter block = 100 and latency = 300ms.Tabel SEQ Tabel \* ARABIC 11 Parameter with Target Block 100 and Latency 300msTarget BlockLatency(ms)Block GeneratedMBRT (s)100300ms751214.610801077.430821054.150861033.52091990.37892970.40996939.47597934.07398915.35799899.412Figure 13 shows the graph of the Target parameter = 100 and Latency = 300ms.Figure SEQ Figure \* ARABIC 13 Number of block generated vs Mean Block Receive Time of the Target Block parameter = 100 and Latency = 300msTable 12 shows the result of the experiment with Target parameter block = 200 and latency = 300ms.Tabel SEQ Tabel \* ARABIC 12 Parameter with Target Block 200 and Latency 200msTarget BlockLatency(ms)Block GeneratedMBRT (s)200300ms1711054. 1601721046.1501751038.570180996.780182993.343183984.693189953.637192929.220199908.880200899.902Figure 14 shows the graph of the Target parameter = 200 and Latency = 300ms.Figure SEQ Figure \* ARABIC 14 Number of block generated vs Mean Block Receive Time of the Target Block parameter = 200 and Latency = 300msTable 13 shows the result of the experiment with Target parameter block = 300 and latency = 300ms.Tabel SEQ Tabel \* ARABIC 13 Parameter with Target Block 100 and Latency 200msTarget BlockLatency(ms)Block GeneratedMBRT (s)300300ms2641024.580276975. 128278970.910279958.666283953.956284950.851285947.415289926.086295916.995299901.695Figure 15 shows the graph of the Target parameter = 300 and Latency = 300ms.Figure SEQ Figure \* ARABIC 15 Number of block generated vs Mean Block Receive Time of the Target Block parameter = 300 and Latency = 300msThe experimental results show the patterns on each graph are same. The graph shows the use of the latency variation and the more number of generated blocks, the lower the MBRT value. The average MBRT of each parameter shows the required receive time by the block number of about 15 minutes to 16 minutes, from MBRT’s value divided 60s. This amount exceeds the PoW's tolerance time limit when making a transaction. This is due of selfish-miner attack and Latency. In addition, the factors that affect the MBRT are the device specifications used and the power of the internet. CONCLUSIONSelfish-miner attacks can make honest miners forced to spend part of their computing cycle on blocks destined not to be in the public chain. Experimental results in NS3 show that the average MBRT of each parameter require receive time by the block number of about 15 minutes to 16 minutes. This amount exceeds the PoW's tolerance time limit when making a transaction. This is due of selfish-miner attack and Latency. In addition, the factors that affect the MBRT are the device specifications used and the power of the internet.REFERENCE[1] Bitcoin: A Peer to Peer Electronic Cash System, 2008. Available from: [2] A. Gervais, H. Ritzdorf, G. O. Karame, and S. Capkun, “Tampering with the Delivery of Blocks and Transactions in Bitcoin,” Proc. 22nd ACM SIGSAC Conf. Comput. Commun. Secur. - CCS ’15, pp. 692–705, 2015.[3] Ittay Eyal and Emin Gun Sirer. Majority is not enough: Bitcoin mining is vulnerable. In Financial Cryptography and Data Security, pages 436-454.Springer, 2014.[4] Bitcoin Simulator, 2016. Available from: .[5] S.Goswami,”Scalability Analysis of Blockchains Through Blockchain Simulation”, thesis, puter Science. University of Nevada, Las Vegas. New York, 2017.[6] Blockchain. Available from: [7] Nubika,Ibrahim.,”Cryptocurrency”, Bitcoin: Recognize a new way of Investing Milennial Generationl, Bantul: Genesis Learning, 2018, pp.84-121.[8] Why Latency Always Matters If You Are Trading Bitcoin. Available from: [9] F. Dai, N.Meng L.Wei and Z.Ye. From Bitcoin to Cyber security: a Comparative Study of Blockchain Application and Security Issues. In 2017 IEEE Fourth International Conference on Systems and Informatics (ICSAI), pages 1–5. IEEE, 2017.[10] K.Nayak, S.Kumar A.Miller and E.Shi. Stubborn Mining: Generalizing Selfish Mining and Combining with an Eclipse Attack. In 2016 IEEE European Symposium on Security and Privacy, pages 1–16. IEEE, 2016.[11] S.Gan,”An IoT Simulator in NS3 and A Key-Based Authentication Architecture for IoT Devices Using Blockchain ”, thesis, puter Science and Engineering. Indian Institute of Technology Kanpur. India, 2017[12] what is Bitcoin Selfish Mining?, 2018. Available from: [13] Low Latency Technology for Capital Market, 2016. Available from: ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download

To fulfill the demand for quickly locating and searching documents.

It is intelligent file search solution for home and business.

Literature Lottery