Bit Lazarus is a hackathon demo for recovering a dead torrent with a bonded requester/hunter flow.
The demo flow is:
- A requester creates a bounty from a real
.torrentfile. - The backend funds the requester escrow from a Polar-backed Lightning node.
- A hunter joins the bounty.
- The requester creates the delivery contract.
- Both sides lock bonds.
- The hunter seeds the recovered file over WebTorrent.
- The requester downloads it, hashes it, and the backend settles if the SHA-256 matches.
- Node
>=20 - Polar
This repo includes the Polar network export you should use for the demo:
In Polar:
- Import
bit-lazarus.polar.zip - Start the network
- Load the nodes with funds before running the app
The imported network is expected to provide:
lazarusfor the app backendrequesterfor requester-side demo paymentshunterfor hunter-side demo payments
npm installStart the backend from the repo root:
WALLET_AUTH_BACKEND=bitcoin-cli \
BITCOIN_CLI_CHAIN=regtest \
BITCOIN_CLI_RPCCONNECT=127.0.0.1 \
BITCOIN_CLI_RPCPORT=18443 \
BITCOIN_CLI_RPCUSER=polaruser \
BITCOIN_CLI_RPCPASSWORD=polarpass \
LIGHTNING_BACKEND=lnd-rest \
LIGHTNING_LND_REST_URL='https://127.0.0.1:8084' \
LIGHTNING_LND_MACAROON_HEX="$(xxd -p -c 999999 ~/.polar/networks/1/volumes/lnd/lazarus/data/chain/bitcoin/regtest/admin.macaroon | tr -d '\n')" \
LIGHTNING_LND_TLS_SKIP_VERIFY=1 \
POLAR_DEMO_REQUESTER_LND_REST_URL='https://127.0.0.1:8085' \
POLAR_DEMO_REQUESTER_LND_MACAROON_HEX="$(xxd -p -c 999999 ~/.polar/networks/1/volumes/lnd/requester/data/chain/bitcoin/regtest/admin.macaroon | tr -d '\n')" \
POLAR_DEMO_REQUESTER_LND_TLS_SKIP_VERIFY=1 \
POLAR_DEMO_HUNTER_LND_REST_URL='https://127.0.0.1:8081' \
POLAR_DEMO_HUNTER_LND_MACAROON_HEX="$(xxd -p -c 999999 ~/.polar/networks/1/volumes/lnd/hunter/data/chain/bitcoin/regtest/admin.macaroon | tr -d '\n')" \
POLAR_DEMO_HUNTER_LND_TLS_SKIP_VERIFY=1 \
POLAR_DEMO_BITCOIN_RPC_URL='http://127.0.0.1:18443' \
POLAR_DEMO_BITCOIN_RPC_USER='polaruser' \
POLAR_DEMO_BITCOIN_RPC_PASSWORD='polarpass' \
POLAR_DEMO_REQUESTER_BITCOIN_WALLET='requester-auth' \
POLAR_DEMO_HUNTER_BITCOIN_WALLET='hunter-auth' \
WEBTORRENT_TRACKER_HOST='127.0.0.1' \
WEBTORRENT_TRACKER_PORT='8001' \
WEBTORRENT_TRACKER_PUBLIC_HOST='127.0.0.1' \
WEBTORRENT_TRACKER_PUBLIC_PORT='8001' \
PORT=3000 \
DATA_DIR=./data/polar-demo \
npm startThe backend runs on:
http://127.0.0.1:3000
In a second terminal:
npm run frontend:devOpen the Vite URL it prints, usually:
http://127.0.0.1:5173
Use two separate browser profiles or one normal window plus one private window.
On the Home page:
- click
Login as Requesterin one browser profile - click
Login as Hunterin the other
Those buttons use the backend's Polar/Bitcoin Core integration, so no shell auth step or token copy/paste is needed.
Use the bundled fixture files:
- Log in as requester and hunter in separate browser profiles.
- As requester, create a bounty with
fixture-a.torrent. - As hunter, open the bounty and click
Hunt bounty. - As requester, create the delivery contract.
- As hunter, create and register the payout invoice.
- Both sides pay their bond from Polar.
- As hunter, load
fixture-a.bin, commit the SHA-256, and start seeding. - As requester, start the download.
- After the download completes, save the file with
Download recovered file.
npm test
npm run frontend:buildWon 1st place at MIT Bitcoin Hackathon