This article was translated from Japanese with AI. Read the original (日本語) · Report a translation issue

How much thought have you given to Bitcoin privacy beyond the transactions recorded on the blockchain?

Because criminals also use Bitcoin, whether for ransomware payments or in hacks like the one at the Japanese exchange DMM Bitcoin, companies such as Chainalysis that supply tools to law enforcement are always on the lookout, using a variety of methods to pin down where Bitcoin transactions come from.

In this article, I'll use an "analysis of Bitcoin node P2P traffic data" published by a Bitcoin user to look at so-called "spy nodes," and explain a few other techniques for tracing where transactions originate (along with steps we can take to protect our privacy).

Here is the original article:

Bitcoin node P2P traffic analysis
I’d like to share some of my recent node traffic analyses in case someone else might find the method for making estimates estimates or some of the insights enabled by the estimates useful. I initially did this work to figure out what kind of bandwidth savings to expect for Erlay, but I think the approach and data might be useful for other P2P optimizations as well. While measuring overall node traffic is trivial (e.g., via iptables, systemd’s IP accounting), there’s hardly anything useful to l…

• What a suspicious group of nodes in a Bitcoin node's traffic data means

• What spy nodes are after

• Your wallet can also be a major privacy risk

What a suspicious group of nodes in a Bitcoin node's traffic data means

The author of the article linked above analyzed the types of traffic (the types of P2P messages) on a Bitcoin node they had set up, calculated totals based on the amount of data each one required, and charted the results. During the analysis, they

• during IBD (the initial sync of the blockchain)
• Unreachable (an environment that does not accept outside connections, such as a home network)
• Reachable + Pruned (accepts outside connections but does not keep old blockchain data)
• Reachable Non-Pruned (accepts outside connections and keeps all blockchain data)

tested these four states and recorded the traffic. (As a sanity check, they compared the sum of all the traffic estimates with the system's own traffic monitoring, and the two apparently matched almost exactly.)

Unsurprisingly, traffic was very heavy during IBD, since the node was downloading blocks from elsewhere, and the same was true in the Reachable Non-Pruned state, since the node was serving blockchain data to other nodes doing their own IBD.

validation-hourly+all+logscale
The end of IBD and the switch from Pruned to Non-Pruned show up clearly in the traffic, but the switch from Unreachable to Reachable also produced a slight increase around Feb 12. Because the axis is logarithmic, don't compare the areas of the different colors (the color on top is by far the largest).

The author also discusses what the data suggests about things like the efficiency of P2P communication, but from a privacy standpoint the interesting part is the slight increase in traffic after switching from Unreachable to Reachable. The chart below shows total daily traffic for each connected peer:

The inbound peers accepted from Feb 12 onward mostly sit at around 1 MB, far less than the 10–100 MB typical of outbound peers

Traffic with the peers the node itself had connected to (outbound peers) was mostly around 10–100 MB per day, and it stayed at that level after the switch to Reachable. The chart makes it clear, however, that most of the peers that connected from outside once the node began accepting incoming connections (inbound peers) exchanged only about 1 MB per day.

Outbound peers are normally used to propagate transactions and blocks, and 1 MB a day is far too little for inbound peers. Besides, from the point of view of your own outbound peers, you are their inbound peer, so inbound peers should also be expected to show something like 10–100 MB.

When the original author looked into how these inbound peers with such unusually low traffic behaved, it turned out that after connecting they sent nothing in particular. They simply received the INV messages the node broadcast (P2P messages announcing the arrival of new transactions) and answered pings so the connection wouldn't drop. The author also argues that they can't be the light clients known as SPV, used by some wallets, since no SPV-related P2P messages arrived. (They reportedly come from a limited range of IP addresses, too, so one can guess they are nodes spun up en masse by a single entity.)

To sum up:

• Many of the nodes that connect to a Bitcoin node from outside behave differently from normal nodes and generate remarkably little traffic
• Looking at what they exchange, they do little more than receive the INV messages (announcing the arrival of new transactions) sent by your node
• These nodes often sit within specific IP address ranges, so they are presumably run by a single entity to monitor the network

What spy nodes are after

So what are these spy nodes after, endlessly collecting nothing but the timing at which Bitcoin transactions reach each node?

As mentioned at the start, Bitcoin thefts happen frequently, and one headache for investigators is that if the culprit runs their own Bitcoin node, it is hard to get any clues about who broadcast a transaction. Could it be, then, that companies like Chainalysis that provide blockchain analysis services to law enforcement are mounting something like a Sybil attack on the network to obtain information such as "this transaction was most likely broadcast from this node"?

If they can identify the node (and its IP) that first broadcast a transaction, that becomes a foothold for an investigation: the cloud account if the node is hosted in the cloud, the ISP if it is hosted at home, or security cameras if it was broadcast from a café. In other words, with enough effort, they can narrow down the person who broadcast a transaction quite a lot.

Put the other way around, today's Bitcoin network is highly vulnerable to this kind of attack, so there is room for improvement on the privacy front. For example, if a protocol like Dandelion, which has a transaction broadcast publicly only a few nodes away from its origin, were introduced, surveillance using spy nodes would become less effective.

Your wallet can also be a major privacy risk

The term SPV came up above, but any Bitcoin wallet that isn't connected to your own Bitcoin node has given up on privacy from the outset, because it asks someone else's node for the balances of your addresses. Timing, source IP and all sorts of other metadata can then be used to link multiple addresses together.

Of course, unless you're doing something wrong, law enforcement is unlikely to come after you. But what if personal data including lists of withdrawal addresses leaked from an exchange, and data linking wallet addresses together ended up for sale on the dark web? You'd probably feel the risk had suddenly shot up. Privacy loss is irreversible: once information has leaked, there's no way to erase it.

Take this opportunity to point your wallet at your own Bitcoin node.

In Sparrow, the toggle in the bottom-right corner of the window turns green when connected to your own Bitcoin Core. If it's yellow, you're connected to a public Electrum server.

In Sparrow, a desktop wallet we recommend, you can choose an Electrum server or Bitcoin Core under Files>Settings>Server. To use Bitcoin Core running on a different machine, set the authentication method to User/Pass, and add rpcbind, rpcuser, rpcport, rpcallowip and server entries to the node's bitcoin.conf. You can find an example bitcoin.conf here.