AbstractBitcoin for more attacks. One of the

AbstractBitcoin is a decentralized cryptocurrency currently being used in all fields, to the extent that now, over 4.5 million BTC transactions per day are successfully completed. It has a completely independent network of personnel, called miners, providing the large computational power required to achieve this. But, this also allows for more attacks. One of the popular attacks is double spend attack where the attacker attempts to use a bitcoin twice. In this paper, we have summarized what a double spend attack is and also some of the available solutions for the attack.IntroductionSection 1 of the paper presents Bitcoin as a currency. Bitcoin a decentralized payment system based on Proof-of-Work is currently the most popular digital currency. It allows the parties to “mine” digital coins by using computations. Payments are carried out electronically using transactions that transfer Bitcoin coins (BTCs) between the parties on a Bitcoin network. In the next section we have introduced the concept of Double Spend Attack which highlights the fact that Bitcoin transactions are not always safe and effective and are prone to attacks by malicious users. Further we have discussed some solutions for preventing the Double Spend Attacks.What is Bitcoin?Bitcoin is a type of digital currency which uses encryption techniques to control the creation of Bitcoin units and verify the various transactions. This cryptocurrency enables anonymous payments eliminating the ever present exorbitant transaction costs, interest and exchange rate charges and avoids the possibilities of risks associated with other payment methods.It works on a peer-to-peer basis-meaning that it is decentralized and has no single administrator controlling it like a bank or any financial body. Although no meddling is done between the groups involved in a transaction but control of the currency and verification of transactions by network nodes is done with the help of cryptography and recorded in an “openly distributed ledger” called blockchain.What is a Bitcoin Transaction?Bitcoin transactions are sent from and to electronic bitcoin wallets, and are digitally signed for security purposes. In layman terms a Bitcoin wallet is a type of digital wallet that is used to store bitcoins. To be technically accurate it is a software program (that is available as a desktop or mobile application and via online services and also hardware) which uses a private key (secret number) for every Bitcoin address used in the transaction. Bitcoin wallets facilitate sending and receiving of Bitcoins giving ownership to a particular user involved in the transaction process.A local structure called memory pool stores the transactions which have been received but not confirmed.A basic transaction looks like this –Suppose there is a merchant M that accepts bitcoins as a payment for providing goods or services (let’s say raw materials for construction) to a construction company C; now this transaction will have three pieces of information:-• Input – through which bitcoin address C received its bitcoins in the first place (say the organization which gave the contract to C for construction of its office building)• Amount – actual payment in terms of number of bitcoins C sends to M.• Output – M’s bitcoin address.Now to send bitcoins, one requires: a bitcoin address and a private key.A bitcoin address is a randomly generated sequence of letters and numbers. The private key is another sequence of letters and numbers, but unlike bitcoin address, this is kept secret.When C wants to send bitcoins to M, it uses its private key to sign a message with the input (the source transaction(s) of the coins with C), amount, and output (M’s address). C then sends them from its bitcoin wallet out to the wider bitcoin network. From there, the transaction is verified, stored in a transaction block and eventually solved.Any currency is defined by economists as bonafide if it displays certain attributes: it functions as a medium of exchange, a unit of account, and a store of value. Bitcoin to a certain extent qualifies these criteria as is visible from the growing number of organisations and merchants investing and partaking in transactions using Bitcoin as a medium of exchange of services. However, the worldwide commercial use of bitcoin still remains infinitesimal as only the people well equipped with the technicalities and mechanisms to successfully perform a transaction use it as a medium of exchange.Also as a store of value, since bitcoin does not has any physical form and cannot be deposited in a bank  it must be stored and used through a “bitcoin wallets” that in turn have proved both difficult and costly to maintain and vulnerable to attackers. Bitcoin encounters multiple difficulties courtesy the ever-present hacking attacks, thefts, and other security-related issues. One such issue is of the “Double-Spend Attack”.What is Double-Spend Attack?A double spend attack, in basic terms, is spending a bitcoin twice. As each bitcoin is digitally signed, each bitcoin can be accounted separately. So, if a miner convinces a merchant that a bitcoin has been used in the transaction and then convinces the entire network to use the same bitcoin in another transaction, it will be called a double spend attack. This way, the merchant is left with neither the bitcoin not the service/product, as he won’t be able to redeem the transaction, while the attacker will be able to keep both.For this to be actually successful, the payments should be fast, i.e., before the block is locked. “Fast payment” means instant or very fast delivery of service/product by the merchant, they only wait for it appear and not confirm before providing the service. Presently, there is in increased use of bitcoins in “fast payments”, like ATM transactions, online services, fast food payments etc. Another method, which requires less computational power, is using false address. The attacker uses a bitcoin in a transaction with a vendor, but on the same time, he uses the same bitcoin on another transaction (with the same inputs) whose address is compromised, i.e., an address which is under the control of the attacker.In slow payments, the miner will have to alter transaction in blocks which are locked. In case of fast payments, the transaction is still in the “zero confirmations”, i.e., the unlocked nodes of transactions. Here, the copied bitcoin can be spread in the P2P network.Type of Double Spend AttacksRace AttackTraders and merchants who accept a payment immediately on seeing “0/unconfirmed” are exposed to the transaction being reversed. An attempt at fraud could work that the fraudster sends a transaction paying the merchant directly to the merchant, and sends a conflicting transaction spending the coin to himself to the rest of the network. It is likely that the second conflicting transaction will be mined into a block and accepted by bitcoin nodes as genuine.Merchants can take precautions (e.g., disable incoming connections, only connect to well-connected nodes) to lessen the risk of a race attack but the risk cannot be eliminated. Therefore, the cost/benefit of the risk needs to be considered when accepting payment on 0/unconfirmed when there is no recourse against the attacker.The research paper Two Bitcoins at the Price of One finds that the protocol allows a high degree of success by an attacker in performing race attacks. The method studied in the research paper depends on access to the merchant’s Bitcoin node which is why that even prior to this paper, recommendations for merchants include disabling incoming connections and to choose specific outgoing connections1.Finney AttackThe Finney attack is named after Hal Finney. It is a variation of a double-spend attack. The attacker initiates two transactions – one profiting the victim and one himself. Following are the characteristics defining this as a double spending attack:The attack is successful if the victim gives his consent to an unconfirmed transaction.It can even work if the victim waits a few seconds to verify his transaction on the network.It requires the participation of a miner in mining and controlling his block regardless of the hashrate so it can be achieved in considerably less than 50% of the network computational power. The following procedure is followed to carry out the attack:Firstly the attacker sends some coin to himself and he creates blocks for this transaction but does not broadcasts that block to the public blockchain.Then he exchanges his bitcoin with any merchant in return for that person’s goods or services.After that he releases the pre-mined block to the public network. This way the transaction with the merchant is overridden and become invalid and the attacker receives the coin back for further use. Limitations of the Finney Attack:The lower the computing power of the attacker’s system, the difficult it is to mine a block and lesser the probability for carrying out a successful attack.If the asset being demanded by the attacker is illiquid then it will be difficult to find a block that coincides with the need of the goods.If  the attacker demands a pre-paid service which runs for a specific period of time and is controlled by the merchant (and the merchant can shut down the service in case of anomalies ) the attack cannot be carried out.Some transactions like exchanging bitcoin with other forms of money necessitate the need of confirmations by merchant, making it difficult for the attacker to carry out the attack. Majority AttackAlso referred to as the 51% attack, this attack provides the attacker with more than 51% computational power of the entire network. Using this to his advantage he is able to mine the blocks faster than the rest of the network and proceeds in the following way – he forks the original block chain and competes in a mining race with the rest of the users but during this process (in his private network) he does not includes his own transaction data on the network – the transaction which enabled him to exchange his bitcoin for the services taken from the public network – and when the length of  his blockchain exceeds that of the original blockchain  he announces his blockchain to the public network, and according to the conflict resolving policy of  the bitcoin network which is – the blockchain with the longer length is given the credibility. So following this process he is able to hide his transaction from the network and is able to use those same bitcoins for the next transaction. And thus  no amount of confirmations can prevent this attack. Limitations of the attack:But in reality having more than 50% of the computation power of the network is nearly impossible with traditional computers .Waiting for confirmations in the attack will lead to increase in total cost of the resources giving required computational power and render the entire transaction unprofitable.    Future counters for the limtations:Shor’s Algorithm with Quantum computers can even break  encryption of bitcoins.Centralisation of computing power because of big clusters possessed by big companies also possess a great threat.How does a double-spend attack become successful?The basic concept of successfully using a bitcoin twice is that the miner will alter the block in which the bitcoin was originally used and then the block in which it appeared before the other miners realize the change in the block. Therefore, they will not only have to redo the computation for that block but also all the following blocks.The process flow is something like this(1):1. The attacker spends a bitcoin and it is stored in a block, suppose B02. That reaches the merchant as block B1 following some other blocks till Bk3. The merchant approves and delivers the product/service.4. Now, the attacker  release an altered copy of blocks B1 to Bz+1.5. If the attacker successfully releases the block Bz+1 before the blocks are verified by the otherminers, the attack will be successful.Though, something to keep in mind here is that it is not just important to make the block but also to relay it in the network before the verification is relayed.But for this, a very high computational power is required which is more than that of other miners so as tocompute at least one block more than the other miners. Also, a very precise timing is required. For example, if you want to get a free dinner from a restaurant. So you first pay using a bitcoin to that restaurant. Now you use the same bitcoin for another transaction. So, if your second transaction is received in the same memory pool as the restaurant one, it will be rejected. You will actually be spending more in trying to save that bitcoin than by honestly paying for the dinner.So, a successful double spend attack will not only require pretty high computational speed but also very good luck and a precise timing.Solutions for double spend attacksHow it is handled by Blockchain?Blockchain is a security measure and a universal ledger similar to the traditional ledgers. A block is a set of transactions. A blockchain is a series of such blocks forking as the transactions occur. Any transaction of bitcoin is available in the blockchain. The miners may not know the parties involved in a transaction, but they know exactly how much amount was sent from which address to which. The blocks are ‘locked’, although they are available for computations. They are locked only after all the transactions have been verified. A block is formed of whatever transactions are verified in a certain amount of time.The blocks are secured behind layers of security which can be passed only by solving complex mathematical equations. As the blockchain grows, these computations become heavier. So, as the size of blockchain has increased gradually, the probability of an attacker tampering with the blocks has decreased.Can conventional solutions be applied to Bitcoin?(i) The most obvious solution is rewards and punishment. Bitcoin gives BTCs to miners for each block they verify and demotivates double spend by punishing the attackers who are caught. Unfortunately, this doesn’t work for Finney attacks.(ii)A major cause of the window for the attacker to reuse the bitcoin is propagation delay. The longer it takes for the verification of transaction, the longer the attacker will have access to the bitcoin database. The current size of a block in the blockchain is 1-1.1 MB. The bigger the size of the block, more the number of transactions which will be locked in it. The time it takes to verify a block is a big part of the propagation delay. With the increase in the size of block, the propagation delay will increase. So, the propagation delay for a block of size 500 MB will be much less than the one with size 1.2MB and will, therefore, give less time for the attacker to attack.But, decreasing the size of a block is no longer a feasible solution because of such large number of transactions taking place (2 million to 5 million a day). (iii) Other side of verification delay is the time it takes to verify the transactions. For security, multiple confirmations are encouraged for verification. The propagation delay can be reduced by minimizing verification. IF the attacker receives the verification before the merchant, the attacker will be successful.(iv) The obvious solution for double spend in cases of fast payments would be for the merchants to wait for the confirmation. If the merchants wait for the confirmation of transaction before providing the service, the attacker will not be able to avail the service/product without paying.Although, most merchants do not wait for confirmation and by the time they come to know about the double spending, and that they have not received the payment, the merchandise is already sent and database already altered. Also, some newer apps hide a lot of data, including the confirmation.(v) Another simple solution is Id verification. Similar to the process of verification during a credit card transaction, extensive verification of identity can prevent double spending. But, this would make the BTC transaction process slower and inconvenient for the merchant, thus, reducing the benefits of bitcoin.Therefore, the solutions which are employed for transactions in physical currency cannot be successfully employed for bitcoins individually. Although, when combined, they may provide security, it would slow down the process flow of bitcoin and will not be additive to the cause.References1 A. Pinar Ozisik, and Brian Neil Levin (2017) “An Explanation of Nakamotos’s Analysis of Double-spend Attacks”2 Mandar Kadam, Praharsh Jha, and Shravan Jaiswal (2015) “Double Spending Prevention in Bitcoins Network”3 Arthur Gervais, Hubert Ritzdorf, Ghassan O. Karame, and Srdjan Capkun (2015) “Tampering with the Delivery of Blocks and Transactions in Bitcoin”4 Zhengjun Liu, Hui Zhao, Wen Shen et. al. (2017) “Double-Spending Detection for Fast Bitcoin Payment Based on Artificial Immune”