Files
base/docs/firebase-migration.md

2.6 KiB

# Firebase to Web5
## Migration paper

## Surface mapping

| Firebase | Web5 / Lux / Base equivalent |
|---|---|
| Auth | DID + passkey-friendly device identity + capability sessions |
| Firestore / Realtime DB | Encrypted SQLite vault + CRDT log |
| Cloud Storage | Encrypted blob providers |
| Cloud Functions | Worker/event layer on vault, sync, or anchor events |
| Security Rules | Capability policy + chain receipts |
| Hosting lock-in | Provider portability + local-first execution |

## Migration strategy

1. Add a local vault and make the client authoritative for immediate writes.
2. Introduce CRDT sync and snapshot/export.
3. Replace auth with device-rooted keys, capabilities, and optional credentials.
4. Move recovery and key wrapping into the trust layer.
5. Add provider choice and anchor receipts.
6. Add threshold and confidential features only where product value is obvious.

## The critical product rule

Do not make developers think they are adopting a blockchain database.
The migration should feel like adopting a better backend/runtime.

## The developer promise

- fast local reads
- offline support
- portable auth and recovery
- replaceable providers
- collaborative sync
- auditable trust boundaries

## Source notes

Primary and standards-oriented sources used throughout these documents: