Skip to content

TayGuangSheng/safepass

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SafePass+

SafePass+ is a prototype humanitarian financial system built on XRP Ledger (XRPL) devnet. It focuses on three failures during crisis: identity collapse, access to funds, and family coordination. This repo wires real XRPL flows to a Node/TypeScript backend and two demo UIs (Next.js NGO dashboard and a React Native community app).

Pitch video

Why this exists

In conflict and disaster, people lose documents, access to bank accounts, and the ability to safely receive aid. SafePass+ explores a different model: preserve identity and value on XRPL, distribute aid transparently, and keep families connected even when networks are unreliable.

What SafePass+ aims to prove

  • Unlosable identity: a portable identity pointer anchored on-ledger
  • Unstealable aid: timed, auditable delivery instead of opaque cash
  • Family protection: shared balances and controls for vulnerable members
  • Offline survival: QR vouchers and queued payments when connectivity drops
  • Fast remittances: cross-border transfers in seconds

How XRPL is used here

Crisis problem XRPL feature This repo's implementation
Lost identity AccountSet Domain (DID placeholder) Identity pointer stored on-ledger, points to mock credentials
Frozen funds XRP payments Wallet creation, funding, and transfers
Aid leakage Escrow Time-locked XRP escrows for scheduled releases
Family safety Off-ledger registry (future multi-sig) Family circles, joins, and in-family transfers
Offline constraints QR + local queue Offline payment queue synced when back online

Project layout

  • backend/ Node/TypeScript API that talks to XRPL
  • apps/mobile/ React Native demo app (community wallet actions)
  • apps/dashboard/ Next.js NGO dashboard demo

What is implemented today

  • XRPL wallet creation + funding (devnet/testnet faucet)
  • RLUSD-style issued token flow (trustline + issued payments)
  • Identity metadata pointer stored on XRPL account
  • Time-based escrow flow (XRP only)
  • Mock credential storage (local JSON)
  • Family circle linking (off-chain registry + join code)
  • Offline payment queue (QR creation + sync when online)
  • Identity recovery desk (challenge + biometric demo)
  • Registration desk (create wallet + identity before disbursement)
  • Family balance + transfers (summary + in-family RLUSD transfers)

What is planned (not implemented yet)

  • Real DID integration (XLS-40) and verifiable credential storage
  • Asset tokenization for property/skills (XLS-20)
  • Geofencing and timed release checks via oracle
  • Hardened offline mode with kiosk sync

Backend setup

cd backend
npm install
npm run dev

Env vars (optional):

# XRPL devnet by default
XRPL_WS_URL=wss://s.devnet.rippletest.net:51233
PORT=4000

Quick demo flow

  1. Create issuer + recipient wallets
  2. Add trustline from recipient to issuer
  3. Issue RLUSD test tokens
  4. Create escrow for scheduled aid
  5. Finish escrow after time lock
  6. Issue identity metadata to XRPL account

Sample requests:

# Run a full guided demo (creates wallets, trustline, RLUSD, escrow, identity)
curl -X POST http://localhost:4000/demo/setup \
  -H "Content-Type: application/json" \
  -d '{}'

# Create and fund a wallet
curl -X POST http://localhost:4000/wallets

# Trustline to issuer
curl -X POST http://localhost:4000/wallets/trustline \
  -H "Content-Type: application/json" \
  -d '{"seed":"s...","issuer":"r...","currency":"RLUSD","limit":"100000"}'

# Issue RLUSD
curl -X POST http://localhost:4000/rlusd/issue \
  -H "Content-Type: application/json" \
  -d '{"issuerSeed":"s...","destination":"r...","amount":"50","currency":"RLUSD"}'

# Create escrow (XRP only)
curl -X POST http://localhost:4000/escrow/create \
  -H "Content-Type: application/json" \
  -d '{"seed":"s...","destination":"r...","amountXrp":"1","finishAfterSeconds":3600}'

# Finish escrow (after time lock)
curl -X POST http://localhost:4000/escrow/finish \
  -H "Content-Type: application/json" \
  -d '{"seed":"s...","owner":"r...","offerSequence":123}'

# Issue identity metadata
curl -X POST http://localhost:4000/identity/issue \
  -H "Content-Type: application/json" \
  -d '{"subjectSeed":"s...","refugeeId":"family-4-aminah","credential":{"type":"RefugeeFamily","size":4}}'

# Get balances (XRP + issued tokens)
curl http://localhost:4000/accounts/r.../balances

# Create a family circle
curl -X POST http://localhost:4000/families/create \
  -H "Content-Type: application/json" \
  -d '{"name":"Family Circle","members":[{"address":"r...","label":"Caregiver"}]}'

# Join a family circle by code
curl -X POST http://localhost:4000/families/add-member \
  -H "Content-Type: application/json" \
  -d '{"familyIdOrCode":"FAM-XXXXXX","address":"r...","label":"Sibling"}'

# Family balance summary (RLUSD)
curl "http://localhost:4000/families/summary/FAM-XXXXXX?currency=RLUSD&issuer=r..."

# Transfer within family only
curl -X POST http://localhost:4000/families/transfer \
  -H "Content-Type: application/json" \
  -d '{"familyIdOrCode":"FAM-XXXXXX","seed":"s...","toAddress":"r...","amount":"5","currency":"RLUSD","issuer":"r..."}'

# Sync offline payments (when back online)
curl -X POST http://localhost:4000/offline/payments \
  -H "Content-Type: application/json" \
  -d '{"seed":"s...","payments":[{"destination":"r...","amount":"5","currency":"RLUSD","issuer":"rISSUER"}]}'

# Start identity recovery (demo)
curl -X POST http://localhost:4000/recovery/start \
  -H "Content-Type: application/json" \
  -d '{"recoveryId":"family-4-aminah"}'

# Complete identity recovery (demo passcode: SAFE)
curl -X POST http://localhost:4000/recovery/complete \
  -H "Content-Type: application/json" \
  -d '{"challengeId":"...","biometricCode":"SAFE"}'

# Register a new community member (onboarding)
curl -X POST http://localhost:4000/onboarding/register \
  -H "Content-Type: application/json" \
  -d '{"name":"Amina","familyName":"Amina Family","familySize":4,"issuerAddress":"r..."}'

Notes and limitations

  • XRPL Escrow only supports XRP. For RLUSD-style aid, this MVP uses XRP escrows for time locks and issued-token payments for the stable value leg.
  • Identity metadata uses AccountSet Domain as a simple, on-ledger pointer to off-chain credentials.
  • Issued currencies longer than 3 characters (like RLUSD) are encoded to 160-bit hex for XRPL transactions.
  • Family groups and offline queues are demo-only, stored locally or in backend JSON for clarity.
  • This is a prototype on devnet/testnet. Do not use with real funds or real personal data.

FAQ

Why XRP instead of a stablecoin? XRP provides global liquidity without an issuer. For crisis contexts, the goal is fast settlement and survivable value vs local hyperinflation. Stablecoins can still be added for aid rails, but XRP is the neutral settlement layer.

How does Ripple benefit? SafePass+ increases real transaction volume, validates XRPL features in extreme conditions, and creates a path for enterprise deployments (NGOs, governments, aid agencies). The value is in utility and adoption, not speculation.

Are there similar projects? There are limited pilots (voucher systems, crypto donations), but most lack identity, offline support, and family safety. SafePass+ focuses on end-to-end resilience rather than one-off payouts.

Next steps

  • Replace mock credential storage with IPFS or verifiable credential storage
  • Add biometric auth in the mobile app
  • Add geofencing checks via a backend oracle
  • Integrate proper DID and multi-sig guardianship flows

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages