# Deanonymizing Bitcoin Transactions via Network Traffic Analysis with Semi-supervised Learning

Crypto.world

> Bitcoin addresses are pseudonymous, but the network layer leaks information: when a node creates a transaction it broadcasts it differently from transactions it merely relays, and an adversary who…

**arXiv**: 2603.17261

**Published**: 2026-03-18

**Authors**: Shihan Zhang, Bing Han, Chuanyong Tian, Ruisheng Shi, Lina Lan, Qin Wang

## AI summary

Deanonymizing Bitcoin Transactions via Network Traffic Analysis with Semi-supervised Learning

## Overview

**Research area:** Blockchain privacy and network-layer security — specifically deanonymization attacks on Bitcoin's peer-to-peer (P2P) network using traffic analysis combined with machine learning.

**Technical level:** Intermediate. Readers benefit from familiarity with Bitcoin's P2P message types (`Inv`, `Getdata`, `Tx`), the transaction diffusion mechanism, and basic anomaly-detection terminology. The machine-learning pipeline itself is explained step by step.

**Scope (one sentence):** The paper proposes NTSSL and NTSSL+, two semi-supervised learning methods that use probe-node traffic captures to identify which transactions a target Bitcoin full node originated rather than merely forwarded, and evaluates them on the live Bitcoin mainnet and testnet against the PERIMETER baseline.

## What This Paper Is About

Bitcoin addresses are pseudonymous, but the network layer leaks information: when a node creates a transaction it broadcasts it differently from transactions it merely relays, and an adversary who can observe that node's connections can try to tell the two apart. Earlier work (PERIMETER, the baseline here) used machine learning for this but reported low precision, and passive interception is increasingly hampered by encrypted P2P transport (the paper notes Bitcoin Core v27.1 enables it by default). The goal of this paper is to build a higher-precision, lower-barrier deanonymization method that works even when an ordinary attacker controls only a fraction of a target node's incoming connections, and that adds a transaction-layer clustering step to correct the network-layer classifier's mistakes.

## Key Contributions

1. **NTSSL**, a semi-supervised deanonymization algorithm ("Network Traffic Analysis via Semi-Supervised Learning"). It combines three unsupervised anomaly detectors (Isolation Forest, Auto Encoder, One-Class SVM) to generate high-confidence pseudo-labels, then expands the labeled set via oversampling and anomaly-score thresholds, and finally trains an XGBoost classifier on a five-dimensional feature vector: `[Send_inv_n, Recv_getdata_n, Recv_getdata_n/Send_inv_n, Recv_getdata_n+Send_inv_n, Score]`.
2. **NTSSL+**, a cross-layer extension that applies multi-input-heuristic transaction clustering on-chain, then uses cluster-majority voting to reclassify the network-layer classifier's false positives and false negatives.
3. **A practical, probe-based traffic collection method** that requires no Autonomous System (AS)-level adversary. Because a Bitcoin node accepts at most 114 incoming connections, an attacker theoretically needs only 114 probe nodes — and full coverage is not required, since effectiveness scales with the proportion of connections controlled.
4. **A live-network evaluation** on Bitcoin mainnet and testnet showing NTSSL reaches an F1-score between 0.50 and 0.74 across interception levels, with NTSSL+ adding a further 20% to 40% improvement, and a claim of up to 1.6 times better performance than the existing machine-learning-based approach.

## Main Findings

- **PERIMETER baseline is weak even under ideal conditions:** At 100% interception of the target node's connections, PERIMETER achieves recall and precision both around 53%, for an F1-score of 0.53. The authors note its false positive rate stays low simply because negative samples dominate, so they treat F1-score as the primary metric.
- **NTSSL at 100% interception:** Of 78 transactions flagged as node-originated, 61 were genuinely originating and 17 were forwarded transactions misclassified — giving recall 70.2%, precision 79%, and F1-score 0.74.
- **NTSSL degrades gracefully with partial control:** With only 25% of the target node's incoming connections, NTSSL still reaches recall 56.8%, precision 49.8%, and F1-score 0.50.
- **NTSSL+ corrects both error types:** The clustering step found 18 false negatives and 2 false positives at 100% interception; 19 and 3 at 75%; 18 and 4 at 50%; and 16 and 9 at 25%.
- **NTSSL+ at the weakest attacker level:** With 25% of connections, cross-layer collaborative analysis achieves F1-score 0.64, versus 0.50 for NTSSL alone and 0.40 for the unsupervised learning-based method under the same condition.
- **Comparison headline:** At 25% connection control, NTSSL is about a 1.25-fold improvement over the unsupervised learning-based deanonymization solution, while NTSSL+ delivers a 1.6-fold improvement. The abstract states the overall result as "1.6 times better than the existing approach using machine learning."
- **Clustering scale on the dataset:** Transaction clustering produced 12,413 clusters in total, with the largest containing 97 transactions; the top-10 cluster sizes reported are 97, 70, 48, 47, 39, 38, 37, 35, 31, and 26.
- **Dataset scale:** The single-node mainnet capture contains roughly 15K transactions, of which roughly 90 originated from the target node. In the multi-node testnet deployments each node contributes roughly 4.5K to 8K transactions for training and 3.8K to 6.9K for testing, with 40 originating transactions per dataset; mainnet per-capture volumes span roughly 5.8K to 54K transactions, with 20 to 44 originating transactions per node.
- **Why the features work:** Nodes broadcast their own transactions to more peers than forwarded ones (motivating `Send_inv_n`), peers are more likely to send `Getdata` for a transaction they have not seen (motivating `Recv_getdata_n`), and diffusion's random delays mean originating transactions have a higher request-to-broadcast ratio. Broadcast time is deliberately excluded because the diffusion mechanism randomizes it.

## Methodology in Plain English

**Step 1 — Collect the traffic.** The attacker runs a set of ordinary-looking probe nodes that connect *inbound* to a target full node with a public IP address. By occupying incoming connection slots, the probes see everything the target sends them. The paper uses Wireshark to capture all active connections of self-deployed nodes and then randomly subsamples 25%, 50%, 75%, or 100% of those connections to simulate weaker and stronger attackers.

**Step 2 — Turn traffic into numbers.** For each transaction hash, the researchers count how many `Inv` announcements the target sent and how many `Getdata` requests it received, and derive a ratio and a sum, producing a four-number description of each transaction.

**Step 3 — Let three detectors agree before trusting a label.** Because labels are expensive, three unsupervised anomaly detectors (Isolation Forest, Auto Encoder, One-Class SVM) each flag suspicious transactions. Only transactions flagged by *all three* — the intersection — are treated as confident positives. This is the "semi-supervised" trick: a small trustworthy seed set instead of a fully labeled dataset.

**Step 4 — Grow the label set carefully.** To fix class imbalance, the data is oversampled using unsupervised representation learning. A transaction is added as a positive only if its anomaly score, its `Send_inv_n`, and its `Recv_getdata_n` are each at least as high as the lowest values among the confident positives.

**Step 5 — Add the anomaly score as a feature.** The Isolation Forest score becomes a fifth input dimension, and XGBoost is trained as the final supervised classifier for the originating-vs-forwarded decision.

**Step 6 — Fix the classifier's mistakes with on-chain clustering (NTSSL+).** On the blockchain side, the authors filter out common mixing transactions, apply the standard multi-input heuristic to group addresses belonging to one wallet, then split those wallet clusters by time window — the idea being that transactions a wallet emits close together likely entered the network through the same full node. If most transactions in a cluster were labeled originating, the outlier labels of "forwarded" are flipped, and vice versa. This raises recall and cuts false positives.

**Validation discipline:** The unsupervised detector was run five times and averaged; 5-fold cross-validation was used for NTSSL. All experiments used only the authors' own nodes, acting as protocol-compliant, semi-honest peers, to avoid injecting unwanted traffic into Bitcoin.

## Why This Matters

**Impact on research.** The paper argues that deanonymization at the network layer exposes more directly sensitive information than transaction-layer address clustering, and that the barrier to mounting such an attack is lower than assumed — no AS-level passive adversary is required, only a set of cheap probe nodes. It also introduces cross-layer collaboration (transaction clustering feeding back into network-layer classification) as a general technique, and reports that a supervised-only model trained on one node generalizes poorly across nodes, which motivates the semi-supervised design.

**Real-world applications (as implications of the findings, not endorsements):**

- **Privacy risk assessment for wallet and node operators** — quantifying how much exposure comes from unencrypted light-wallet connections, which the paper notes are typically direct to full nodes and unencrypted (contrasted with Electrum's SSL/TLS server architecture).
- **Blockchain forensics and regulatory tracing** — linking on-chain activity to the IP address of the node that first broadcast a transaction.
- **Exchange and custody threat modeling** — assessing whether an adversary occupying a fraction of a node's inbound slots can attribute payouts to that organization.
- **Network-hardening evaluation** — measuring how much the diffusion mechanism's random delays (`λ_out = 2.5` seconds for outbound, `λ_in = 5` seconds for inbound) actually protect users.

**Industry relevance.** Bitcoin Core is described as powering over 95% of the network's full nodes, so any weakness in its default broadcast behavior has network-wide reach. The paper explicitly frames encrypted P2P transport (default from Bitcoin Core v27.1) as a threat to passive monitoring and claims its active probe approach "bypasses" it — a claim infrastructure operators and protocol developers will want to scrutinize.

## Future Directions

- **Exploiting transaction forwarding time.** The authors deliberately excluded broadcast timing from the feature vector because diffusion randomizes it, but explicitly list investigating how to leverage forwarding time as future work.
- **Improving cross-node generalization.** The multi-node experiments show a supervised XGBoost model trained on the original four features performs poorly across different nodes on both testnet and mainnet, which is precisely the gap the semi-supervised pipeline is meant to fill — leaving room to make the model transferable across heterogeneous deployments.
- **Strengthening correction beyond majority voting.** NTSSL+ corrects labels by cluster majority; with 12,413 clusters and a largest cluster of only 97 transactions, most clusters are small, so better cluster-level inference (and better handling of mixing transactions excluded by the pre-filter) is an open engineering question.
- **Adapting to encrypted transport and evolving diffusion parameters.** The paper positions its approach as compatible with the diffusion mechanism and unaffected by encrypted P2P transport; independently verifying how robust the feature set remains as transport encryption and delay parameters change is a natural next step, along with the countermeasures the paper proposes in its Section VI.

## Target Audience

Blockchain privacy and deanonymization researchers; network-security researchers studying P2P traffic analysis and side channels; machine-learning practitioners applying semi-supervised and anomaly-detection methods to security data; Bitcoin Core and wallet developers who need to understand what an adversary with a modest number of probe nodes can infer; and exchange or custodial-service security teams performing threat modeling on their own nodes. Readers seeking a first introduction to Bitcoin internals will find the background section useful but should expect Intermediate-level prerequisite knowledge.

## Authors’ abstract

Privacy protection mechanisms are a fundamental aspect of security in cryptocurrency systems, particularly in decentralized networks such as Bitcoin. Although Bitcoin addresses are not directly associated with real-world identities, this does not fully guarantee user privacy. Various deanonymization solutions have been proposed, with network layer deanonymization attacks being especially prominent. However, existing approaches often exhibit limitations such as low precision.…

[The full abstract on arXiv](https://arxiv.org/abs/2603.17261)

[Read the original paper](https://arxiv.org/abs/2603.17261)

---

Canonical: https://crypto.world/paper/deanonymizing-bitcoin-transactions-via-network-traffic-analysis-with-2603.17261
