Inspiration

Mauritius welcomed about 1.38 million tourist arrivals in 2024, and many of the best experiences come from small independent guides: a hiking guide at Le Morne, a boat operator at Blue Bay, a family guiding at Chamarel. Today they take a deposit by bank transfer, which is slow and expensive for foreign cards, or they take none and lose the day when a guest doesn't show. Travellers lose deposits when a cyclone cancels the tour, and the season runs from November to April. And more and more trips are now planned by AI agents. Who controls what they spend?

What it does

GuideSats lets an AI travel agent book a guide and pay them in sats over Lightning, under rules the agent can't change.

  • A mandate only the traveller approves: a cap, the guide's key, a time window and one payment only. The agent has no tool to approve a mandate or raise a cap.
  • Locked, not sent: the sats wait in a hold invoice. The traveller's phone keeps a secret and sends only its hash. At the meeting point the traveller shows the code as a QR, and the guide settles and is paid.
  • Cyclone refund: if a GDACS alert for Mauritius fires before the tour, the hold is cancelled and the traveller is refunded automatically. If the tour never happens, the hold expires and the sats return.
  • Plan B: for wallets without hold invoices, the same mandate pays after the tour, once the traveller confirms it happened.
  • English and French, built for 360 px phones and low bandwidth.

How we built it

  • Node 22 and TypeScript, with Nostr Wallet Connect through @getalby/sdk (NWC-03 hold invoices).
  • Every invoice is decoded with light-bolt11-decoder and checked before anything is paid: network, exact amount, hash, expiry, and the payee key recovered from the signature with @noble/curves. One choke point does all the paying.
  • A rule-based planner drives the agent, so no LLM key is needed and the money path never depends on one.
  • A Preact PWA of 44 KB (about 16 KB gzipped), live updates over Server-Sent Events, light and dark mode.

Security by design

  • A threat model with 19 threats, each mapped to its mitigation and the test that covers it (SECURITY.md).
  • A property test throws 500 random sequences of up to 40 agent tool calls at the app: forged, replayed and swapped invoices, clock jumps, cyclone flips. It checks on the ledger that the traveller never paid above a cap, a payee outside the mandate, or twice. Switching off any check makes it fail.
  • Least-privilege NWC connections, secrets only in environment variables, the preimage never leaves the traveller's phone, and every log line goes through a redactor with a snapshot test.

Challenges we ran into

On real wallets a hold invoice only lives until the wallet's settle deadline, and that turned out to be a block height about 24 blocks ahead, roughly 4 hours, not a fixed time. So GuideSats records only the approved mandate at booking, locks the sats in the 50 minutes before the tour, and cancels at once any hold that couldn't last until the meeting. Payments with an unclear outcome are resolved from the guide's wallet, never from error text.

Accomplishments that we're proud of

  • The full app ran over Nostr Wallet Connect on Alby's NWC Faucet test wallets: sats locked, settled and refunded end to end, as the video shows.
  • On screen, every attempt to push the agent to overspend is refused before any wallet is called.
  • 207 tests, and a one-command demo: npm install && npm run demo.

What we learned

An AI agent is safe with money only when the limits live outside it. The mandate, the invoice checks and the hold invoice carry the trust, so neither the traveller nor the guide has to trust the agent.

What's next for GuideSats

  • A pilot with 20 guides at about 5 tours a week, around 100 bookings a week.
  • The traveller and the guide on two separate nodes, and wallet-enforced budgets (NWC-13).
  • The Mauritius Meteorological Services warnings as a second cyclone feed.
  • A Kreol Morisien interface, and an optional LLM planner behind the same tools.
  • The same flow fits any coastal or seasonal tourism market in Africa, Senegal included.

Built With

  • alby
  • bolt11
  • fast-check
  • gdacs
  • lightning-network
  • node.js
  • nostr-wallet-connect
  • playwright
  • preact
  • pwa
  • typescript
  • vitest
Share this project:

Updates

Submission history