element-x-ada/docs/build-logs/ssss-roundtrip-result.md

4 KiB

SSSS Wallet Backup Round-Trip Test Results

Date: 2026-03-29
Tester: Kayos (subagent)
Build: phase1-dev @ 75edbd5499

Summary

Backup to SSSS: PASSED
⚠️ Restore from SSSS: INCOMPLETE (needs delete wallet implementation)

Test Environment

  • Emulator: Samsung Galaxy S10 (Android 14)
  • Container: android-emulator on Lucy
  • Account: @testbot-elementx:sulkta.com
  • Network: Preprod Testnet

Wallet Under Test

  • Mnemonic: (stored in /root/.openclaw/workspace/memory/wallet-mnemonic.txt)
  • Expected Address: addr_test1qzl3rfpsnejf5wjey74yxz8jzduqzxfq3ze6xsgfcrrt03dlmpn40atetazzuywm6eseptz3eh9z7y7tevgtmujwy3ussnvev7
  • Verified: Address matches

Backup Test (Step 3)

UI Flow

  1. Opened wallet panel via DM room → wallet icon
  2. Navigated to Settings tab
  3. Tapped "Backup to Matrix" button (NEW)
  4. Entered recovery key: b4a67d93602ec7741b743839c00c9cec902d8f709c6e22df98124606249e07b0
  5. Tapped "Backup" button

Result

SUCCESS

Logcat output:

elementx: Wallet seed backed up to SSSS | WalletBackupServiceImpl.kt:37
elementx: Wallet backed up to SSSS successfully | WalletPanelPresenter.kt:176

Verification

Matrix account data stored at com.sulkta.cardano.wallet_seed:

{
  "encrypted": {
    "5b8ac89548308c51": {
      "iv": "PgPZ2DjObIJfdXVCa+diag",
      "ciphertext": "y1QvCtCJ+6WLmOLJTASU9zy5wuwIJveKNftS8hn9WuUvnudz6ICtwZFUbOPZpvpio3uq412L6BEWZd3Q3kIOfZT9RQhtCSTZFWOImOOrrigxdSx+MXxjIgqm+kc4zL8OLRLSbGYRamFSx6wXPEAzp+/V5vGD0IfsTOGzyGGg5tWcNxqHcmoNy9YTnBOGvafbCEBa3BPFYr86zIe3OPUB",
      "mac": "1ML2/NUoK6+Lm6MhwW6OOrtQ+g1nq0pExv78e2T5ruc"
    }
  }
}
  • Key ID 5b8ac89548308c51 matches expected recovery key ID
  • Ciphertext is properly encrypted with SSSS
  • MAC present for integrity verification

Delete/Restore Test (Steps 4-5)

Blocker

The "Delete Wallet" button doesn't trigger a confirmation dialog or actual deletion in the current implementation. The event handler has placeholder comments:

WalletPanelEvent.DeleteWallet -> {
    // Show confirmation dialog - handled elsewhere
}

What's Needed

  1. Implement delete confirmation dialog in WalletPanelView
  2. Add actual delete logic in presenter (call keyStorage.deleteWallet())
  3. Detect existing SSSS backup on setup screen to offer restore option

Code Changes Made

Files Modified/Created

  1. WalletPanelState.kt - Added backup state properties:

    • showBackupDialog: Boolean
    • backupMode: BackupMode
    • backupInProgress: Boolean
    • backupError: String?
    • backupSuccess: String?
  2. WalletPanelEvent.kt - Added backup events:

    • ShowBackupDialog
    • ShowRestoreDialog
    • DismissBackupDialog
    • ConfirmBackup(recoveryKey: String)
    • ConfirmRestore(recoveryKey: String)
    • ClearBackupMessage
  3. WalletPanelPresenter.kt - Added backup handling:

    • Injected WalletBackupService and CardanoKeyStorage
    • Implemented backup flow with key normalization
    • Implemented restore flow (untested due to delete blocker)
  4. WalletPanelView.kt - Added:

    • BackupRecoveryKeyDialog composable
    • Dialog shows when state.showBackupDialog == true
  5. SettingsTabView.kt - Added:

    • "Backup to Matrix" button with Cloud icon
    • onBackupToMatrix callback
  6. strings.xml - Added backup-related strings

Commit

feat(wallet): Add SSSS backup functionality
75edbd5499 on phase1-dev

Fresh APK Available

URL: http://192.168.0.5:8888/app-fdroid-arm64-v8a-debug.apk
Size: 220MB (arm64)

Next Steps

  1. Implement Delete Wallet - Add confirmation dialog and actual deletion
  2. Implement Restore Detection - Check for SSSS backup on wallet setup screen, offer restore option
  3. Test Full Round-Trip - Delete wallet → Restore from SSSS → Verify address matches
  4. Edge Cases - Test with wrong recovery key, corrupted backup, etc.

Screenshots

Final state: Settings tab showing "Backup to Matrix" button after successful backup.