Skip to content

Add two-secret identity recovery kits - #6539

Draft
jmecom wants to merge 9 commits into
mainfrom
jm/2skd-recovery
Draft

Add two-secret identity recovery kits#6539
jmecom wants to merge 9 commits into
mainfrom
jm/2skd-recovery

Conversation

@jmecom

@jmecom jmecom commented Aug 22, 2026

Copy link
Copy Markdown
Collaborator

Adds a versioned local 2SKD recovery kit for desktop identities. Recovery requires the encrypted .buzzbackup file, the user's password, and a separately stored random recovery code.

The desktop now saves the encrypted backup and can also generate a one-page printable recovery sheet. The PDF uses Buzz's wordmark and visual language on a white, ink-conscious layout. It includes the recovery code as text and a QR code, the public npub, and clear instructions to keep it separate from the encrypted backup.

The backup derives its encryption key from an Argon2id password half and an HKDF-SHA256 recovery-secret half, then encrypts the nsec with authenticated metadata. Raw key handling stays in native Rust, intermediate secrets are zeroized, and untrusted backup parameters are bounded before derivation.

The PDF never contains the password, nsec, or encrypted backup payload. Native code validates its inputs and writes both exported artifacts as exclusively created, owner-only files, then rereads the persisted bytes before reporting success.

Settings provides recovery-kit creation, verification, encrypted-backup export, and printable-sheet export. Onboarding can restore the kit while preserving existing NIP-49 imports.

This first slice is local-only. It does not add remote backup storage or a server-side reset path.

Tested with the Rust recovery-sheet and key-backup suites, clippy with warnings denied, desktop lint/type/file-size checks, an E2E production build, focused Playwright recovery flows, and a rendered PDF inspected at print resolution.

jmecom added 9 commits August 21, 2026 19:13
Signed-off-by: Jordan Mecom <jm@squareup.com>
Signed-off-by: Jordan Mecom <jm@squareup.com>
Signed-off-by: Jordan Mecom <jm@squareup.com>
Signed-off-by: Jordan Mecom <jm@squareup.com>
Signed-off-by: Jordan Mecom <jm@squareup.com>
Signed-off-by: Jordan Mecom <jm@squareup.com>
Signed-off-by: Jordan Mecom <jm@squareup.com>
Signed-off-by: Jordan Mecom <jm@squareup.com>
Signed-off-by: Jordan Mecom <jm@squareup.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant