Skip to main content

Key recovery

Recovery rebuilds a lost device-side keyshare from the two remaining cloud parties. No export blob is needed — the input is just the public key of the share to recover. This is unique to trio's 2-of-3 threshold: as long as any two of the three parties still hold their shares, the third party can be rebuilt.

For the SDK contract see Key Recovery (Kotlin) and Key Recovery (Swift).

How the example does it

vault/.../session/VaultSessionManager.kt
suspend fun recovery(publicKey: ByteArray, keyType: KeyType): KeyResult {
val keyshare = sessionFor(keyType).recovery(publicKey).getOrThrow()

val keyId = extractKeyId(keyType, keyshare)
val recoveredPublicKey = extractPublicKey(keyType, keyshare)
return KeyResult(keyId, recoveredPublicKey)
}

The UI entry point is RecoveryScreen.kt — the user selects the key type (ECDSA or EdDSA), pastes the hex-encoded public key, and taps "Recover Keyshare."

How recovery differs from import

ImportRecovery
InputEncrypted export blob (from a previous export)Public key of the lost share
RequiresThe export fileTwo cloud parties still holding their shares
ResultFresh device share, same keyId/addressSame
Use caseMoving a wallet to a new device with a backup fileRebuilding after losing the device with no backup

Recovery is strictly more convenient (no file needed), but it only works in trio's 2-of-3 model — duo has no recovery because there's only one cloud party and one device party.

Recovery screen