[Feature]: Graphene phone backup and restore #128

Closed
opened 2026-07-29 15:07:58 +00:00 by ssmithx · 1 comment
Collaborator

Problem

Losing your phone and restoring it.
Wiping your phone to cross a border

Proposed Solution

Maybe part of the companion app or passport prime combo

Alternatives Considered

No response

Area

Other

### Problem Losing your phone and restoring it. Wiping your phone to cross a border ### Proposed Solution Maybe part of the companion app or passport prime combo ### Alternatives Considered _No response_ ### Area Other
chaum added the companion-agent label 2026-08-31 11:29:26 +00:00
Owner

Companion side shipped (branch companion/0.5.28, APK 0.5.28/vc48 — in on-device testing, ships with the release).

Phone side of "losing your phone / wiping it to cross a border":

  • Hub sub-page (Backup & Restore) with SAF export/import — a plain .json the user saves wherever they choose (GrapheneOS: no cloud, and none here either).
  • Payload is everything the app holds (servers + login passwords, FIPS identity/peers, remote-signer key), sealed in the node's ADR-005 envelope: Argon2id + ChaCha20-Poly1305, byte-compatible with core/archipelago/src/backup/identity.rs — node-shaped envelopes (did/pubkey/kid fields) decrypt there and back.
  • Restore is merge-only: servers upsert npub-first, mesh identity + signer key adopt only when absent, peers union by npub.

Code: Android/rust/archy-fips-core/src/backup.rs (+ NativeCore JNI), data/BackupManager.kt, ui/components/BackupSection.kt. Tests: host cargo test (round-trip, wrong passphrase, tampered blob, node-shape envelope, salt/nonce freshness). Doc: docs/companion-backup-restore.md.

Node-side storage/quota/scheduling deliberately out of scope per the 2026-08-30 triage — the envelope is a drop-in for the node's existing backup RPCs when that lands.

Companion side shipped (branch `companion/0.5.28`, APK 0.5.28/vc48 — in on-device testing, ships with the release). Phone side of "losing your phone / wiping it to cross a border": - Hub sub-page (**Backup & Restore**) with SAF export/import — a plain `.json` the user saves wherever they choose (GrapheneOS: no cloud, and none here either). - Payload is everything the app holds (servers + login passwords, FIPS identity/peers, remote-signer key), sealed in the node's **ADR-005 envelope**: Argon2id + ChaCha20-Poly1305, byte-compatible with `core/archipelago/src/backup/identity.rs` — node-shaped envelopes (did/pubkey/kid fields) decrypt there and back. - Restore is merge-only: servers upsert npub-first, mesh identity + signer key adopt only when absent, peers union by npub. Code: `Android/rust/archy-fips-core/src/backup.rs` (+ `NativeCore` JNI), `data/BackupManager.kt`, `ui/components/BackupSection.kt`. Tests: host `cargo test` (round-trip, wrong passphrase, tampered blob, node-shape envelope, salt/nonce freshness). Doc: `docs/companion-backup-restore.md`. Node-side storage/quota/scheduling deliberately out of scope per the 2026-08-30 triage — the envelope is a drop-in for the node's existing backup RPCs when that lands.
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: lfg2025/archy#128