Skip to content
LoopyLuciPublic

About

Transferd Protocol: the universal, zero-knowledge, post-quantum secure data transfer and messaging protocol. Core specification, wire formats, and reference implementations extracted from TransferDaemon.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Transferd

License: MIT Protocol Version core CI

Transferd is a protocol for end-to-end encrypted, post-quantum secure data transfer between paired nodes. Nodes can reach each other directly, through blind relays, or both at once, and applications see reliable, ordered, flow-controlled streams.

This repository is the protocol in three parts that always travel together:

  • the specification (docs/), which is the source of truth for the wire format;
  • the reference implementation (crates/), which builds, tests and runs the protocol on its own;
  • independent Python (python/) and TypeScript (typescript/) implementations, each tested against the reference's vectors and live against its binaries; and
  • the tooling that builds, tests, fuzzes, packages and deploys it (scripts/, fuzz/, deploy/, .github/workflows/).

Nothing here depends on TransferDaemon or any other repository. TransferDaemon is the GUI application built on this core. It carries a byte-identical copy of every core file and adds the application around them.


What the protocol provides

  • Authenticated, hybrid key exchange on every link. Identity is Ed25519 + ML-DSA-87. Key exchange is X25519 + ML-KEM-768. Breaking a session requires breaking both the classical and the post-quantum parts.
  • Encrypted tunnels with replay protection. Directional AES-256-GCM keys, counter nonces, and a 4096-wide replay window.
  • Multiplexed streams. Per-stream flow control, cumulative and selective acknowledgements, and resending on another route if one fails.
  • Multiple routes per peer. A session can use direct TCP, relayed datagrams, and a hole-punched UDP path at the same time. Routes are probed, and the session fails over between them.
  • Blind relays. A relay forwards random 32-byte tokens and size-padded ciphertext. It does not learn identities or plaintext.
  • Hole punching (protocol version 3 and later) for direct UDP paths through cone NATs.
  • Pairing by signed invite, with one-time nonces, a key fingerprint checked on first contact, and trust on first use.
  • Compatibility by design. Protocol versions are negotiated at connection time. Unknown frame kinds and trailing fields are ignored, so newer builds do not break older ones.
  • No central servers. Every relay and resolver is configuration. Any conforming relay can be self-hosted.

Read the specification

Document What it covers
docs/PROTOCOL.md The wire specification. Handshake, tunnel, relay encapsulation, frames, sessions, invites, versioning, hole punching.
docs/OVERLAY.md Overlay semantics. Pairing, services and access control, path selection, streams and congestion control, mesh DNS.
docs/CRYPTO.md Cryptographic constructions, key derivation labels, and informal security arguments.
docs/RELAY.md The blind relay: token registration, forwarding, and Locate.
docs/IMPLEMENTATION.md How to build a conforming node, which requirements are mandatory, and how to test interoperability.
docs/DEPLOYMENT.md Hosting relays and a DHT bootstrap node on the public Internet.

Start with PROTOCOL.md if you are implementing the wire format. Start with OVERLAY.md if you want to know what the network does.


Layers

 application stream bytes
 ── overlay ────────────  pairing, services, routes, streams, mesh DNS
 ── frames ─────────────  session: hello, streams, pings, receipts
 ── tunnel ─────────────  per link: AES-256-GCM, counter, replay window
 ── link ───────────────  TCP, relay datagrams, or any LinkTransport

Repository layout

Path What it is
docs/ The specification, and the relay deployment guide
crates/ The reference implementation (one Cargo workspace) and the conformance tests
fuzz/ cargo-fuzz target for the relay frame parser
python/ The Python implementation: codecs, handshake, session, streams, relay client, and its tests
typescript/ The TypeScript implementation (ES modules for Node.js), with the same coverage and its tests
vectors/ Reference vectors the Python and TypeScript tests check against, generated by the Rust examples
deploy/ Relay deployment: Docker image and compose file, nginx stream config, Cloudflare Worker relay
scripts/ test-core (format, lint, test, build, and the Python and TypeScript suites) and sync-core (keeps TransferDaemon's copy identical)
core.manifest The files that are identical in this repository and in TransferDaemon
.github/workflows/core-ci.yml CI for the core: Rust format, clippy, tests, builds, fuzz smoke test and audit; Python and TypeScript tests against the reference binaries

Build and test

Requires the stable Rust toolchain. No other system library is needed.

scripts/test-core.sh

On Windows, run scripts/test-core.ps1. To build the relay binaries alone:

cargo build --release -p relayd -p transferd-relay -p transferd-cat

The overlay's interoperability tests are in crates/transferd-overlay/tests. See docs/IMPLEMENTATION.md for what they check.

scripts/test-core.sh also runs the Python and TypeScript suites when Python and Node.js are installed, and runs their live interop tests against the reference binaries. Each package's own README says how to run its suite alone: python/README.md and typescript/README.md.

Run a relay

docker compose -f deploy/docker-compose.yml up -d

This starts relayd (UDP 5901), relayd-ws (TCP 5902) and the dhtd bootstrap node (UDP 7901). docs/DEPLOYMENT.md covers public addresses, firewalls and TLS fronting. deploy/cloudflare-worker runs the same relay on Cloudflare's free tier.


Implementations

Implementation Status Notes
This repository (crates/) Reference implementation Protocol versions 1–3. Includes the relayd blind relay, the dhtd bootstrap node and transferd-cat.
python/ Independent implementation Handshake, tunnel, frames, session, streams (multiplexer, engine and driver), invites, relay messages and client, and hole-punch probes. Not yet: routing and failover, congestion control, the hole-punch state machine, DNS, transferd-cat, the DHT node, the ratchet and ghost keys. See python/README.md.
typescript/ Independent implementation The same coverage as the Python package, for Node.js. See typescript/README.md.
TransferDaemon GUI application on the reference implementation Its core files are a byte-identical copy of this repository's. It adds the daemon, user interfaces and installers.

If you build an implementation, please tell us, and we will list it here. Interoperability tests against the reference implementation are described in docs/IMPLEMENTATION.md.


Versioning and change process

  • The current protocol version is 3. The lowest version still supported is 1. The versions a build speaks are described in PROTOCOL.md §7.
  • This repository is the source of truth for wire behavior. A change to frame formats, key derivation labels, or version ranges is made here first, and is then implemented.
  • If this specification and an implementation disagree, one of them has a bug. Open an issue here so the disagreement can be settled and the specification corrected if needed.
  • New ciphersuites and frame kinds are additive. An existing algorithm or identifier is never changed.

Keeping TransferDaemon in step

Core files are changed here and only here. TransferDaemon takes them over with:

scripts/sync-core.sh /path/to/Transferd

TransferDaemon's CI runs the same script with --check against this repository's main and fails if any core file differs.


Contributing

Propose protocol changes (new frame kinds, ciphersuites, version bumps, or clarifications) by opening an issue or pull request in this repository, before writing implementation code. Changes that alter wire behavior need a version or a new identifier, and need a note in the relevant document about how older builds behave.


License

MIT License. See LICENSE.

About

Transferd Protocol: the universal, zero-knowledge, post-quantum secure data transfer and messaging protocol. Core specification, wire formats, and reference implementations extracted from TransferDaemon.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages