P2P Connector
Post-quantum cryptography secured peer-to-peer tool for file transfer, remote shell access and remote procedure calls. It links computers, automation code, agents, and remote executions that are done by hand across NATs without the need for manual port forwarding or relays.
P2P Connector is built to facilitate AI factory operations, communication between AI agents and other code for AI-driven automation. It provides very high security and scalability while eliminating the need for publicly open ports and services, which are complex enough to contain bugs and exploits that are often detected only after it is too late.
P2P Connector is a post-quantum peer-to-peer tool for file transfer, remote shell access and remote procedure calls. It is written in C++23 on top of OpenSSL 3.5 and is released under the GPLv3 licence.
P2P Connector connects machines directly over UDP, across NATs, without manual port forwarding and without relays. Authentication and key establishment use only NIST-standardised post-quantum algorithms: ML-DSA certificates and ML-KEM key exchange on the tracker channel, and a certificate-free ML-KEM-768 handshake on the peer-to-peer channel. Bulk data is protected with AES-256-GCM.
Peers are identified by UUIDv7 and authenticated through API keys and short-lived client certificates. Secrets are never stored in plaintext, never passed on the command line, and are held in memory locked with mlock and excluded from core dumps.
For many operations it removes the need for a VPN. The connector runs entirely in userspace and does not require privileged access to install or run, so peers can connect without kernel modules, system-wide network reconfiguration or administrative rights on the host.
P2P Connector can be used together with CHAIN++ for data governance and contract enforcement, but it can also be deployed standalone for direct peer-to-peer operations.
Core capabilities
Post-quantum encryption and authentication for file transfer
P2P Connector moves files and directories directly between peers. Transfers run over UDP with HTTP/3-style requests, with the following features:
- IPv6 preferred, with IPv4 fallback.
- Selective acknowledgement and parallel multi-stream range slicing.
- Multi-file batching with configurable stream count.
- Resumable downloads verified with SHA-256.
A serving peer publishes catalogues and browse policies. A client browses the catalogue peer to peer, then requests only the files it is allowed to see.
Remote shell over PQC
A serving peer can offer an interactive login shell on a pseudo-terminal to selected peers, over the same NAT-traversing channel. Access requires:
- A shell API key.
- Admission by a separate shell policy.
- A mapping of the peer identity to a local account other than
root.
Shells maintain a rolling 64 KiB remote output history and a session token, so interrupted sessions can detach, reattach and replay history. Residual risks of the design are documented in the protocol specification, Section 5.1.
RPC service over PQC
A serving peer can expose a resumable RPC service for AI factory or cloud service definitions. Clients can:
- Query the manifest.
- Invoke methods with idempotency keys.
- Check or cancel jobs.
- Resume output streams from exact byte offsets across network interruptions.
This makes P2P Connector suitable for long-running compute jobs, model serving endpoints and distributed AI workflows.
NAT traversal without relays
Detailed description of the NAT traversal design: NAT traversal architecture document.
P2P Connector reaches peers behind ordinary home or cloud NATs without manual port forwarding and without routing traffic through a third-party relay.
The tracker coordinates UDP hole punching. Punch datagrams are authenticated by a per-request tag, so a serving peer behind a symmetric NAT can be reached at the port its punch reveals. The serving peer also attempts automatic port mapping on its gateway through PCP, NAT-PMP or UPnP IGD.
A mapped endpoint is published only after the tracker has verified it can reach the peer through it. When both peers are behind symmetric NAT and no mapping is granted, the connection is refused with an explanation. Peers are never silently relayed.
Identity, authentication and secret handling
- Peers are identified by UUIDv7.
- API keys have the form
<uuid>:<HMAC-SHA256>in four separate domains:tracker,browsing,shellandrpc. - Peers obtain 24-hour client certificates from the tracker through challenge-bound CSR enrolment. Serving peers renew their leaf certificate automatically before it expires. The tracker certificate is
serverAuthonly, so a peer cannot impersonate the tracker. - Secrets are encrypted at rest with AES-256-GCM, staged in
/dev/shm, loaded intomlock-ed memory excluded from core dumps, and removed from/dev/shmafter loading. - Private keys are written to and read from
/dev/shmonly. - Every program disables core dumps and
ptraceattachment for itself. - The tracker TLS profile is pinned: TLS 1.3 with
TLS_AES_256_GCM_SHA384, ML-KEM groups and ML-DSA certificates throughout the chain, with no session resumption. - The tracker bounds connections per source and per identity, enforces handshake and idle deadlines, supports a revocation list reloaded on
SIGHUP, and binds a peer's UDP endpoint only after the peer returns a token sent to that endpoint over its mutually authenticated TLS session. - The tracker keeps no database. It publishes peer identifiers only and discloses addresses only to peers admitted by the target's visibility policy (
ALL,BANNEDorALLOWED).
Potential users
The user guide and developer guide cover installation, operation and extension.
P2P Connector is specifically designed for:
- AI factories that need to move models, datasets and checkpoints between sites without exposing internal infrastructure.
- Distributed teams that need shell access to remote machines behind NATs.
- Cloud and HPC operators that want direct peer-to-peer data transfer with post-quantum security.
- Developers building AI agent networks that need secure, resumable RPC between peers.
Current status
P2P Connector is a proof of concept that is approaching its first production state. File transfer, remote shell, RPC, NAT traversal, port mapping, digital twin validation and the standalone viewer are all implemented and exercised by automated tests, including local tests, shell tests, twin tests and a four-host NAT traversal test with containers.
Before production it still needs hardening review, broader interoperability testing across consumer and carrier-grade NATs, and an independent security audit. Build instructions and test scripts are in the Git repository.