AppStateCloudBackup

Optional cross-device backup of host app state (e.g. Kicks match witnesses, draft data) — distinct from the wallet seed/identity (carried by the passkey, reconstructed locally) and from the dust checkpoint (DustCloudBackup).

The blob is encrypted under a key derived from the wallet seed (SeedDerivedKeyDeriver.deriveAppStateBackupKey), so backup and restore need only the in-hand seed — no per-backup passkey/biometric ceremony — which is what lets app-state backup run automatically in the background. The concrete implementation lives in sdk:wallet-runtime.

Best-effort + idempotent by contract: uploadAppState hash-guards a redundant upload (skips the write when unchanged); fetchAppState returns null on any problem so a caller degrades cleanly to "no app state".

Functions

Link copied to clipboard
abstract suspend fun clear()

Delete the cloud app-state blob and clear the local upload digest (#246 — true backup disable), so a later re-enable re-uploads instead of the hash-guard skipping. Best-effort; idempotent.

Link copied to clipboard
abstract suspend fun fetchAppState(): ByteArray?

The decrypted app metadata previously backed up, or null if none / unavailable.

Link copied to clipboard
abstract suspend fun uploadAppState(appMetadata: ByteArray)

Encrypt + store appMetadata; skips the write when unchanged since the last upload.