Project: FiberVPN
Applicant: Akan Theodore (kd-designs on GitHub: GitHub - kd-designs/fibervpn: Pay-per-hour and pay-per-MB WireGuard VPN exit gateway powered by Nervos Fiber Network · GitHub )
Funding requested: $750 USD equivalent in CKB (payout address shared on approval)
Timeline: 5 weeks
Contact: Nervos Talk DM
What FiberVPN Is
FiberVPN is a self-hosted WireGuard exit gateway and browser checkout that sells encrypted VPN tunnels by the hour or by the megabyte over Nervos Fiber Network.
You open the web page, pick a tier (1 hour / 500 MB or 24 hours / 5 GB), pay a Fiber invoice and get a WireGuard QR code and .conf file immediately. You scan it into the official WireGuard app on your phone or laptop, route traffic through the exit node and get disconnected cleanly as soon as the paid time or byte quota hits zero
Why Build This
Most commercial VPNs force users into $10+/month subscriptions, email signups or credit card billing just to get encrypted internet on airport, hotel or cafe Wi-Fi for an afternoon. On Bitcoin Lightning, LNVPN showed that pay-as-you-go WireGuard tunnels are one of the few micropayment apps people actually return to use.
FiberVPN brings that same pattern to Fiber without accounts or custodial logins:
- The browser generates the WireGuard keypair locally and persists it in
localStorageso refreshing the tab while waiting for payment never orphans a paid tunnel. - The backend validates the Curve25519 public key, creates a Fiber invoice via
fnn(new_invoice) and allocates a tunnel IP only afterget_invoicereportsPaid. - Every 10 seconds, the quota daemon checks
wg show wg0 transferand tears down any peer whose paid duration or byte limit is reached, recycling its IP back into the/24pool.
How it sits next to other Fiber projects: MeterNet meters local router Wi-Fi per megabyte via openNDS captive-portal rules, while Fiber Paid HTTP gates single HTTP requests behind payment headers. Neither gives a remote user an OS-level encrypted WireGuard tunnel they can turn on from anywhere using the standard WireGuard app.
How It Works
Browser generates WireGuard keypair locally (saved in localStorage)
-> sends publicKey + tier to FiberVPN gateway
-> gateway validates Curve25519 key, calls fnn new_invoice and returns invoice
User pays invoice (~1s via Fiber wallet or @nervosnetwork/fiber-js WASM)
-> gateway sees Paid via get_invoice
-> allocates IP from /24 pool -> runs `wg set wg0 peer <pubkey> allowed-ips <ip>/32`
-> browser injects local PrivateKey and renders WireGuard QR / .conf
Quota daemon (every 10s, backed by SQLite)
-> reads `wg show wg0 transfer`
-> on expiry or rx+tx >= maxBytes, runs `wg set wg0 peer <pubkey> remove` and recycles IP
The HTTP server runs unprivileged (not as root), scoped via CAP_NET_ADMIN / sudoers strictly to wg set wg0 and wg show wg0 transfer with execFile and zero shell interpolation. During the public testnet trial, nftables forwarding on wg0 blocks outbound SMTP (25, 465, 587) and BitTorrent while leaving standard web, SSH and DNS ports (80, 443, 53) open so testers cannot get the VPS flagged for spam.
For reviewers who do not run a local fnn node, Week 2 puts a public testnet web MVP online with a built-in @nervosnetwork/fiber-js browser WASM flow alongside the raw invoice QR. You fund from the testnet faucet, pay a 15 min / 50 MB test tier right in your browser, scan the WireGuard QR on your phone or laptop and confirm your public IP switches to the exit node and cuts off at expiry.
Applicant Background
I’m Akan Theodore (kd-designs), an independent full-stack developer working mostly with TypeScript, Node.js services and Linux networking. I haven’t run a public fnn node before, so Week 1 tackles live Pudge testnet channel opening and wg set peer provisioning on a Linux VPS up front before building the browser UI on top of it.
What Already Exists vs. What the Grant Funds
An initial v0.1.0 core is already written in TypeScript ( GitHub - kd-designs/fibervpn: Pay-per-hour and pay-per-MB WireGuard VPN exit gateway powered by Nervos Fiber Network · GitHub ) and runs locally today:
- Curve25519 base64 key validation rejecting malformed or shell-injected keys (
src/wireguard.ts) /24IP pool allocator (IpPoolAllocator),.confbuilder andWgCliAdapterusingexecFile('wg', ...)FnnRpcClientwired to FNN’snew_invoiceandget_invoiceJSON-RPC schema plus an in-memory mock (src/fiber-rpc.ts)VpnManagerwith post-payment IP allocation, concurrent activation locking, duplicate-active-key protection and automatic time/byte quota cutoffs (src/manager.ts)- 8 passing unit tests (
npm test) and a local simulation (npm run demo)
What this grant funds (5 weeks):
- Live Linux + WireGuard +
fnngateway: Provisioningwg0NAT/forwarding,nftablesport filtering and a funded Pudge testnetfnnnode on a public Linux VPS. - Public browser MVP (Week 2): Hosted testnet page with client-side Curve25519 keygen (
localStorage-backed),@nervosnetwork/fiber-jsWASM checkout alongside raw invoice QRs and WireGuard QR rendering. - SQLite persistence & restart reconciliation (Week 3): Persisting sessions and byte checkpoints in SQLite so daemon restarts clean up peers that expired offline and never reset
wgbyte counters. - 14-day public testnet trial & verifier (Weeks 4-5): Opening the testnet exit node to Nervos Talk testers for two weeks, publishing a standalone status/verification CLI (
npx fibervpn status <payment_hash>), recording an unedited mobile WireGuard demo video and posting the closing report with testnet payment hashes and honest latency/failure notes.
Deliverables & Timeline
- Week 1: Live
wg0+fnntestnet node: Linux VPS running WireGuardwg0,nftablesrules and a funded Pudge testnetfnnnode; first real invoice-to-peer-add test passed - Week 2: Public testnet web MVP: Hosted demo URL posted on this thread with browser
@nervosnetwork/fiber-js+ QR checkout, WireGuard QR generation and live peer status board. - Week 3: Persistence & quota cutoff suite: SQLite session recovery across restarts and live cutoff tests for both time expiry and byte-cap exhaustion.
- Weeks 4-5: 14-day community trial, CLI & wrap-up: Two weeks of public testnet usage, verification CLI published, unedited mobile WireGuard cutoff video recorded and closing report posted.
Budget: $750 USD in CKB
Priced by milestone (no VPS hardware or hosting fees billed separately):
- Week 1 ($150): Linux VPS
wg0setup,nftablesrules and testnetfnnchannel liquidity - Week 2 ($200): Public testnet web MVP, client-side keygen, WASM checkout and WireGuard QR UI
- Week 3 ($200): SQLite persistence, restart reconciliation and automated quota cutoff tests
- Weeks 4-5 ($200): 14-day public trial, verification CLI, walkthrough video and closing report
How Anyone Can Verify
- Right now (local repo): Clone GitHub - kd-designs/fibervpn: Pay-per-hour and pay-per-MB WireGuard VPN exit gateway powered by Nervos Fiber Network · GitHub , run
npm install && npm test && npm run demoto verify the 8 tests, key validation, concurrency guard and quota cutoff simulation. - From Week 2: Open the live testnet URL, pay a testnet Fiber invoice via the browser WASM flow (or your own Fiber node), scan the WireGuard QR in the official WireGuard app, check
ifconfig.mebefore and after connecting and watch traffic stop at expiry. - At completion: Run
npx fibervpn status <payment_hash>against our public logs and watch the unedited phone-to-WireGuard walkthrough video.
Maintenance
For 6 months after completion, I will keep fibervpn updated against fnn JSON-RPC changes and answer setup issues on GitHub within 48 hours.