node-Tor - Javascript implementation of the Tor protocol

Hi Ayms,

Welcome to the forums! :slight_smile:

Sorry I am a bit late to the party on this. I am currently working on Zephyr a browser based plugin for zcash.

We are using react-js - just wondering what would be the advantage of our project using node-tor integration over out project running as a plugin in The Tor Browser bundle?

So is the use case

  • I am on the clearnet
  • Wants to send zec, but doesnt want to potentially leak any metadata.
  • Does not have access to TOR.
  • Load Zephyr (our WASM + React Plugin)
  • Connects to node-tor
  • Tell Zephyr to use node-tor over default?
  • Connect to remote daemon on the Clearnet? or on Tor? via node-tor.
  • Blazesync and send.

and the inverse i guess, where i am already on tor but wanted to use node-tor. am I missing anything?

I mean, sure this functionality could be kinda cool. I need to read everything again a few times before i really get whats being suggested and how it would work with us.

On a tangential note:-

When was the last time node-tor got a security audit? are the results public? I am interested in how they control memory / file access. browsers are very bad at leaving artefacts where they are not supposed to be. both on disk and in memory.

Kind regards,
Steve

3 Likes

We are using react-js - just wondering what would be the advantage of our project using node-tor integration over out project running as a plugin in The Tor Browser bundle?

Simple answer: not to use the Tor Browser bundle (or force users to do so), and control what you are doing as stated above, I really think that non browsing projects should leave the Tor Browser alone and let it do what it is designed for

Paradoxically node-Tor inside browsers can do whatever you like, except browsing, because, while still possible, itā€™s not part of the use cases and we have the Tor Browser for this

node-Tor is designed to anonymize webapps and js compatible modules, inside browsers and servers

Loads Zephyr Connect to node-Tor

You donā€™t ā€œconnectā€ to node-Tor, you just embed the code with Zephyr and pipe into it

Connect to remote daemon on the Clearnet? or on Tor? via node-tor.

What do you mean? The anonymized circuits are created directly from/inside the browser

and the inverse i guess, where i am already on tor but wanted to use node-tor

Not sure what you want to do here, you can use node-Tor nodes and/or RDV nodes and/or browser nodes as described above again

When was the last time node-tor got a security audit? are the results public? I am interested in how they control memory / file access. browsers are very bad at leaving artefacts where they are not supposed to be. both on disk and in memory.

Phase 3 was funded by NLNet under a EU H-2020 grant in 2019, and node-Tor had a quick ROS security review, I could link something here if necessary but have to find back the links (public NLnet discord), the outcome was (coming back to the beginning of this post) that people should not misunderstand the project with browsing and for example reinject an anonymously downloaded web page with node-Tor inside the browser

I know that many people are very skeptical about js, I am not aware of disks/memory flaws, except if you code like a complete beginner, I have documented what could be possible issues with node-Tor here GitHub - Ayms/node-Tor: Javascript implementation of the Tor (or Tor like) anonymizer project (The Onion Router) but at the end I donā€™t see any, and specific settings here GitHub - Ayms/node-Tor: Javascript implementation of the Tor (or Tor like) anonymizer project (The Onion Router)

THE big issue for me with js is to be sure about the code loaded, see a solution here https://peersm.com/wallets (module from myself also)

Then coming back againg to the beginning of this post, thatā€™s why the code must be embedded, and thatā€™s why also node-Tor has zero dependencies

And quoting some previous comments, if you want something usable by normal people, then it must be available in normal browsers (ie not the Tor Browser)

2 Likes

I forgot a bit about it, but you can look at this Peersm demo using node-Tor Anonymous peer to peer download inside browsers and distributed database inside browsers - YouTube

And at the time it was bridging with bittorrent node-Tor/streaming-deprecated at master Ā· Ayms/node-Tor Ā· GitHub the code was too fast inside browsers, so overloading them, then I had to slow down the bridges despite of (complicate) flow control inside browsers and anonymized circuits from it

All of this was some years ago as you can see, then imagine today

