Hi everyone!
I’ve been working on FiberSurvivors, a top-down survivors-like (kinda like Vampire Survivors) that runs in the browser, where the CKB you earn and the upgrade cards you buy are all paid over Fiber.
So a run goes like this:
- You open the game and a Fiber node starts in your browser, with its own wallet
- You fund it from the testnet faucet
- Press Play, and the game opens a channel to the hub node (game’s reward liquidity)
- Clear a level, and the hub pays you CKB
- Buy upgrade cards mid-run by paying an invoice
- Cash out at the end, the channel closes and your CKB goes back on-chain
All you need is a browser tab, no extension, no local node, no CLI. Everything runs on testnet.
The Loop Graph:
fund a channel ──► fight through 10 levels ──► hub pays each level cleared
▲ │
│ ▼
stronger build ◄──── spend earnings on upgrade cards
│
▼
cash out ──► channel closes, CKB settles on-chain
So it’s more rewards vs more power. You earn more if you buy fewer cards, kite well and win, but if you lose a level, the run ends there. Right now there are 10 levels with a dragon boss at the end, more might come later.
Motivation
While learning Fiber and CKB, I felt like Fiber fits PvP games best, since two players can pay each other directly over a channel, so you don’t have to put all the trust on one server. But for UX, I wanted players to have a smooth experience without setting up a local node or finding someone to match with, and on a testnet demo it’s pretty hard to find another player online. So in the end it became a single-player game where you earn CKB by playing and spend it on upgrades, at least for now.
Try it
Demo: https://zesty-youtiao-8586ae.netlify.app
SDK repo: Fiber WebGL SDK
The game source isn’t public since it uses some paid assets (Feel and the Vefects Effect Pack), and their licenses don’t allow sharing them. But all the Fiber parts are in the SDK, which is fully open.
How it works
The game is built in Unity (WebGL). For the Fiber part I use my own Fiber WebGL SDK, which runs Fiber’s WASM node (@nervosnetwork/fiber-js) inside the build.
On the other side there’s one fnn node (the hub) on a small cloud VM, plus a small Express server next to it. Every player opens one channel to the hub, and all rewards and card payments go through it.
The server is the one deciding money, not the client:
- Rewards: The coins you pick up only count once you reach the exit. That’s when the client claims them, the server checks the claim, and the hub pays you. Die before the exit and those coins are gone. The full campaign is 10 levels and pays up to 216 CKB
- Cards: When you buy a card, the client only sends the card id. The server makes an invoice with the price, then the client decodes it and checks the price matches what it showed you before paying. Cards are 5 to 45 CKB, so if you buy a lot you can actually end a run with less than you started with lol
- Cash out: Cash out closes the channel and settles both sides on-chain
Each player channel is 400 CKB, and the hub puts in 400 CKB on its side too.
The SDK
While building this I ended up turning all the Fiber stuff into a Unity package, which I submitted to the Gone in 60ms Hackathon where my winning chances were also gone in 60ms ![]()
Anyway, any Unity WebGL game can use it too:
IPaymentGateway: start the node, connect, open/close channels, keysendIInvoicePaymentGateway: decode an invoice, check the amount, payIUdtPaymentGateway: xUDT channels and payments, route dry-runsIFiberWallet: on-chain CKB balanceIFiberDiagnostics: peers and channels
There’s a sample scene in the repo if you want to try it without the game.
Limitations
Well, to be honest this is a tech demo for “a Fiber node inside a Unity browser game”. The money side is protected: the client never decides an amount, rewards come from the server, and card prices come in server-made invoices. But the gameplay itself isn’t verified ![]()
-
You trust the server: The server can’t see the gameplay itself, but it rejects claims that are out of order, too fast, or have more coins than the level could drop. With one claim per level per session and a payout cap per player, that’s what stops reward spamming for now, but there’s no real anti-cheat.
-
The key lives in the browser: Like any Fiber node, it signs automatically, but here the key is kept in the browser’s
localStoragefor this site. If you clear your site data, the key and any CKB in it are gone. That’s okay for testnet, but letting players back up the key, or binding it to their own CKB wallet, would fix this. -
Opening a channel takes a few minutes on testnet since it waits for on-chain confirmation.
How to play
There’s a tutorial in the game, but here are the controls:
Controls: WASD to move, attacks are automatic, 1 to 4 to use a skill, left-click to aim, right-click to cancel.
Some tips
- If the channel open fails, wait a minute and try again, testnet can be slow sometimes
- Don’t forget to cash out at the end to get your CKB back on-chain
Credits
Kudos to these free assets, they helped me build this a lot faster:
- KayKit’s Packs for my game including Characters, Skeleton Enemies, Environment, Animations
- My cute Dragon Boss
- Space Game GUI Kit
- 500 Free Skill Icons
Thank you for reading till here, any feedback is welcome ![]()



