ava1
The Rust implementation of AVA1 (Adaptive Verified
Assembly, version 1), an encrypted, resumable, multi-lane protocol for moving large files and
folders between two devices over TCP. It has a client (connect, pair, upload, download, RPC) and
a node (server::ServerCtx, with host::FolderHost to serve a folder), and is tested on every
change against the C node in the same repository.
AVA1 was designed for transfers to a PlayStation 5: in ps5upload the C node runs on the console and this crate is the client on a PC, phone or server. Nothing in it is specific to the PS5, and it works between any two devices.
- Fast. Up to 8 parallel lanes; a governor sets lanes and chunk size from whatever is slowest at the moment (network, source disk, receiving disk).
- Resumable. The receiver journals what is durably written; a dropped connection or a restarted device picks up where it stopped.
- Verified. Every file is checked with BLAKE3 in 1 MiB groups before it counts as written.
- Encrypted and paired. Noise XX, ChaCha20-Poly1305 on every frame, and a one-time pairing code, after which the devices recognise each other's keys.
- Extensible. Sessions carry RPCs; applications add their own methods with
ava1-gen.
[]
= "1"
= { = "1", = ["macros", "rt-multi-thread"] }
let mut session = connect.await?;
if session.pairing_pending
let source = new;
let files = new;
let mut job = session.job;
let done = send_job.await?;
Complete programs: send_folder
(a node and a client in one process) and
send_to_node
(a client that pairs over the network):
See the API documentation, the specification, and the repository README.
Support
AVA1 is made by PhantomPtr. Questions are welcome on Discord, and if AVA1 is useful to you, you can buy me a coffee on Ko-fi.
License
Licensed under either of Apache License, Version 2.0 or MIT license at your option.