I am sorry if this has been asked and answered before, but I am just about to go to sleep and I wanted to post this now.

If you get this grant from the ZFND - who owns the sourcecode? the ZFND? or NLnet and the EU Commission?

It is still listed as ā€˜currentā€™ under projects.

Because it would seem somebody else already is?

Has this been tested against the OWSAP by professionals? - Are those reports public? if it hasnt thats fine, but zephyr will be, so this might be an issue.

We are writing a browser plug in with potentially many different transport options, most handled by the browser.

I really do need sleep I will get back to the technical aspects of the proposal and how I see it interacting with our project and maybe with the wider zcash ecosystem. I would appreciate it if you could clear up the confusion over grants stuff. I really dont understand how they work, like can you have two with the zfnd license? @shawn @aiyadt both of you know it better than most

Cheers,

Steve

1 Like

Sorry if there is some confusion but donā€™t worry everything is square

The code is owned by myself (ie my company) and is released open source, despite of previous funding EU or NLnet do not own anything but the requirement is to release everything open source, and this will continue like this with other grants like potential zcash one

Like other grants it will go to my company NaĆÆs - Informatique & Telecom, which is a well established company in France, recognized as an independant research entity with good standing

Nobody else is funding the project right now, some proposals were sent but for example NLnet must distribute the EU funding and I already got two grants (node-Tor and bitcoin-transactions), but the project is still tagged as ā€œcurrentā€ since they can decide to remind it at some point of and time and fund it, but I think itā€™s unlikely, and of course I will not request several grants for the same work (please remember that I did fund this project 99% myself)

The project has been quickly audited by ROS, the results are on the ROS discord, apparently you must register to access it, let me check this

Anyway, I am an expert myself and quite confident that there are no vulnerabilities in node-Tor, the only potential issue I see is the prng (as written in the git repo, look for ā€œprngā€ in the README), see Vulnerabilities in Numerous Javascript Cryptographic Libraries - BitcoinTechWeekly.com which is the summary of a bitcoin-dev thread where I commented about the history of the js prng (look for Aymeric in the article)

For an example of integration, you can see the Peersm demo:

Simple, but of course you can integrate node-Tor the way you like, and itā€™s better to embed browser.js rather than loading it, here itā€™s just a demo not focusing on the security aspects

Follow up on ROS, apparently the ROS discord/forum looks to be completely dead and not referencing any project any longer, anyway the outcome was the one I gave, not super disruptive for an audit but they did not find anything else

I canā€™t think of use cases where a pure JavaScript implementation of the Tor protocol would be needed rather than having Node.js/Electron/React Native bindings/bridge to the Tor daemon. Iā€™ve only had a quick look through the project though and am not very familiar with the Tor/SOCKS pipeline. Using Tor inside a browser sounds a bit dangerous considering the risks with XSS, etc. If browser support is needed (e.g. browser extensions), then I feel that a Tor Arti wasm build would likely be the past path for this, once that is available.

Tor support for Node.js environments such as Electron.js or React Native Zcash apps would definitely be great and something Iā€™d be keen to experiment with and support with Elemental Zcash in the future.

A quick look is generally not enough to understand the projectā€¦

node-Tor is a nodejs module, works inside browsers and nodejs environment of course

The use cases are numerous, please see some examples here GitHub - Ayms/node-Tor: Javascript implementation of the Tor (or Tor like) anonymizer project (The Onion Router) and Convergence-2020, one of them is to use browsers as Tor nodes, which is different from Snowflake where browsers just relay the messages, node-Tor creates Tor circuits from the browsers directly

You can package node-Tor as Electron for example or as a browser extension but I donā€™t see the point of bridging with the Tor daemon, neither the use of a SOCKS proxy which is dangerous, see bitcoin CVE-2017-18350

It must be understood that the js node-Tor inside browsers do not browse as explained above, do not interact with a web server, itā€™s an independant and secure webapp inside browsers with zero dependencies, everything is embedded in a single js code, therefore known web vulnerabilities like XSS, WebRTC deanonymization, etc do not apply, the only important thing is to be sure about the code loaded as explained above again (Discover and move your coins by yourself), you can also include the code as a bookmarklet and run it just clicking on a button in the browser tab so nothing is loaded from the outside

I donā€™t know for the Arti wasm but I am still super skeptical that this will work correctly (or even that they will succeed to do it) and will not use SOCKS to bridge with a non browser daemon, and that this will be optimized for browsers, and that this will give the level of control that provides node-Tor

3 Likes

Trying here to address some concerns raised in the latest grant meeting

Yes it is highly technical, difficult to make something complicate simple, now I have tried not to overload this thread with plenty of links so it remains understandable, because there are many others, I know people canā€™t be experts everywhere, including myself

I donā€™t know what the Tor project thinks about the project neither if itā€™s a good idea to ask them, neither if they understand the techno, what is sure is that things always worked one way with them, ie they ask when they need something see TLS error when connecting to node-Tor bridge Ā· Issue #2 Ā· Ayms/node-Tor Ā· GitHub and are happy to receive bug reports but the reverse does not apply, or at least did not apply so far

Arti will most likely end-up with a Tor network like stuff, including inside browsers if they succeed, which I consider is not adapted for p2p networks as previously explained

Thatā€™s why node-Tor is interesting for zcash but not only of course, I would make the same comment than for IPFS node-Tor is now open source in clear and modular Ā· Issue #439 Ā· ipfs/ipfs Ā· GitHub , despite of all the privacy aspects for zcash, we are missing ā€œzcash is anonymousā€

Can you put in simple terms how & where node-tor is going to be useful? Who is going to use it? This will help audience realize the value

5 Likes

I am not sure to understand how to answer this, since I gave already plenty of use cases, node-Tor allows you to anonymize whatever app independently of the Tor network, which is not designed for this, the common belief of ā€œthis is what we have today then letā€™s use it because we have no other choiceā€ is not accurate and dangerous

I donā€™t think Arti will change anything here

Who is going to use it: everybody, from normal browsers or any platform

There are thousands of ways to package/integrate node-Tor, phase 4 (funding request) is where it becomes easy

I donā€™t know what I can say moreā€¦

Thanks for taking the time to write-up and share your grant proposal. I am on the Zcash Community Grants committee and had some questions and comments.

  1. You mention in a reply ā€œThe Tor network is designed to be used with the Tor Browser, is quite small and centralized, with many features that do not apply to p2p networksā€. You also mention that ā€œthe Tor network is not appropriate for Zcashā€. Does this mean that your project would build out Tor protocol functionality as a JavaScript project, but that your recommendation would not be to utilize the current Tor network and make a separate one?

  2. You mention the Convergence proposal in your grant and GitHub and other places. It seems like node-Tor would gravitate towards this Convergence proposal in such a way where connection tot eh Tor network itself would be deprecated in node-Tor to support this new p2p architecture. Are there plans for the Convergence proposal long term and how does that align with node-Tor?

Zcash Community Grants funds independent teams entering the Zcash ecosystem, to perform major ongoing development (or other work) for the public good of the Zcash ecosystem. My advice would be to reach out to some Zcash ecosystem projects, such as wallets, that may be utilizing JavaScript in their stack to see if node-Tor would be helpful. ZOMG (previous yearā€™s grantā€™s committee) decided to fund Arti from the Tor Project because we believed the reimplementation of Tor would benefit our privacy goals for Zcash. In general, you should aim to provide a direct connection between a grant proposal and the benefit to the Zcash ecosystem when applying. I think node-Tor is cool personally, but am not convinced ZCG can fund this without more evidence of a direct benefit to the Zcash ecosystem.

Thanks!

7 Likes

Does this mean that your project would build out Tor protocol functionality as a JavaScript project, but that your recommendation would not be to utilize the current Tor network and make a separate one?

Yes and no, the recommendation is not to use the Tor network for Zcash the way it is used by the Tor browser (and probably Arti), because you canā€™t control anything (everything is streamed via one circuit whose lifetime is very long, you canā€™t choose the nodes, the lifetime of guards, the path of circuits, etc)

