A closed-eye icon above a padlock.

Bitcoin and privacy

There are several measures and tools that can be used to improve the privacy of Bitcoin transactions. Coinjoin and PayJoin are the most advanced protocols.

FoxtrotZulu ·

Privacy in Bitcoin transactions is a topic of growing importance and concern around the world. Although Bitcoin is known for being a transparent public ledger, there are several measures and tools that can be used to improve transaction privacy.

Is Bitcoin really private?

One of the main features of Bitcoin, which affects privacy, is the ability to trace every transaction on the blockchain. Every transaction is recorded and visible to all network participants (you can check transactions at https://mempool.space/ or https://blockstream.info/). This means that if someone knows your Bitcoin address, they can trace all your transactions and see the balances associated with that address.

Bitcoin is often promoted as a privacy tool, but the only privacy that exists in Bitcoin comes from pseudonymous addresses, which are fragile and easily compromised through reuse, “taint” analysis, payment tracking, nodes that monitor IP addresses, and many other mechanisms. Once broken, this privacy is hard and sometimes costly to recover.

Can privacy in Bitcoin be improved?

With this concern in mind, several techniques and technologies have been developed. The simplest of all is to avoid reusing Bitcoin addresses. Instead of always using the same address to receive payments, users can generate new addresses for each transaction, and thanks to the design of HD (hierarchical deterministic) wallets, this is very simple for the user. This makes tracking harder and protects the user’s privacy.

More advanced privacy protocols have also been developed, such as CoinJoin and PayJoin. The biggest benefit of these types of transactions is that they break the common-ownership heuristic (all the inputs of a transaction belong to the same owner), meaning that the inputs do not belong to the same person or entity, but to several of them.

What is CoinJoin?

CoinJoin is a technique designed to improve the privacy of Bitcoin transactions by mixing the inputs and outputs of multiple participants into a single large joint transaction, creating more ambiguity about which input is related to which output.

A CoinJoin is a Bitcoin transaction that takes inputs from many different users and returns many outputs of identical amounts, so that an observer cannot easily determine which outputs belong to which participant. CoinJoin transactions hide the ownership of specific Bitcoin “coins” (UTXO). CoinJoin differs from other mixing services in that CoinJoin operators never take custody of any funds. Users keep control of their Bitcoin at all times. Here you can see an example of a CoinJoin transaction on the blockchain:

https://kycp.org/#/6f757373191bbf2a375d99d09150b4b098cd2c7586036deb1310467aaefe34b6

To build a CoinJoin transaction, users cooperatively contribute inputs to a transaction and receive the same amounts of Bitcoin back as outputs, all in uniform amounts. For example, if 5 users each put in amounts of 1, 2, 3, 4 and 5 BTC, there will be five inputs totaling 15 BTC and 15 outputs, each worth 1 BTC. The user who put in 1 takes 1, the one who put in 2 takes two outputs of 1, the one who put in 3 takes three outputs of 1, and so on, which makes it hard to identify the participants’ UTXOs.

PayJoin explained

Another technique is PayJoin, also known as P2EP (Pay to EndPoint). Unlike other CoinJoin implementations, here the outputs do not have the same value, which means the transaction does not look like a CoinJoin either. In addition, the outputs do not reflect the real value of the transaction.

When you make a PayJoin, you are trying to transfer funds from one wallet to another without the chain tracking the amount that was transferred.

It works like this: at least two participants agree to combine their payments into a single transaction. Unlike traditional Bitcoin transactions, where a payer sends funds to a payee, in a PayJoin transaction both the payer and the payee contribute funds as common inputs to the transaction.

A visual example: Alice has 1 BTC, Bob has 0.5 BTC, and Alice needs to pay Bob 0.2 BTC. Normally, Alice’s Bitcoin would decrease by 0.2 and we would see Bob’s balance increase by 0.2, which would be an obvious payment, since one balance goes up and the other goes down.

In a PayJoin, both Alice and Bob use their coins as inputs to the transaction, but the outputs already include the transfer of value from Alice to Bob.

Alice put in 1 Bitcoin –> Bob received 0.7 Bitcoin

Bob put in 0.5 Bitcoin –> Alice received 0.8 Bitcoin

In our example, the economic transfer is 0.2 BTC from Alice to Bob, but the outputs are worth 0.7 Bitcoin and 0.8 Bitcoin. The results do not reflect the real value of the transaction. This obfuscates the actual amount paid, breaking the payment-value heuristic.

Your privacy, your responsibility

It is important to stress that, although these measures can improve privacy in Bitcoin, they do not provide complete anonymity. While they make transactions harder to trace, it is still possible to perform analysis and associations to identify patterns and reveal information. It is therefore essential to take additional precautions, such as using wallets that are not linked to personal identities and being careful when revealing transaction information in public settings.

We must remember that total privacy cannot be guaranteed, and it is the user’s responsibility to take additional measures to protect their identity and maintain their privacy in the Bitcoin ecosystem.


Editing: Genny Díaz