Deanonymisation of Clients in Bitcoin P2P Network
Total Page:16
File Type:pdf, Size:1020Kb
Deanonymisation of clients in Bitcoin P2P network Alex Biryukov Dmitry Khovratovich Ivan Pustogarov University of Luxembourg University of Luxembourg University of Luxembourg [email protected] [email protected] [email protected] Abstract about 100,000 nowadays. The vast majority of these peers Bitcoin is a digital currency which relies on a distributed (we call them clients), about 90%, are located behind NAT set of miners to mint coins and on a peer-to-peer network and do not allow any incoming connections, whereas they to broadcast transactions. The identities of Bitcoin users choose 8 outgoing connections to servers (Bitcoin peers with are hidden behind pseudonyms (public keys) which are rec- public IP). ommended to be changed frequently in order to increase In a Bitcoin transaction, the address of money sender(s) transaction unlinkability. or receiver(s) is a hash of his public key. We call such We present an efficient method to deanonymize Bitcoin address a pseudonym to avoid confusion with the IP ad- users, which allows to link user pseudonyms to the IP ad- dress of the host where transactions are generated, and the dresses where the transactions are generated. Our tech- latter will be called just address throughout the text. In niques work for the most common and the most challenging the current Bitcoin protocol the entire transaction history scenario when users are behind NATs or firewalls of their is publicly available so anyone can see how Bitcoins travel ISPs. They allow to link transactions of a user behind a from one pseudonym to another and potentially link differ- NAT and to distinguish connections and transactions of dif- ent pseudonyms of the same user together. A theoretical ferent users behind the same NAT. We also show that a natu- possibility of such attack was already mentioned in the orig- ral countermeasure of using Tor or other anonymity services inal Bitcoin paper [14]. Since then several papers [13, 16] can be cut-off by abusing anti-DoS countermeasures of the showed that it is indeed possible by analysing the transaction Bitcoin network. Our attacks require only a few machines graph to cluster pseudonyms to different users. Combined and have been experimentally verified. We propose several with some other sources (e.g. forum posts), the clusters countermeasures to mitigate these new attacks1. (and thus the users) can sometimes be mapped to real iden- tities [15, 13]. Even so, these methods are not generic, and the problem of how to tie a Bitcoin address to an actual 1. INTRODUCTION identity remained unsolved. Digital currency based on cryptography is not a new idea [8] Evidently, studying the entire IP traffic of the Bitcoin but till recently it did not attract much attention. It changed peers would reveal the origins of each transaction and dis- rapidly with introduction of Bitcoin [14]. Bitcoin is a decen- close the identities of many users, but how much can be tralized digital currency which does not rely on a trusted is- achieved by an ordinary attacker with a few machines and suing entity but rather on a peer-to-peer network with peers no access to clients behind NAT has been unclear. minting Bitcoins by brute-forcing double SHA-256 hash func- Lerner [12] and Koshy et al. [11] were the first who at- tion. To make the money generation process computation- tempted an attack in this direction. A vulnerability which ally hard, the Bitcoin protocol requires the minters to present allowed to link IP addresses of clients to their bitciond wal- the hash value of a data block with new portion of Bitcoins lets' addresses was reported by Lerner [12]. The vulnera- arXiv:1405.7418v3 [cs.CR] 5 Jul 2014 and new transactions to have a certain number of zeros (an bility exploited a protection against \penny-flooding" which instance of the Proof-of-Work concept). prevents a transaction with very low fees and big size to be Bitcoin is now accepted as a currency by many companies forwarded or even stored by a Bitcoin peer. The protection from online retailer Overstock to exotic Virgin Galactic [4]. tested if a transaction was from a wallet owned by the user, One of its main advantages over bank transfers is it's de- and if it was the case, then the protection was skipped. This centralized architecture and absence of intermediaries. This allowed an attacker to test if a peer possessed a Bitcoin ad- prevents shutting it down or seizing by a government. Bit- dress by sending him specifically crafted transactions. The coin money transfers are non-refundable, reasonably fast2 vulnerability required that the attacker had a connection to and allow to send money to any part of the world. The Bit- a peer (thus targeting either Bitcoin servers or clients which coin peer network consists of homogeneous nodes and pro- established connections to the attacker). This vulnerability vides peer discovery and reputation mechanisms to achieve was fixed since version 0.7.2. stability. The number of Bitcoin peers is estimated to be Koshy et al. [11] managed to deanonymize 1162 addresses over the period of 5 months. Their approach, however, is 1A simplified description of the attack can be found here. limited to the transactions that expose anomalous behaviour 2The network sees a transaction immediately, but the re- like transactions relayed only once or transaction that were ceiver has to wait for 1-2 hours to be sure that there is no relayed multiple times by the same IP. Secondly, the pro- double-spending. posed method only allows to get IP addresses of servers, to prohibit Bitcoin clients from using the Tor anonymity which constitute only 10% of the network, and not of the network by exploiting Bitcoin anti-DoS protection mech- clients. Finally, their paper does not discuss the case when anism (Section 3). a Bitcoin peer protects himself by proxying his transactions through the Tor anonymity network. • We show how to learn the connections of the Bitcoin clients in Section 4. Our contributions. • We finally show how to identify the sender of a trans- In this paper we describe a generic method to deanonymize action (i.e. deanonymize him) in Section 5. We recover a significant fraction of Bitcoin users and correlate their the public IP address of the sender and further differ- pseudonyms with public IP addresses. The method explic- entiate clients sharing the same public IP. itly targets the clients (i.e. peers behind NAT or firewalls) and can differentiate the nodes with the same public IP. Fur- • We discuss how to choose parameters of the attack thermore, our method also handles the case when the clients and its success rate and explain our experiments on use anonymity services like Tor. If a client uses two different the test network. We also propose countermeasures to pseudonyms during a single session, and even if they are un- mitigate the attack. related in the transaction graph so that the linkage would be • As an extra result, we outline a strategy to lower the totally unachievable via the transaction graph analysis [13], difficulty of the system by adding a properly selected our method is likely to catch it and glue the pseudonyms value to the list of checkpoints nodes hard-coded in the together. The method is generic and might be used in other client code. It can be used by the entire community P2P networks. if the mining becomes unbearable and non-profitable, The crucial idea is that each client can be uniquely iden- or by malicious administrators who want to ruin the tified by a set of nodes he connects to (entry nodes). We system (Section 8). show that this set can be learned at the time of connection and then used to identify the origin of a transaction. Ethical considerations. All vulnerabilities described in this Our attack requires only a few machines that establish a paper were reported to Bitcoin core developers. When pos- certain number of connections by Bitcoin protocol and log sible we carried out experiments in the Bitcoin test network. the incoming traffic. In a concrete example, an attacker with To protect user privacy, we restricted from performing a full- a few GB of storage and no more than 50 connections to each scale deanonymization in the real network. However, gath- 3 Bitcoin server can disclose the sender's IP address in 11% ering some statistics required us conducting experiments on of all transactions generated in the Bitcoin network. If the the main network, which did not cause disruption or expo- attacker allows a slight DoS of the network, he may achieve sure of the main network. deanonymization rates up to 60%, which has been confirmed by the experiments in the Bitcoin test network. We estimate 2. BACKGROUND the cost of the attack on the full Bitcoin network to be under 1500 EUR per month. In this section we provide a basic overview of the Bitcoin The computational power needed to disclose the sender system. Originating from a proof-of-concept source code of a single transaction is negligible and is far smaller than and an accompanying it white paper [14], the Bitcoin pro- the amount of work needed to process the transaction graph tocol never had been fully documented, and is de-facto the in [15, 13]. For the best of our knowledge this is the first functionality of the primary Bitcoin client, bitcoind [2]. In attack which targets Bitcoin peers behind NAT. Our attack the following text we provide only the details of the protocol does not assume any anomaly in the behaviour of peers or in that are crucial to our research.