node-Tor allows you to use the Tor protocol the way you like, with or without Tor network nodes, of course today there are no real other choices than using Tor network nodes but if we never start adding other independent ones then we will never move forward a decentralized Tor protocol system, for example guards should not be Tor network nodes (because a guard can know it is the first node and possibly deanonymize you), if we take the browser Tor circuits they implement the Tor protocol over WebSockets, then the entry guard must implement the WS interface, I did ask some years ago the Tor project team to open WS everywhere (which they have implemented because of Flashproxy) but never got any answer, so they decide to do whatever they like and you must follow, I did not check the latest status but Snowflake also is ridiculous, with only one or two servers

You mention the Convergence proposal in your grant and GitHub and other places. It seems like node-Tor would gravitate towards this Convergence proposal in such a way where connection tot eh Tor network itself would be deprecated in node-Tor to support this new p2p architecture. Are there plans for the Convergence proposal long term and how does that align with node-Tor?

Indeed the goal is to move toward a Convergence like design, using browsers and servers as node-Tor nodes, this can be combined with Tor network nodes, the plan is already inside the proposal, but this needs to be funded, ideally other devs can join the project, but I donā€™t think itā€™s really possible before phase 4 is released (the request for funding here again)

If you look well, unlike the initial Convergence proposal the latest one does not design the peer discovery system, because I think itā€™s up to the upper layer (here Zcash) to do this the appropriate way (most likely not the Tor network central way)

This is a bit the story of the life of node-Tor: it always falls somewhere outside the scope of grants proposal but not far, everybody finds it interesting but I am always welcome to keep going ahead alone, the fact that I am not asking millions for funding does not mean that the project is anecdotic

A direct application to Zcash could be zcashd | node-Tor | zcashd, now as previously mentionned I donā€™t find it so good, but still keeping it in mind, another one could be to compile node-Tor in C/C++ (emscripten?), I am not very C/C++, probably others can find/propose solutions

My advice would be to reach out to some Zcash ecosystem projects, such as wallets, that may be utilizing JavaScript in their stack to see if node-Tor would be helpful.

I can do so, which wallets would you suggest?

ZOMG (previous yearā€™s grantā€™s committee) decided to fund Arti from the Tor Project because we believed the reimplementation of Tor would benefit our privacy goals for Zcash. In general, you should aim to provide a direct connection between a grant proposal and the benefit to the Zcash ecosystem when applying.

Maybe but it seems like (in the light of this thread) that you donā€™t really know what you will get at the end, and if itā€™s a remake of the Tor network then back to the beginning of this post (and vulnerabilities like bitcoin CVE), so I am not sure to see the direct connection, but Zcash opening the path to a p2p Tor protocol looks to be one, in line also with Zcash privacy goals

1 Like

This proposal seems in line with the Zcash Foundationā€™s mission statement. Remember that ā€œfocused on the Zcash protocol and blockchainā€ comes at the end, not the beginning.

Thanks

As probably everybody understood here I am not competing with the Tor Project/Arti, node-Tor is different

I posted previously this link: TLS error when connecting to node-Tor bridge Ā· Issue #2 Ā· Ayms/node-Tor Ā· GitHub, not sure if you looked at it

This is about the Tor project team trying to understand why node-Tor nodes were not blocked by the Great Firewall of China

At the end it remains mysterious, maybe some differences with the Tor network implementation

But what is sure is that node-Tor inside browsers (Peersm app at that time) was easily bypassing the GFW

Just another example why we should have different implementations/designs

1 Like

Thanks for the link to the latest zcash grant meeting, looks like itā€™s more heading toward a no than a yes

Letā€™s see what Teor thinks but as far as I see there might be a Zebra wasm, then zcash daemon inside browsers which can be anonymized by node-Tor, this is probably not for tomorrow but, again, node-Tor will not fall from the sky shining and up to date in years when people are ready to use it, we should be ready now

Please bring the wallets people here if possible

Would be interesting to see the minutes of the last week meeting with the Tor project/Arti, especially the wasm plan

