EasySwap is a self-custodial LNbits extension for swapping between Lightning and Bitcoin through a visitor-owned Spark wallet.
- Lightning to on-chain: the visitor supplies a Bitcoin address and pays a BOLT11 invoice generated by their browser's Spark wallet. Once received, Spark pays the 0.3% tribute and cooperatively exits the remainder to the address.
- On-chain to Lightning: the visitor supplies a fixed-amount, long-lived BOLT11 invoice and deposits bitcoin to their Spark static deposit address. After the Spark SDK reports the deposit as claimable, the browser claims it, waits for Spark to report the balance as available, pays the 0.3% tribute, and then pays the supplied invoice.
The recovery phrase is generated from browser entropy, encrypted with a local
password, and stored only in browser localStorage. Swap progress is also saved
locally and resumes when the same browser unlocks the wallet again. The LNbits
backend stores only operator-configured amount limits and network. Deposit
discovery and readiness come directly from Spark; no block explorer is configured.
cd dev
npm install
npm run check
npm run buildThe production browser bundle is written to static/public.js.