fedimint / fedimint

Federated E-Cash Mint
https://fedimint.org/
MIT License
536 stars 210 forks source link

Client should connect to federation via Tor #391

Closed elsirion closed 11 months ago

elsirion commented 1 year ago

For the e-cash system to provide the privacy guarantees it's capable of, user clients need to connect to the federation via Tor. They also need to open a new connection for each operation. This will require multiple changes:

justinmoon commented 1 year ago

After some initial investigation it doesn't seems jsonrpsee has any built-in support fox socks proxies, but I made an issue to ask for sure.

jkitman commented 1 year ago

If Arti isn't ready, will we need to run Tor as a separate process and use a Tor controller like https://github.com/teawithsand/torut ?

justinmoon commented 1 year ago

If Arti isn't ready, will we need to run Tor as a separate process and use a Tor controller like https://github.com/teawithsand/torut ?

That won't work on iOS because everything has to run in 1 process. For iOS we'll need something like libtor to spawn tor in our process

elsirion commented 1 year ago

@justinmoon the two aren't mutually exclusive. We will need libtor to start our tor daemon and something like torut to control it (e.g. create new cirucit for each operation).

justinmoon commented 1 year ago

it doesn't seems jsonrpsee has any built-in support fox socks proxies

Just did a little research on prior art etc:

elsirion commented 1 year ago

Turns out it's actually trivial to implement SOCKS support for jsonrpsee: https://github.com/elsirion/jsonrpsee/commit/8ec1b4a87de4d9f0b2eebef67f06fb5754c8c414

I'd like to test it for our use case though before upstreaming. Local testing looks good so far though.

maan2003 commented 1 year ago

What are opinions about using arti now that it is ready for production use (according to the developers)?

I am in favor of starting with arti and later implementing main tor client. Just because better docs will make it easier.

@elsirion

justinmoon commented 1 year ago

@Maan2003: Does Arti implement a Tor client? Last I checked it was more focused on server side https://github.com/fedimint/fedimint/issues/15#issuecomment-1236230824.

maan2003 commented 1 year ago

Yes it does https://docs.rs/arti-client

UPD: ah, it does not supporting hidden services.

maan2003 commented 1 year ago

Arti: missing features like on-demand circuit switching, general instability

update: circuit switching is now supported using IsolationToken

justinmoon commented 1 year ago

What are opinions about using arti

I think we would all prefer to use arti if possible.

elsirion commented 1 year ago
maan2003 commented 1 year ago

arti also has hyper connector so the integration should be similar enough.

V1C70RYG0D commented 1 year ago

i want to contribute in this project , can anyone tell me what resources i should follow for this apart from the one given in SOB23 website , i am trying to cover them and building understanding of Fedimint. Thanks !

maan2003 commented 1 year ago

unassigning myself, because this is a SOB idea now.

flipchan commented 10 months ago

@justinmoon did this issue get solved? was proxy connections made possible with Jsonrpsee? I'm facing the same issue rn

elsirion commented 10 months ago

This issue was about server-server communication via Tor, which is no longer a priority, at least in the near future. The jsonrpsee work you are referring to is for server-client communication and wasn't investigated further, but afaik it worked. We are now focusing on using arti for that instead of an external Tor daemon via SOCKS though, see #2610.