Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Client should connect to federation via Tor #391

Closed
elsirion opened this issue Aug 16, 2022 · 17 comments
Closed

Client should connect to federation via Tor #391

elsirion opened this issue Aug 16, 2022 · 17 comments
Labels

Comments

@elsirion
Copy link
Contributor

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:

  • Connect websockets on-demand and introduce a notion of "sessions"
    • The session is opened to do one atomic operation from the user's perspective
    • The client makes all the necessary API calls that are linkable anyway
    • The session is closed
  • Create a (potentially external/definitely new crate) implementation of FederationApi that uses Tor and maybe even bundles Tor (e.g. to run on Apple mobile devices)
@justinmoon
Copy link
Contributor

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
Copy link
Contributor

jkitman commented Sep 15, 2022

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
Copy link
Contributor

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
Copy link
Contributor Author

@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
Copy link
Contributor

justinmoon commented Oct 27, 2022

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

Just did a little research on prior art etc:

@elsirion
Copy link
Contributor Author

elsirion commented Nov 3, 2022

Turns out it's actually trivial to implement SOCKS support for jsonrpsee: elsirion/jsonrpsee@8ec1b4a

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

@maan2003
Copy link
Member

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
Copy link
Contributor

justinmoon commented Jan 22, 2023

@maan2003: Does Arti implement a Tor client? Last I checked it was more focused on server side #15 (comment).

@maan2003
Copy link
Member

maan2003 commented Jan 22, 2023

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

UPD: ah, it does not supporting hidden services.

@maan2003
Copy link
Member

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

update: circuit switching is now supported using IsolationToken

@justinmoon
Copy link
Contributor

What are opinions about using arti

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

@elsirion
Copy link
Contributor Author

  • We don't necessarily need hidden services at first. Right now all setups are Static IP+DNS+Let's Encrypt, that would work with arti+stream separation.
  • How easy is arti to integrate with our JSONRpc library? I have a prototype for SOCKS5, that was rather straight forward. Before deciding we should build a PoC for that.

@maan2003
Copy link
Member

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

@V1C70RYG0D
Copy link

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 maan2003 removed their assignment Mar 30, 2023
@maan2003
Copy link
Member

unassigning myself, because this is a SOB idea now.

@flipchan
Copy link

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

@elsirion
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Status: Implementation
Development

No branches or pull requests

6 participants