Skip to content

About

Split shared expenses and settle instantly with NIM inside Nimiq Pay

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Roundtrip

Split the trip. Settle in a tap.

Roundtrip is a mobile-first Nimiq Pay Mini App for tracking shared expenses and settling the final balance directly in NIM. It removes the two awkward parts of a group trip: figuring out who owes whom and asking everyone to open a separate payment app.

Roundtrip cover

Roundtrip product screens

Live demo

Open the web demo and tap Explore a demo. To test a real payment, open the same URL as a Mini App inside Nimiq Pay.

Why it exists

Shared-expense tools usually stop at the IOU. Roundtrip closes the loop:

  1. Add an expense in seconds.
  2. Split it across any combination of friends.
  3. Let the settlement engine minimize the required transfers.
  4. Pay the suggested recipient through Nimiq Pay with an attached trip memo.

No account, email, or backend is required. Trip data stays on-device until the user explicitly exports it or creates a compressed share link.

Features

  • Nimiq Pay wallet connection with listAccounts()
  • Native NIM transfer with sendBasicTransactionWithData()
  • Integer-Luna accounting to avoid floating-point money errors
  • Zero-sum balance engine and minimized settlement routes
  • Uneven participant selection per expense
  • Shareable compressed trip snapshots, QR codes, and Nimiq Pay deeplinks
  • Identity selection when joining a shared trip
  • Offline-first PWA with on-device persistence
  • Portable JSON import/export
  • Graceful web demo mode outside Nimiq Pay
  • Responsive, accessible mobile UI with reduced-motion support
  • Nimiq Pay language detection ready through window.nimiqPay.language

Privacy and security

Roundtrip has no backend, analytics, trackers, or private-key access. Wallet actions are requests to Nimiq Pay; the host wallet shows its native approval UI before a transaction can be sent. Share links contain a compressed snapshot of the visible trip data, and the app makes that explicit before sharing. See PRIVACY.md.

Run locally

Requirements: Node.js 20+

npm install
npm run dev

Then open http://localhost:5173. For device testing, Vite also exposes the app on your LAN; enter that URL in Nimiq Pay under Mini Apps.

Quality checks

npm test
npm run build
npm audit

The test suite covers money conversion, zero-sum balances, settlement minimization, and Unicode-safe share serialization. GitHub Actions repeats tests and the production build, while Vercel deploys the connected main branch.

Architecture

React + TypeScript
├── Local trip state (localStorage)
├── Integer-Luna settlement engine
├── Compressed URL / QR snapshots
├── @nimiq/mini-app-sdk
│   ├── listAccounts
│   ├── isConsensusEstablished
│   └── sendBasicTransactionWithData
└── Vite PWA → Vercel

The detailed submission package, demo script, and launch copy are in docs/.

License

MIT

About

Split shared expenses and settle instantly with NIM inside Nimiq Pay

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages