ava1 1.0.2

AVA1: an encrypted, resumable, multi-lane file-transfer protocol (client and node), designed for sending files to a PlayStation 5, with a C implementation tested against it
Documentation

ava1

ci crates.io docs.rs license

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.
[dependencies]
ava1 = "1"
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }
let mut session = ava1::session::connect(addr, identity, peers, "my laptop", Timing::default()).await?;
if session.pairing_pending() {
    session.confirm_pairing(code_shown_by_the_node).await?;
}
let source = LocalSource::new(folder.into());
let files = Arc::new(ava1::manifest::walk(&source, &|_: &str| false)?);
let mut job = session.job(ava1::keys::random_bytes()?);
let done = send_job(&mut job, files, Arc::new(source), SendOptions::upload("backups/today")).await?;

Complete programs: send_folder (a node and a client in one process) and send_to_node (a client that pairs over the network):

cargo run -p ava1 --example send_folder -- path/to/folder

See the API documentation, the specification, and the repository README.

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.