The developers of the anonymous network Tor have released the first stable version (1.0.0) of the Arti project, which develops a Tor client written in Rust. Version 1.0 is marked as suitable for use by regular users, providing the same level of privacy, usability, and stability as the main implementation in C. The API offered for utilizing Arti's functionality in other applications has also been stabilized. The code is released under the Apache 2.0 and MIT licenses.
Unlike the implementation in C, which was initially designed as a SOCKS proxy and then adapted for other needs, Arti is being developed from the start as a modular embeddable library that various applications can use. Furthermore, the development of the new project takes into account all the past experiences of Tor development, allowing for the avoidance of known architectural issues and making the project more modular and efficient.
The reason for rewriting Tor in Rust was the desire to achieve a higher level of code security through the use of a language that ensures safe memory handling. According to the Tor developers, at least half of all vulnerabilities tracked by the project will be eliminated in the Rust implementation if 'unsafe' blocks are not used in the code. Rust should also enable faster development speed than using C, thanks to the language's expressiveness and strong guarantees that reduce the need for double-checking and writing redundant code.
The experience gained from developing the first version shows that using Rust was justified. For example, it has been observed that fewer errors occurred at each stage in the Rust code compared to comparable development in C — the errors that arose during development were mainly related to logic and semantics. The compiler rustc's strictness, noted by some as a drawback, turned out to be a blessing, as if the code compiles and passes tests, the likelihood of its correctness significantly increases.
The new version also confirmed an increase in development speed, which is attributed not only to the fact that functionality was recreated based on an existing template, but also to Rust's more expressive semantics, handy function libraries, and the capability of Rust to ensure code safety. Among the drawbacks is the large size of the resulting builds — since the Rust standard library is not included in systems by default, it must be included in the downloadable packages.
Release 1.0 primarily focuses on the basic functionality as a client. Version 1.1 is expected to implement support for pluggable transports and bridges to bypass censorship. Version 1.2 will likely offer support for onion services and associated features such as RTT Congestion Control and DDoS protection measures. Achieving parity with the client in C is planned for branch 2.0, which will also provide bindings for using Arti in code on various programming languages.
In the coming years, the work will be focused on implementing the necessary functionality for relays and servers directory. When the Rust code reaches the level capable of fully replacing the C version, the developers intend to give Arti the status of the main implementation of Tor and discontinue support for the C implementation. Support for the C version will be gradually phased out, allowing for a smooth migration.
Source: opennet.ru
