About
## The problem it solves
A light wallet does not keep the Bitcoin chain. It keeps the keys, builds addresses, and asks a server if those addresses have coins. Electrum does this, and other apps speak the same protocol too. The client usually holds about ten of those connections. One of them is the main server, which is the one the wallet asks about its coins. Electrum's FAQ says this main learns the address set and the history. But every connected server still sees the client IP, or the IP of the proxy or Tor hop in front of it. Keys stay on the device, and that trade is on purpose. You get a fast start and a good UX, but you already lose some privacy before any coin moves. So I asked myself whether you can tighten that path, and what an attacker can really see right now and do with that information.
So how does an Electrum client pick the ten connections right now?
A new install starts from a hardcoded list inside the app. Then the main hands out more servers it knows. To stay off ten machines in the same spot, the wallet groups by the first two numbers of the IP, a `/16` on IPv4 and a `/48` on IPv6. Different first two numbers means two IP ranges. That used to track operators pretty well. But one hosting company can hold many of those ranges now. So ten IP ranges can still be a handful of companies, and the wallet will not see it. Then one operator sees the whole session, not ten separate ones.
Bitcoin Core already has a fix for this problem on its own peers. Core has ASMap, a file built with Kartograf (https://github.com/asmap/kartograf) that maps an IP to the network that actually carries it, the AS (Autonomous System), and it can spread those peers with that. So if an attacker only sits in one of those AS, they can usually take one outbound slot, not the rest. That makes an eclipse of those peers harder once the map is in use.
So I asked myself whether you could use that same map on light wallets and Electrum servers, to spread those ten connections across more ASs. Because anyone can run an Electrum server and if a wallet picks you as main, you already see the addresses. That is how Electrum works, and this project does not hide those queries. But what the old `/16` rule misses is the rest of the path. If many of the ten slots sit in one AS, one operator can hold the main and several of the other nine at once. Then they get the address set, plus the IP, plus timing across those connections, which is enough to tie that address set to one session on that IP. So a watcher on that same network who does not run those servers still sees which hosts that IP called and when. They do not read the Electrum messages while TLS holds. Spread the ten across different network operators and one no longer gets that whole session.
And the thing is, you do not even need to break into a datacenter for that. Rent a few servers right now at the same host in different `/16`s, and the wallet still treats them as spread out. That also gets you picked as main more often, without being lucky. Also, you do not need all ten. A few extra slots next to the main is already more than one honest server would see. And a vendor default can skip the roll entirely and send every unchanged install to one company's machines.
Early ideas to solve that problem already exist (https://github.com/spesmilo/electrum/issues/10583 and https://github.com/payjoin/rust-payjoin/issues/919). But these are still sketches, not something wallets actually ship and those patches would change who the wallet dials.
So this project takes that `asmap.dat` and runs a fresh Electrum start many times, once under the current rule and once under ASMap. Then it puts on the screen what that attacker gets to see, and that under ASMap those ten spread, so one AS no longer sees the whole session. That is the proof for the problem described above. This project does not patch the wallet or hide the queries. It shows that the same map Core already uses would tighten this path too.
## Challenges we ran into
nothing yet
Team
From the public Devfolio project page. Votes, swipes and the judge score are hackfeed's own.






