StreetFighter is an LNbits WebAssembly extension for paid public fighting game matches. An LNbits user enables the extension, chooses a payout haircut, creates a match with a join amount, and shares the public match link. Two players enter Lightning addresses and pay invoices to join. The winner receives the pot minus the configured haircut.
The public page includes the StreetFighter canvas game from
/home/ben/Projects/StreetFighter, a join flow, a player list, and a troll box.
Realtime move updates and troll-box sync are intentionally left as placeholders
until LNbits core exposes websocket support for WASM extensions.
- Extension ID:
streetfighterwasm - Extension type:
wasm - Minimum LNbits version:
1.5.5 - Admin route:
/ext/streetfighterwasm - Public game route:
/ext/streetfighterwasm/games/{game_id} - WASM module:
wasm/module.wasm
This extension requests:
ext.storage.readandext.storage.writefor settings, games, players, and payout state.ext.storage.read_publicfor the public match page.wallet.listso the admin UI can use the installing user's wallet.wallet.create_invoice_publicto create public join invoices.wallet.pay_invoiceto pay the winner's Lightning address.
- Open the StreetFighter extension in LNbits.
- Enable matches, choose the wallet, and set the haircut percentage.
- Create a match with a title and join amount.
- Share the public match link with two players.
- Each player enters a Lightning address and pays the join invoice.
- Settled payments assign the first player to Ryu and the second to Ken.
- The public page starts the local canvas fight once a paid player opens their private player-token URL.
- For now, the page can record the local player's win and the admin can settle payout from the games table.
Both sides use the player-1 controls because the intended realtime version will run each player on a separate device. Until websocket support is added, movement and chat are local placeholders rather than synchronized state.
From this extension's development directory:
cd lnbits/extensions/streetfighterwasm/dev
npm run build:wasmThe build writes the installable component to ../wasm/module.wasm.
Static UI changes in static/ do not require a WASM rebuild, but LNbits or the
browser may need a hard refresh to pick up changed assets.