MarsHut Page 1/5

wallbroadΑσφάλεια

3 Δεκ 2013 (πριν από 3 χρόνια και 8 μήνες)

75 εμφανίσεις

Tor and Bitcoin
Asked by
Bazyli Zygan
on 2013-07-30T08:01:39-04:00
Hi everyone,

We at Hive had plans to make our wallet proxy through Tor by default. When it became apparent
that this was not presently possible because bitcoinj lacks SOCKS support, it opened a minor
discussion suggesting that this is perhaps not advisable practice for SPV wallets in the first place.
To quote Mike Hearn:

While the scenario outlined seems unlikely, it's best to be prepared... What do you all think? How
can this be done properly?

As we said to Mike, if Thailand has actually made Bitcoin illegal, then packet filtering may not be far
off for certain regions, and it would nice to be proactive and prepared. At the moment, Thailand
already has cruder, URL-based filtering... But vendors like Cisco are no doubt constantly selling
them on the virtues of more advanced censorship technologies.

Gregory Maxwell is the person who wrote the hidden service support for bitcoind, right? It might be
interesting to get his comments here.

/b

grabhive.com (http://grabhive.com) | twitter.com/grabhive (http://twitter.com/grabhive) | gpg:
A1D5047E
Archives
Misc
BitCoin
Jul 30, 2013
Week 31, 2013
July, 2013
Year 2013
All Answers
Answer by
Mike Hearn
on 2013-07-30T08:41:53-04:00
Various ideas are possible:

* Use the Tor SOCKS proxy in such a way that it creates a guaranteed
independent circuit to a different exit node each time you connect. This
gets you back to the slightly stronger clearnet heuristic of "if I saw a
bunch of peers announce my tx, then it's probably valid". I don't know if
this is possible.

* Have a set of hard-coded long term stable hidden peers, that are run by
known community members who are not going to collaborate to defraud people.
Of course if they're run by people who are well known that rather defeats
the point of them being hidden, but you benefit from the fact that the
.onion names double as authentication tokens.

MarsHut
Page 1/5
Tor and Bitcoin
* Talk the Tor protocol directly and have the app explicitly pick its own
diverse set of exit nodes, one per p2p connection. This is likely to be
complicated. Last time I looked Tor doesn't provide any kind of library or
API.

I agree that it's a kind of theoretical attack right now, but then again,
I'm not aware of any countries that block Bitcoin either. The thing with
Thailand seems like it might be the result of some confusion over who
exactly can make laws in that country. I'd be more concerned about
Argentina, but we're a long way from ISPs searching for people to arrest by
looking for port 8333.

Supporting SOCKS (really: blocking sockets) would be a good thing anyway.
Using blocking sockets also means we'd get SSL support, so if at some point
Bitcoin nodes start supporting SSL we'd be able to use it more easily.
Answer by
Jeff Garzik
on 2013-07-30T10:01:56-04:00
This has been discussed on IRC, and would be interesting to explore.
For several applications, linking directly with a Tor library is far
superior to the fragility of requiring a properly configured external
process. Lacking such a Tor library right now, one must be written

Answer by
Wendell
on 2013-07-30T13:02:58-04:00
I suppose it isn't quite what you're talking about but we did push this out today:

Tor.framework, for Cocoa developers, similar to our BitcoinKit:
https://github.com/grabhive/Tor.framework

-wendell

grabhive.com | twitter.com/grabhive | gpg: 6C0C9411
Answer by
Bazyli Zygan
on 2013-07-30T13:20:54-04:00
Apparently that won't help. That's just embeding the existing tor code and rerouting internal Cocoa
internet communication via tors proxy.
What guys need is bigger configurability in tor itself. I can understand that. It's doable tough.

Gosh, why a day has only 24h? :)

/b

grabhive.com (http://grabhive.com) | twitter.com/grabhive (http://twitter.com/grabhive) | gpg:
A1D5047E
Answer by
Peter Todd
on 2013-07-30T14:30:43-04:00
There was a good reply to those concerns last time the issue came up:

Tor does not act as a particularly effective man in the middle for nodes
that support connections to hidden services because while your
MarsHut
Page 2/5
Tor and Bitcoin
connections to standard Bitcoin nodes go through your exit node, the
routing path for each hidden service peer is independent. Having said
that we should offer modes that send your self-generated transactions
out via Tor, while still maintaining non-Tor connections.

Anyway Sybil attacks aren't all that interesting if you are the one
sending the funds, and receivers are reasonably well protected simply
because generating false confirmations is extremely expensive and very
difficult to do quickly. After all, you always make the assumption that
nearly all hashing power in existence is honest when you talk about
replace-by-fee among other things, and that assumption naturally leads
to the conclusion that generating false confirmations with a sybil
attack would take more than long enough that the user would be
suspicious that something was wrong long before being defrauded.

I'd be surprised if anyone has ever bothered with a false confirmation
sybil attack. I wouldn't be the slightest bit surprised if the NSA is
recording all the Bitcoin traffic they can for future analysis to find
true transaction origins. Which reminds me, again, we need node-to-node
connections to be encrypted to at least protect against network-wide
passive sniffiing.

Regarding usage I would be interested to hear from those running Bitcoin
nodes advertising themselves as hidden services.
-http://www.mail-archive.com/bitcoin-development [ at ] lists.sourceforge.net/msg02438.html

tl;dr: Users should be using Tor to preserve their privacy and the MITM
risks are minimal to anyone using Bitcoin correctly. (don't trust
zero-conf transactions, they are not secure!)

Yeah, he had the idea of adding .onion addresses of seed nodes
along-side the DNS seeds table; that would give an end-to-end MITM-proof
channel to a trusted seed who can in turn give an honest view of the
network.

Ideally those .onion addresses would be of nodes run by the same people
as running the existing seeds so that it was clear who was being trusted
- I'll write a patch to do this soon with a .onion testnet seed first.
(I run one of the testnet DNSSEED seeds and have a small grant from the
foundation to do so)

Bitcoin relays .onion addresses over the P2P network, so once you are
connected you can gain additional peers with addresses that are MITM
resistant. Currently there isn't any equivalent to the (weak) anti-sybil
properties of IP address range diversity for .onion's, but in the future
we'll eventually add node identities and some way to make creating lots
of fake identities for a sybil attack expensive.
Answer by
Wendell
on 2013-07-30T15:36:50-04:00
Thank you Peter.
MarsHut
Page 3/5
Tor and Bitcoin

Does this advice apply equally to both full and SPV nodes? At this point I'm merely curious, since
we don't have the option to run bitcoinj over Tor right now anyway.

-wendell

grabhive.com | twitter.com/grabhive | gpg: 6C0C9411
Answer by
Peter Todd
on 2013-07-30T16:11:41-04:00
Yes, although remember that in general SPV nodes are significantly less
safe because they depend soley on confirmations for security; it's often
not appreciated that an attacker can target multiple SPV-using entities
at once by creating a invalid block header with any number of completely
fake payments linked to it; if you can attack n targets at once, the
cost to perform the attack is n times less per target.

Unrelated to Tor, but an interesting possibility to improve SPV security
is to ask for the history of a given txout - that is the previous
transactions that funded it. You could even do this with a
zero-knowledge proof, sampling some subset of the prior transactions to
detect fraud. Unfortunately none of the infrastructure is setup to do
this, and txid's aren't constructed in ways that make these kinds of
proofs cheap. (you really want a merkle tree over the txin and txout
sets)

Work thinking about for the future in any case - the above can be
implemented as a soft-fork.
Answer by
Peter Todd
on 2013-07-30T16:12:50-04:00
s/zero-knowledge/non-interactive/
Tagged
Advanced Censorship Technologies
Bitcoin Illegal
Grabhive
Interesting
Proactive
Related
ecash and revocability
is there a way to do bitcoin-staging?
txtool: Advanced transaction building and fun
Introducing BitcoinKit.framework
Two factor wallet with one-time-passwords
Safe auto-updating
Bloom io attack effectiveness
CoinWitness: Really Really ultimate blockchain compression
Social network integration (brainstorm)
MarsHut
Page 4/5
Tor and Bitcoin
Simple contacts exchange (was: Social network integration (brainstorm))
View Online
http://www.marshut.com/spkpp/tor-and-bitcoin.html
MarsHut
Page 5/5