1 Like

There arenā€™t any written meeting minutes from last weekā€™s discussion with the Tor team, but you can listen to a recording of the Twitter Spaces event at the link below:

Thanks for the link, I did listen the meeting and then of course have some comments/questions

There is not a single word about wasm and/or Tor inside browsers, and itā€™s surprising to see that the current grant does not cover onion services (because for example it looks like that bitcoin folks are more focusing on hidding nodes rather than exiting transactions), which should be covered by another potential grant, a short summary might be that Arti is a remake of the Tor project without the proxy, compatible with the Zebra Rust, without onion services for now while node-Tor implements the RDV protocol

We see a focus on different circuits for each request (ie tx), which I have highlighted in the previous posts, but I donā€™t understand the concern for light wallets, obviously the right solution is to maintain different circuits, share the load between them for every requests and renew them periodically, which is what is doing node-Tor (5 circuits by default renewed when you decide it, every hour by default), of course building a new circuit real time for each request does not make sense, and building plenty of circuits is not recommended from my standpoint, this applies for light wallets and zcashd, I donā€™t see what the latency issue is about

nickm did recommend to add some private nodes, as I did again in the previous posts, especially the guards should not be in the consensus but some unknown zcash Tor project (or node-Tor) nodes (call them bridges if you like)

I did not hear the number gaven by Deirdre for the number of Tor network nodes, the real number is the one I gave: 3000 working nodes at a given instant, if really important I can test again (because for node-Tor Relays=Guards), but thatā€™s the order of magnitude and the real test would be not to test only the nodes with VERSION cells (like the Tor network, node-Tor and the GFW are doing) but at least with one CREATE cell

In the previous posts I did not mention the exit issue, of course the exit nodes can fake whatever they like with zcash, like modifying the tx resulting of being banned without the zcash node knowing it, making you believe whatever it likes, then nickm advises TLS of course, do you have some plans to implement TLS over the zcash/bitcoin protocol?

What is the issue shortly discussed with shielded addresses? (broadcasting?)

Let me know if I misunderstood some parts of the discussion but I think I did not

1 Like

Some answers to my questions?

1 Like

Thanks again for the link to the grant meeting

I tried to listen again the discussion but itā€™s a bit long, so I still donā€™t know what is the plan for dubious exit nodes (maybe TLS with letā€™s encrypt or, better, end to end encryption) and what the shielded addresses issue is about

If this can be of some interest, here is another feature of the Peersm app/demo, usable by anybody, I am not aware of a simple secure equivalent:

Alice wants to share something that can be materialiezd in a file with Bob anonymously, Alice uploads the file inside her browser from her disk via the Peersm app, Alice gets a reference to the file (basically the hash of the file)

The Alice Peersm app is connected anonymously to the node-Tor RDV node via 3 hops (called ORDB but thatā€™s a standard node-Tor OR) and advertises the hash to that node, Bob Peersm app is connected the same way to the RDV node, the RDV node does not know who are Alice and Bob

Alice sends to Bob via a different channel (email, sms, etc) the hash of the file, Bob enters the hash in the Peersm app and download anonymously the file from Aliceā€™s browser via the RDV node (so via 6 anonymous hops)

The RDV node sees everything in clear, then in addition Alice can encrypt the file using the Peersm app and send again via a different channel the encryption key to Bob, then the RDV node does not know what the file is about, and stil does not know who are Alice and Bob, Bob will decrypt the downloaded file with the encryption key via the Peersm app

Then Bob starts seeding the file also if it is to be shared with others (unless Bob decides to remove the file from his browser, so can do Alice too once the secret is shared), the RDV node will select randomely who will serve the next download request

Of course one could say ā€œjust use email with PGPā€, or signal, telegram, whatever, but who knows how to do this? And can you download 1GB?

I donā€™t know if this can be a use case for Zcash but for sure itā€™s a real life use case (see my example above about antivax trying to share censored content), the difference here is that itā€™s quite easy to use for anybody, secure and anonymous, quite fast and working very well