Skip to main content

Key refresh

Key refresh generates new shares on mobile and server side, without changing the public key. Same address, same balance, same transaction history — only the share material changes. This is proactive security: even if an attacker captured a snapshot of the old share, it becomes useless after a refresh.

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

How the example does it

vault/.../session/VaultSessionManager.kt
suspend fun keyRefresh(keyId: String) {
val dao = readDao(keyId)
val keyshare = dao.currentKeyshare
?: throw Exception("No active keyshare found for keyId: $keyId")
sessionFor(dao.keyType).keyRefresh(keyshare).getOrThrow()
}

The SDK persists the new share via the registered storage client using the two-slot staged/current model. If the app is killed mid-refresh, the next launch picks up the staged share and commits it via the reconciliation pass.