- What: SingLink Beta Protocol, the open first-generation proxy/VPN protocol by SingLinkVPN, written in Go using only the standard library.
- License: Apache-2.0. "SingLink", "SingLinkVPN", 星連/星连 and the logo are trademarks of SingLinkVPN (see NOTICE).
- Attribution: required. Any use or redistribution must keep "Software provided by the original author SingLinkVPN" (see Attribution).
- Version: 1.0.0-draft (spec draft 4). Released: 2026-11-12, in phase 2 of the SingLinkVPN open-source plan.
- Security: internal security audit with 31 findings, all High and Medium fixed or mitigated (docs/SECURITY-AUDIT.md); third-party source audits of 2026-11-13 and by VPN Labs (VPNL-2026-0013), with fixes and positions in docs/SECURITY-REMEDIATION.md.
- Lineage: the SingLink protocol has evolved from SingLinkVPN's early versions and SingLink Beta to today's SingLink 2.0; this first generation carries forward SingLinkVPN's design principles of account-based permissions, device binding and security by design.
- Stays closed for now: the latest versions (the SingLink 2.0 core and the current official SingLinkVPN apps), for security reasons.
- Related: first-generation client singlink-vpn-app · open-source hub singlink-vpn-open-source · singlinkvpn.com/en/tech/open-source
The SingLink protocol has evolved from SingLinkVPN's early versions and SingLink Beta to today's SingLink 2.0. The open-source "SingLink Beta Protocol, first generation" and "SingLinkVPN first-generation client" carry forward SingLinkVPN's long-standing design principles (account-based permissions, device binding and security by design) and were released after a security audit. The official apps and protocol have since moved to a new-generation architecture that is not yet fully public for security reasons; we release only code that poses no security risk, and the open-source plan will continue.
SingLink Beta is the open first-generation proxy/VPN protocol from SingLinkVPN. It keeps what makes VLESS and Trojan fast: one request at the start of a TLS connection, with the first payload in the same flight and no extra round trip. On top of that it adds what a production VPN service needs.
- Permission tokens instead of a shared UUID. The account backend signs a 160-byte token carrying expiry, TCP/UDP capabilities, rate limit, connection limit and plan. Every node verifies and enforces it offline, so there is no user database on the node. Tokens can be revoked by token, account or device, and revocation also closes live sessions.
- Device-bound credentials. Each token is bound to a device key, and the client proves possession on every connection. A token copied from a compromised node is useless without that key.
- End-to-end inner encryption (AES-256-GCM) that does not depend on the outer TLS, so the payload stays private even through a TLS-terminating CDN.
- Hybrid post-quantum key agreement: X25519 + ML-KEM-768 (FIPS 203), with ephemeral X25519 forward secrecy. See SPEC §5.4 for exactly what is covered.
- Probe resistance. Anything that does not authenticate is handed byte for byte to a real website, with no timing difference between kinds of probes. Expired, revoked and replayed credentials get the same treatment.
- Hardened nodes. They have:
- connection and per-IP limits, and a CPU budget for handshakes;
- a complete special-purpose-address block list (including NAT64), and no access to the node's own addresses;
- PROXY protocol towards the decoy site;
- replay protection across restarts;
- automatic rekeying.
The wire format is in SPEC.md. The internal security review and its fixes are in docs/SECURITY-AUDIT.md; the third-party audit findings, fixes and positions are in docs/SECURITY-REMEDIATION.md.
Status: 1.0.0-draft (spec draft 4). The protocol uses only standard primitives from the Go standard library. It has been through an internal security review and third-party source audits (2026-11-13, and VPN Labs, report VPNL-2026-0013), with a regression test for every fixed code finding plus fuzzing. An audit is not a guarantee and the protocol is still a draft: evaluate it carefully before high-risk use.
| Path | What |
|---|---|
SPEC.md |
SingLink Beta protocol specification |
singlink/ |
Protocol library (Go, standard library only) |
socks5/ |
Local SOCKS5 inbound (CONNECT + UDP ASSOCIATE, optional auth) |
engine/ |
Client runtime shared by the CLI and the C ABI |
cmd/singlink/ |
CLI: key generation, tokens, links, node, client, demo |
ffi/ |
libsinglink C ABI for apps |
deploy/ |
Example node config and hardened systemd unit |
docs/ |
Security review and audit remediation |
The reference desktop client (Flutter) lives in a separate repository.
Requires Go ≥ 1.26.11. With the default GOTOOLCHAIN=auto, the go command
fetches the release toolchain named in go.mod (toolchain line), which
make cli, make lib and make linux require; make vulncheck runs
govulncheck.
make test
make cli
./build/singlink demo # local node + client on 127.0.0.1:1080
curl -x socks5h://127.0.0.1:1080 https://www.gstatic.com/generate_204 -isinglink keygen server > node-key.json # private_key stays on the node; rotate it regularly
singlink keygen issuer > issuer.json # seed stays on the account backend
singlink keygen device > device.json # normally generated on the user's device
singlink token issue -issuer <issuer seed> -device <device public key> -days 1 -caps tcp,udp
singlink link -server vpn.example.com:443 -pk <node public key> -token <token> -device <device seed> -sni vpn.example.com
singlink replay-init -path /var/lib/singlink/replay.db # once, for new keys (see SECURITY.md)
singlink server -c deploy/server.example.json- Put a real website on the node's domain and point
fallbackat it (for example nginx on127.0.0.1:8080with PROXY protocol enabled). - Use a certificate that the Web PKI accepts.
- Install
deploy/singlink.service(systemd) to run the node.
make lib # build/libsinglink.dylib (universal macOS) + libsinglink.h
make linux # static node binaries for Linux amd64/arm64Please report security issues privately, not in public issues. See SECURITY.md.
Any use or redistribution must keep the attribution: "Software provided by
the original author SingLinkVPN." The SingLink Beta Protocol was originally
developed and provided by SingLinkVPN, https://singlinkvpn.com.
Redistributions and derivative works must reproduce the attribution in
NOTICE in their own NOTICE file and wherever they show third-party
notices or an About screen, and must not remove the source-file copyright
headers or the Attribution constant that the CLI and library print
(Apache License 2.0, section 4).
Apache License 2.0, see LICENSE and NOTICE. Redistributions and derivative works must keep the copyright headers and the NOTICE attribution ("Based on the SingLink Beta Protocol by SingLinkVPN", originally developed and provided by SingLinkVPN). "SingLink" and "SingLinkVPN" are trademarks of SingLinkVPN: a modified version must use its own name.
To prevent replay attacks, a node briefly keeps a cryptographically processed one-time handshake marker, deleted automatically after about 4 minutes. It contains no IP address, destination, account or any information that identifies a user, and it is not a log.
The server requires this anti-replay state to be explicitly initialized and
durable; there is no memory-only fallback. Existing node configurations must add
replay_file and provision it once with singlink replay-init for fresh keys
before startup. Never reset it while its keys remain accepted. Nodes on different
hosts that accept the same key must share one external atomic store (or simply
use one key per host). See the remediation and deployment contract
for same-host sharing, unsupported multi-host file storage, the Windows backend,
clock/GC behavior and the explicit empty revocation-list format.
Spec draft 4 changed the handshake identifier IDENT, so every derived key
differs from draft 3 although the wire layout and version byte (0x01) did
not change. There is no version negotiation and no plaintext fallback.
Upgrade nodes, apps and native libraries together:
| Node \ client (or native library) | Draft 3 client | Draft 4 client |
|---|---|---|
| Draft 3 node | works | node: silent fallback; client: "handshake rejected: possible protocol draft mismatch or wrong server key" |
| Draft 4 node | node: silent fallback; draft 3 client: generic rejection | works |
Keys, tokens, links and replay state stay valid. singlink version and the
FFI SingLinkVersion result report the draft. Details:
SPEC.md §10.