Arti

A new Rust-based Tor implementation

Nick Mathewson
nickm@torproject.org

29 April 2021

In this talk…

  1. Technical debt
  2. Perhaps Rust will help?
  3. The beginnings
  4. Arti today
  5. Arti in the future
  6. Q+A

Our software is showing its age. The ENIAC.

Worse things happen at C…

  • Unsafety is everywhere
  • Way too low-level

Worse things happen at C…

So:

  • Caution and busywork make development slow…
  • But security is still hard:

      8/28 TROVE issues were memory safety.

      5/28 were NULL-related.

      “My billion-dollar mistake.”–Tony Hoare

      5/28 other misc C workarounds.

Now let's talk about our architecture…

vine-covered building

“A doctor can bury his mistakes, but an architect can only advise his clients to plant vines.”
–Frank Lloyd Wright

Tight coupling hardens our assumptions

  • Changing one thing breaks others.
  • Hard to test.
  • Wants to be a proxy: hard to embed.
  • Not much multithreading.

Perhaps Rust is the answer?

  • High-level
  • Memory safe; no NULLs
  • “Fearless concurrency”
  • Very strong & friendly ecosystem
  • Meet Ferris

Arti started as side-project

  • 2019: Started out as a project to learn Rust.
  • 2020 Aug: Took a sabbatical. Kept hacking.
  • 2020 Sep: Public demo!
  • 2021 Nov: Working stand-alone client!

Architecture might actually work!

Forget the details; enjoy the lines!

(Our C architecture, for reference)

Arti does some stuff better than C tor!

(Rust libraries get most of the credit)

  • Efficient storage
  • Already multithreaded
  • Faster crypto!
  • Uses system TLS
  • Shared directory cache
  • Test coverage!

But don't use Arti yet!

For 1.0 milestone:

  1. Fix privacy issues. (Guards, build timeouts, stream isolation)
  2. Refine, test, profile.
  3. Performance, usability, distribution.
  4. APIs for embedding and usability.

And then we implement the rest of it.

For 2.0 milestone:

  1. Onion services.
  2. Bridges and Transports
  3. Performance ≥ C.
  4. C FFI for non-Rust embedding.
  5. Ready to replace C client!

Then on to the relay side!

No estimates here yet; need to gain experience from the client-side development.

Questions?

See https://gitlab.torproject.org/tpo/core/arti/ for code, tickets, and milestones.

Thank you!