coderrr

June 30, 2011

Patching The Bitcoin Client To Make It More Anonymous

Filed under: anonymity, bitcoin, cplusplus, patch — Tags: , , , — coderrr @ 5:18 pm

TLDR: this patch allows you to …
- see all addresses, including change
- see which addresses are linked together (does recursive expansion of address linkages)
- select which address(es) to send from, rather than letting the client to chose (randomly) for you

Bitcoin is a decentralized, peer to peer, digital currency. It has been referred to as anonymous, pseudo-anonymous, pseudonymous (whatever that means), and not anonymous at all. It seems there is a lot of misinformation about exactly how anonymous it is and how its anonymity works. I’m going to try to explain part of that here and provide a solution to one of the current big killers of its anonymity.

When you receive coins at a new Bitcoin address, that is, one you’ve never used before, the fact that you control that address is completely unknown to anyone except the sender (and anyone the sender leaked that info to). And the sender may not even know your actual identity, depending on if you revealed this to them or not. If you receive another payment at that same address then both the first and second payers will be able to see that both of them payed you at that address. This is due to how the Bitcoin block chain works and is why you are advised to create a new address for each new payment you wish to receive.

So assume you’ve created 100 addresses for 100 payments. Each of the 100 people know they paid you once, but they don’t know that 99 other people paid you or how much those payments were or how much you have total. So you have revealed very little about yourself to anyone.

Now let’s say you want to _make_ some payments or even just re-organize your funds by moving them to another address. This is where things get tricky and you start losing anonymity. The official Bitcoin client picks coins from multiple addresses in a random fashion when making payments. So let’s say you have those 100 payments from 100 different people each attached to their own address sitting in your wallet and now you want to send Wikileaks some coins. The Bitcoin client might chose coins from 3 of those incoming payments to send out. Now all 3 of the people who sent you those payments know that you received at least 3 payments, how much they were for, and when you received them.

Let me give you a scarier example. Let’s say you have 1 million dollars worth of Bitcoin sitting in one address from some withdrawals on a Bitcoin exchange. Now let’s say you have an address you use for donations, and assume you’ve gotten at least one. The next time you want to send some coins to someone, your client may pick a few coins from your million dollar address and a few coins from your donation address. This is a big problem because it gives the people who’ve donated coins the knowledge that you are also in control of the million dollar address. Plus if your donation address is publicly associated with your identity not only the donors but anyone can go through the block explorer to see which other addresses you are in control of and what their balances are.

Here is a related excerpt from the bitcoin wiki

… if one has bitcoins on several addresses, one can theoretically choose from which address to send the coins. Choosing personally generated coins or an address that you know doesn’t reveal information would protect you. Unfortunately, the default Bitcoin client doesn’t support this currently, so you must assume that your entire balance can identify you if any of the addresses can.

So what can you do about this? If you don’t have any Bitcoin yet then you can just make sure to use separate wallets for addresses you don’t want being mixed together. If you’re already in the position where you have public and private funds in the same wallet there’s not much you can do with the official Bitcoin client, other than not send coins to anyone (or yourself).

That’s why I’ve made a patch to the official client which allows you to send from _only_ a single specific address. Now you can be sure the only people who will ever know that you made that transaction are the ones who already knew about the address being under your control. If you did things right, this will only be a single person.

I’ve added a ‘Send From Address’ tab to the main interface. It actually contains information which was impossible to get from the client before. That is, every address in your wallet and the balance thereof. This includes addresses which were created for the change of your outgoing transactions. These were previously nowhere to be found in the client (even using the bitcoind RPC interface).

Simply chose the address you wish to send from and double click it. This will open the Send dialog with the Send From address filled in. If you try to send more coins than are available in that address the transaction will simply fail and you can try again. Leaving the Send From address blank will make the client behave normally and possibly pick coins from multiple addresses.

The second version of my Bitcoin client patch gives you a better view of your current address linkages. If any two or more addresses were used together for an outgoing transaction those will be considered linked. If any change is returned from an outgoing transaction that change address will be considered linked to all the originating addresses.

The ‘Send From Address’ tab now groups together linked addresses. Each group is separated by an empty line. I’ve also added a ‘Label’ column which will show you the label for the address if one has been set in the ‘Address Book’. Since your receiving addresses usually have labels this makes it easy to see which other addresses they have been linked to.

Sending from multiple addresses is now supported. Simply use the CTRL key to select multiple addresses then click the ‘Send’ button. The addresses will appear in the ‘Send From’ textbox separated by semicolons. Note, this DOES NOT guarantee all the addresses you selected will be used for the transaction. But it DOES guarantee that no unselected addresses will be used. As before, if you leave the ‘Send From’ field blank the client will fall back to its default behavior.

Version 3 of the patch now contains command line support for bitcoind:

bitcoin listaddressgroupings
bitcoin sendtoaddress <bitcoinaddress>[:<sendfromaddress1>[,<sendfromaddress2>[,...]]] <amount> [comment] [comment-to]

Add a +1 to the pull request if you believe this should be added to the official client: https://github.com/bitcoin/bitcoin/pull/415

My github bitcoin fork: https://github.com/coderrr/bitcoin/tree/v0.5.1%2Bcoderrr
The commits with the changes: https://github.com/coderrr/bitcoin/compare/v0.5.1…v0.5.1+coderrr
Compiled Windows 32bit client: http://mtgoxlive.com/downloads/bitcoin-v0.5.1+coderrr-win32.zip
Compiled Linux 64bit client: http://mtgoxlive.com/downloads/bitcoin-v0.5.1+coderrr-linux64.tar.bz2

Advertisement

9 Comments »

  1. Zera@gmail.com

    Comment by Hell yes, i want write something like this but didnt have 1 measure, may i repost this Patching The Bitcoin retainer To evince It More of unknown authorship « coderrr — July 1, 2011 @ 4:14 pm

  2. The behavior of the bitcoin client is non-intuitive in the way it randomly chooses which addresses to send coins FROM. It’s one thing that bitcoin is not anonymous, but could they have gone out of their way any further to make it LESS anonymous?!

    Comment by Angus Boyd — July 11, 2011 @ 3:16 pm

    • Random shuffling of transactions is only one part of the coin choosing algorithm. It’s not 100% random but to the average user or even to an advanced one it might as well be. Obviously the rationale for this algorithm wasn’t anonymity although that doesn’t mean it was a bad choice.

      Comment by coderrr — July 13, 2011 @ 7:48 pm

  3. is there any chance choosing where to send from will be incorporated into the official client at some point?

    Comment by Anonymous — July 21, 2011 @ 8:50 pm

  4. HELLO PLS CREATE Linux 32BIT client

    Comment by Anonymous — September 23, 2011 @ 8:17 am

  5. Hi and what about Linux 32bit client

    Comment by Anonymous — September 24, 2011 @ 10:02 am

  6. this is awesome. used it all the time. now I installed v0.5 but it is missing this feature. arrgh. please let me know about anything new and I will spin it on bitcoinX.com

    cheers!

    Comment by phelix — November 28, 2011 @ 7:28 pm

  7. Why doesn’t this patch get incorporated into the standard client? It could be on an “advanced” set of features or something.

    Comment by É vedado o anonimato — December 1, 2011 @ 11:43 am

  8. Please, for the love of god, do NOT post +1s on the pull request. Pull requests are for discussion of the pull, not for indicating support for the pull; there is plenty of interest to get the pull request pulled, assuming some remaining issues are resolved.

    Comment by BlueMatt — January 1, 2012 @ 11:40 pm


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Theme: Silver is the New Black. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.