-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Anonymous Homeservers (Tor/I2P) #7088
Description
Intro
Several people in the Matrix community, including myself, would love to see anonymous homeservers. It didn't seem appropriate to use either of the other I2P or Tor threads, since both had some awesome points by awesome people (looking at you @richvdh @cyphar @vsatmydynipnet @Ekleog @ara4n). Big thanks to @ara4n for giving this a proofread before I posted!
Why this Tor/I2P thread
It seemed appropriate to start a new thread (and lock) for the following reasons and with the following hopes:
- Create a central thread for the discussion of Tor/I2P homeservers and DNS-addressed homeservers that federate to Tor/I2P homeservers, merging the I2P homeserver thread [Feature] Support i2p #5455 with the two Tor homeserver threads Support routing .onion traffic over tor #5152 and Support Tor-hidden homeservers #2111 (as each thread contained at least some useful and non-duplicate information that I have tried to consolidate in this post). Both protocols could theoretically be implemented, but for the sake of anonymous homeservers, we should just pick one.
- Come to a community decision about which anonymity network to use for homeservers and for what reasons
- Create a roadmap and/or tickets that I and other community members can start working on
Since this is a large post on a new thread that discusses several steps that are dependent on the previous, for the sake of organization it will probably make sense to break this into smaller threads over time, rename threads, and/or move stuff to a wiki or something.
Tor or I2P?
Here is an excellent and pretty unbiased post comparing Tor and I2P from I2P’s website: https://geti2p.net/en/comparison/tor
(Summarized from above link):
Benefits of Tor over I2P
- Bigger user base, significant funding
- Has already addressed some scaling issues I2P has yet to address
- More resistant to state-level blocking due to Pluggable Transports
- More efficient memory usage
- Tor client nodes have very low bandwidth overhead
- SOCKS is (probably) easier to build with than I2P's API
- Designed and optimized for exit traffic, with a large number of exit nodes (possibly faster to federate to DNS-addressed HSs)
Written in C, while I2P is Java(EDIT: I found a C++ implementation of I2P (https://github.com/PurpleI2P/i2pd))
Benefits of I2P over Tor
- Designed and optimized for hidden services, which are much faster than Tor (how much faster?)
- UDP support instead of just TCP (QUIC, CoAP)
- Although I don't expect there to be many audio/video transmissions from anonymous Matrix users, receiving them could be nice).
- Could we see coap-proxy get some love here? How much slower would it be with TCP as transport?
- I2P's APIs are designed specifically for anonymity and security, while SOCKS is designed for functionality.
- Fully distributed and self organizing nodes
- P2P friendly
- Packet switched instead of circuit switched
I am no expert in network protocols and I don't want to provide an ill-equip opinion, but it seems that Tor HSs would be easier to implement, while I2P HSs appear more 'proper'.
UX and Federation Behavior
I thought it would be useful to include expected behavior in this discussion. This and everything below this will be split into a separate thread with more details after decision on Tor or I2P.
UX (Client)
In a perfect world, I would think we would want the following behavior to apply (I will use terms 'Tor/I2P HSs' and 'DNS-addressed HSs' to describe homeservers that end in .onion/.i2p and in .com/etc for lack of better terminology):
- Tor/I2P HSs and DNS-addressed HSs should be able to participate in the same rooms and federate to each other (I can ping @matthew:matrix.org and @somefella:sdfasdfdfd.i2p/.onion in the same message without having to do anything special).
Behind the scenes (Server)
- Having a HS that does not support federating to Tor/I2P HSs should not break anything.
- How would we handle legacy HSs that don't support specifying a Tor/I2P client? Would adding a bridge to the room solve catching Tor/I2P servers up or would it be cleaner to do a breaking server update during a big release? interesting comment related to this by @OlegGirko on Homeservers don't catch up with missed traffic until someone sends another event #2528 )
- In a perfect world, we would have every HS running a Tor/I2P client, providing native federation to all HS types. I don't think this should be a requirement as this will probably induce non-insignificant overhead, but we should include a server config entry to just specify an external relay (ie IP/port of a Tor SOCKS5 proxy). Maybe include native Tor/I2P client in the stable Dendrite release? Food for thought, I'm just dreaming here.
- Tor/I2P HSs would have to route all their requests through Tor/I2P while DNS-addressed HSs would split where they route outgoing packets.
@richvdh in #2111 recognized that for both types of HSs to federate to each other, it may be easiest to propose a change to the Matrix specification (specifically 'raising an MSC in the matrix-doc'). See post for context.
Depending on the expected future support of Synapse and with the building of Dendrite, would it make sense to skip building this for Synapse and just implement this for Dendrite?
Next steps
I hope this post finds the community well and brings some organization to the awesome discussions started around Tor/I2P homeservers. What should we start with? Tor or I2P?