{"id":28933,"date":"2014-03-26T09:50:19","date_gmt":"2014-03-26T09:50:19","guid":{"rendered":"http:\/\/ci027cfe6fe0042697"},"modified":"2014-03-26T09:50:19","modified_gmt":"2014-03-26T09:50:19","slug":"fraud-detection-world-bitcoin-1395827419","status":"publish","type":"post","link":"https:\/\/bitcoinmagazine.com\/culture\/fraud-detection-world-bitcoin-1395827419","title":{"rendered":"Fraud Detection in the World of Bitcoin"},"content":{"rendered":"<div id=\"bsf_rt_marker\"><\/div><figure><img decoding=\"async\" src=\"https:\/\/bitcoinmagazine.com\/wp-content\/uploads\/2024\/11\/fraud-detection-in-the-world-of-bitcoin.png\" title=\"\"><\/figure>\n<p>The Bitcoin protocol is strong cryptographically (to the best knowledge so far), and we wish the world encompassing its network and users were as secure. In this article, we will review several classes of attacks, how a feature of the Bitcoin protocol in conjunction with online wallets will help prevent them and we\u2019ll end with an overview of why fraud detection is a difficult endeavor.<\/p>\n<p>To avoid any confusion, in the context of this article, \u201cfraud\u201d refers to a transfer of funds to a destination not authorized by their legitimate owner. Double spending or transaction malleability have been covered extensively elsewhere.<\/p>\n<p>Pretty much everyone reading this article will know Bitcoin transactions are technically irreversible and this makes them very attractive for merchants because the received funds are immediately spendable. In some jurisdictions it might be possible that the merchant is forced, through a court order, to refund a transfer, but this case is a legal matter, completely unrelated to the method of payment (nonetheless, for consumers it is a good resort to have in the rare case of rogue merchants).<\/p>\n<p>Bitcoin\u2019s use of digital signatures ensures transactional integrity and non-repudiation. The network, which verifies the transaction, cannot check however whether the private keys were provided by the legitimate user or another party. That step is outside of the protocol\u2019s boundaries and is the <em>wallet<\/em>\u2019s responsibility to authenticate the user and unlock access to the private key. The wallets or the users are therefore the targets of malicious attacks.<\/p>\n<h2><strong>Attacks Against Wallets<\/strong><\/h2>\n<p>The level of security provided by wallets varies with the implementation, in terms of both features and quality. Naive implementations will simply store the wallet unprotected or weakly protected (once the file is stolen, a short PIN can be trivially brute-forced) and this is why wallet-stealing malware is one of the easiest attack paths. In fact it is so obvious (reminiscent of Willie Sutton\u2019s famous yet <a href=\"https:\/\/www.snopes.com\/fact-check\/willie-sutton\/\" target=\"_blank\" rel=\"noopener\">apocryphal<\/a> answer: \u201cbecause that\u2019s where the money is\u201d) that two researchers, Pat Litke and Joe Stewart, have recently catalogued 146 distinct Bitcoin-stealing malware, out of which only half were detected by anti-virus scanners (read a good <a href=\"https:\/\/www.forbes.com\/sites\/andygreenberg\/2014\/02\/26\/nearly-150-breeds-of-bitcoin-stealing-malware-in-the-wild-researchers-say\/\" target=\"_blank\" rel=\"noopener\">summary<\/a> or, better, the original <a href=\"https:\/\/www.secureworks.com\/resources\/wp-cryptocurrency-adoption-best-practices\" target=\"_blank\" rel=\"noopener\">paper<\/a>). Even if the wallet is coded diligently, given that run on a software stack, the underlying layers can have <a href=\"https:\/\/bitcoinmagazine.com\/articles\/critical-vulnerability-found-in-android-wallets-1376273924\">vulnerabilities<\/a> which, however difficult, will be found given time (the money to be stolen is a great motivator).<\/p>\n<p>Several approaches exist to mitigate this risk. A common one is using two-factor authentication (requiring a telephone with a registered phone number which will receive a one-time code via SMS or a voice call. <a href=\"https:\/\/en.wikipedia.org\/wiki\/Google_Authenticator\" target=\"_blank\" rel=\"noopener\">Google Authenticator<\/a> is a popular choice). It is a good complement for computer-based wallets, but less so for mobile wallets residing on the same phone which can be stolen. By the time its owner removes the authorization for the phone, the funds might be gone. How can a thief know the wallet password? The same techniques as for stealing the PINs of physical cards: \u201cshoulder surfing\u201d or cameras filming the user while performing a legitimate transaction (a club\u2019s bar is a high-risk location, for instance). Keylogger malware is another popular approach.<\/p>\n<p>Other approaches consist of \u201c<a href=\"https:\/\/bitcoinmagazine.com\/articles\/brain-wallets-the-what-and-the-how-1333845334\">brain wallets<\/a>\u201d which do not store the keys but generate them from a (hopefully long) passphrase memorized by the user. This is harder in practice, not only because occasional users may rightfully be wary of forgetting it (carrying a paper with it in the physical wallet would negate the security but it will happen nonetheless) but also because a good passphrase would be about<a href=\"https:\/\/bitcoinmagazine.com\/articles\/brain-wallet\">50 words<\/a>long and this would make frequent use cumbersome.<\/p>\n<p>Lastly, paper wallets and hardware wallets are more secure, but they are more suitable for the cold storage of funds, rather than daily use. Diligent users will employ them, but do not expect this to be the norm.<\/p>\n<p>In fact, the wallet does not have to be stolen to be used as a source of money. <a href=\"https:\/\/en.wikipedia.org\/wiki\/Ransomware\" target=\"_blank\" rel=\"noopener\">Ransomware<\/a>, malware that <a href=\"https:\/\/www.comparitech.com\/blog\/information-security\/ransomware-removal-handbook\/\" target=\"_blank\" rel=\"noopener\">encrypts user files and demands a payment<\/a> for unlocking them \u2013 <a href=\"https:\/\/en.wikipedia.org\/wiki\/CryptoLocker\" target=\"_blank\" rel=\"noopener\">CryptoLocker<\/a> being the most (in)famous \u2014 can provide a steady source of income through ransoms, regardless of whether the private keys are obtained. It is unlikely that such malware will be written for Bitcoin wallets specifically (why limit the attack?), but wallets will be taken with all other personal files. This is where cold storage of most funds, Bitcoin\u2019s equivalent of \u201cdon\u2019t keep all your money as cash with you\u201d) as well as backups are absolutely essential.<\/p>\n<p>So far we\u2019ve talked about user wallets. On the other end of the wire, any online site storing bitcoins, be them wallets, merchants or exchanges, should be prepared for <a href=\"https:\/\/en.wikipedia.org\/wiki\/Advanced_persistent_threat\" target=\"_blank\" rel=\"noopener\">advanced persistent threats<\/a> and followers of the excellent Krebs on Security <a href=\"https:\/\/krebsonsecurity.com\/\" target=\"_blank\" rel=\"noopener\">blog<\/a> will be familiar with how indirect attacks can be, <a href=\"https:\/\/krebsonsecurity.com\/2014\/02\/email-attack-on-vendor-set-up-breach-at-target\/\" target=\"_blank\" rel=\"noopener\">going<\/a> through third-party suppliers of the target (overused pun not intended). Indeed, <a href=\"https:\/\/www.theguardian.com\/technology\/2014\/mar\/18\/history-of-bitcoin-hacks-alternative-currency\" target=\"_blank\" rel=\"noopener\">attacked<\/a> have they been. Most high-value attacks today are profit-motivated and supported by organized crime (by the way, someone tried to <a href=\"http:\/\/gavintech.blogspot.ch\/2014\/03\/it-aint-me-ive-got-pgp-imposter.html\" target=\"_blank\" rel=\"noopener\">impersonate<\/a> Gavin Andresen on the PGP key servers). Although <a href=\"https:\/\/en.wikipedia.org\/wiki\/Payment_Card_Industry_Data_Security_Standard\" target=\"_blank\" rel=\"noopener\">PCI-DSS<\/a> is not perfect, its recommendations are mostly applicable to Bitcoin businesses.<\/p>\n<h2><strong>Attacks Against Users<\/strong><\/h2>\n<p>Why hack the user\u2019s computer when you can persuade him to pay you? Scamming is as old as the world. A Bitcoin address does not have any identification about its owner so simple persuasion to send money to the scammer\u2019s address can work well (side note: what at times is a feature is, at others, a usability shortcoming. However, the idea of a resolution mechanism to associate a computer-friendly wallet address with the human-friendly social networks identities or a directory has faced<a href=\"https:\/\/bitcoinmagazine.com\/articles\/why-the-bitcoin-greenlist-is-structurally-dangerous-to-the-bitcoin-ecosystem-1384492133\">considerable critique<\/a>for fear it would create a two-tier system that will eventually destroy Bitcoin. A good decentralized solution is still in the future).<\/p>\n<p>Every event involving a loss of bitcoins or even a service outage has the <a href=\"https:\/\/twitter.com\/aantonop\/status\/446017270737694720\" target=\"_blank\" rel=\"noopener\">potential<\/a> to be used by scammers for phishing (or <a href=\"https:\/\/pando.com\/2014\/03\/19\/users-of-bitcoin-wallet-blockchain-info-targeted-with-impostor-twitter-account\/\" target=\"_blank\" rel=\"noopener\">fake Twitter<\/a> accounts soliciting donations) and as Bitcoin becomes more popular, we can expect the wave of donation requests to fraudulent addresses following earthquakes or other disasters.<\/p>\n<p>To be clear: this is not a vulnerability in the Bitcoin protocol. After all, the legitimate owner of the funds decided to make a transfer. It\u2019s a plain scam, not a hack. Nonetheless, if the ecosystem will have features reducing the incidence of such scams the trust in the system and the adoption will be higher.<\/p>\n<p>A different type of attack is one in which a Bitcoin-accepting website is hacked and the destination address modified to be the attacker\u2019s. The attack cannot last long for merchants, whose checkout process will notice the funds have not arrived to their address but sites accepting donations may be exploited for longer times.<\/p>\n<h2><strong>Transaction Screening<\/strong><\/h2>\n<p>The conceptual answer is to have the transaction screened for fraud outside of the device originating the payment which can be under the control of an attacker or malware. This is similar in principle to how a credit card transaction initiated by the consumer is vetted and, to implement it, Bitcoin has an elegant mechanism: <strong>multi-signature transactions<\/strong>, requiring more than one party to sign a transfer. While they serve multiple purposes (<a href=\"https:\/\/bitcoinmagazine.com\/articles\/bitrated-you-can-no-longer-say-bitcoin-has-no-consumer-protection-1386696848\">escrow<\/a> being a typical example), in this case a second party would be a service that screens transactions for fraud and only if the transaction is okayed by it, then it is broadcast to the network. Vitalik wrote an excellent (as usual) <a href=\"https:\/\/bitcoinmagazine.com\/articles\/multisig-future-bitcoin-1394686504\">primer<\/a> earlier this month and I\u2019ll invite you to read it rather than covering the same topic here. The <a href=\"https:\/\/www.youtube.com\/watch?v=zIbUSaZBJgU&amp;feature=youtu.be\" target=\"_blank\" rel=\"noopener\">tutorials<\/a> by James D\u2019Angelo\u2019s on YouTube are also highly recommended.<\/p>\n<p>Who can be that other party screening the transaction? The web wallet is the first choice and, in fact, this feature is already implemented and promoted by <a href=\"https:\/\/cryptocorp.co\/\" target=\"_blank\" rel=\"noopener\">CryptoCorp<\/a> right on the front page, a proof that fraud prevention can have marketing value and not just make the finance department happy. Notably, the use of a web wallet provides more data points since the IP address and device information can be used as inputs and detect, for instance, if the network location of the user\u2019s wallet has jumped across an ocean within minutes. Security-conscious users will prefer not to use online wallets, yet I think it is a safe bet to say that the convenience will keep them popular, as with cloud-based email or file storage. The wonderful thing is that multi-signatures, by requiring both the user and the exchange to cooperate, make this option arguably more secure than single-signature local storage given the permanent threat of having the hot storage hacked.<\/p>\n<p>After an initial period in which online wallets implement their own solutions, if at all, I do expect some consolidation to follow in time, with fewer third party fraud detection services being used by more wallets. It\u2019s part economics (pay-for-service is often cheaper than build-your-own, particularly a build-your-own-complicated-system), part efficiency. Collaborative fraud detection is already used by the payment industry, with merchants and financial institutions sharing fraud data with a number of vendors or among themselves with the goal of reducing it for everybody (disclosure: I\u2019ve been involved in building such systems, but none of them is public or commercial and I hold no financial interest in any such vendors. Nonetheless, I have not named any companies).<\/p>\n<h2><strong>Why Fraud Detection Is Not Easy<\/strong><\/h2>\n<p>Fundamentally, detecting fraud is hard precisely because it is rare, dynamic and not necessarily obviously fraudulent. I think we can safely say there will not be a perfect fraud detection system. What is a perfect such system? One that detects 100 of all fraud without ever mistaking a legitimate transaction for a fraud. 100 sensitivity and 100 specificity, the Nirvana of classifiers, to throw in a little bit of statistical jargon here (it goes well with crypto).<\/p>\n<p>Perhaps all techniques have been tried in the quest for a \u201cbetter fraud trap\u201d. Rule engines, neural networks, genetic algorithms, random forests, hidden Markov models, clustering, support vector machines, outlier detection \u2014 and I will stop here. Why this many? One reason is that new techniques are being invented. For instance, random forests are a development of the last two decades, enabled by the increase in computation power.<\/p>\n<p>Another reason is brought about by the rarity of fraud. Suppose 1 transaction is 10,000 is a fraudulent. In order to train a binary classifier (the system that answers the question \u201cis it fraud or not?\u201d), past data, for which known fraud transactions are marked as such, are fed in to tune its parameters. When an algorithm is trained on 99.99 good data, the remaining 0.01 is just noise, not making a dent in its parameters. In other words, the needle is just noise in the haystack.<\/p>\n<p>There are ways around this \u2013 after all, fraud detection is done almost exclusively by software today \u2013 the point is that it is not easy, particularly beyond catching trivial fraud. The fundamental tension of all binary classification systems, equally applicable to other domains, such as detecting cancer signs in mammograms or classifying galaxies, is between the ability to detect the target and the avoidance of false alerts. The more sensitive a test is, the higher chances of false positives. When this relationship is plotted it is known as a <a href=\"https:\/\/en.wikipedia.org\/wiki\/Receiver_operating_characteristic\" target=\"_blank\" rel=\"noopener\">ROC curve<\/a> and used to rank different strategies. In business terms, attempting to catch too much fraud will eventually inconvenience customers who will have legit transactions blocked or delayed and finding where to draw the line takes time (a good read straight from the real world: Coinbase\u2019s own blogposton this topic).<\/p>\n<p>Why this exposition on fraud detection here? Because the inclusion of fraud detection capabilities, while desired, will increase the complexity of a provider\u2019s operations (a provider being a wallet or exchange). On one hand, it brings trust and financial value. On the other, the system will need to be maintained, kept up-to-date with changes in fraud patterns (more complex and expensive systems adapt automatically)and business processes will need to be defined to deal with the algorithms\u2019 imperfections.<\/p>\n<p>What about the future beyond the immediate? Well, for one human nature will not change and fraud attempts will continue to occur as long as the block chain will exist (will \u201cbefore the block chain\u201d be the next generation\u2019s \u201cbefore the web\u201d placeholder for the prehistoric times?) and securing the entire ecosystem, even more so when more complex features such as smart contracts are added, will continue to be part of it, along with mining and development. The price of security is eternal vigilance, decentralized worlds included.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Bitcoin protocol is strong cryptographically (to the best knowledge so far), and we wish the world encompassing its network and users were as secure. In this article, we will review several classes of attacks, how a feature of the Bitcoin protocol in conjunction with online wallets will help prevent them and we\u2019ll end with [&hellip;]<\/p>\n","protected":false},"author":3689,"featured_media":28932,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[33],"tags":[2005,402,2755,648,1698,551,356,2106,1853,708,163],"class_list":{"0":"post-28933","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-culture","8":"tag-attacks","9":"tag-data","10":"tag-features","11":"tag-fraud","12":"tag-keys","13":"tag-merchants","14":"tag-multisig","15":"tag-ransomware","16":"tag-systems","17":"tag-transactions","18":"tag-wallets"},"author_data":{"id":3689,"name":"Razvan Peteanu","nicename":"razvan-peteanu","avatar_url":"https:\/\/bitcoinmagazine.com\/wp-content\/uploads\/2024\/12\/cropped-bitcoin-schmitcoin-promo-image-1-2-96x96.png"},"featured_image_url":"https:\/\/bitcoinmagazine.com\/wp-content\/uploads\/2024\/11\/fraud-detection-in-the-world-of-bitcoin.png","_links":{"self":[{"href":"https:\/\/bitcoinmagazine.com\/wp-json\/wp\/v2\/posts\/28933","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bitcoinmagazine.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bitcoinmagazine.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bitcoinmagazine.com\/wp-json\/wp\/v2\/users\/3689"}],"replies":[{"embeddable":true,"href":"https:\/\/bitcoinmagazine.com\/wp-json\/wp\/v2\/comments?post=28933"}],"version-history":[{"count":0,"href":"https:\/\/bitcoinmagazine.com\/wp-json\/wp\/v2\/posts\/28933\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/bitcoinmagazine.com\/wp-json\/wp\/v2\/media\/28932"}],"wp:attachment":[{"href":"https:\/\/bitcoinmagazine.com\/wp-json\/wp\/v2\/media?parent=28933"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bitcoinmagazine.com\/wp-json\/wp\/v2\/categories?post=28933"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bitcoinmagazine.com\/wp-json\/wp\/v2\/tags?post=28933"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}