Skip to main content

Key Refresh

Update the client's and server's secret shares without altering the wallet's public address or key.

Step 1 : Create Session


Step 2 : Perform Key-Refresh


  • Call trioSession.refresh() which returns Result of Success with Refreshed-Keyshare ByteArray or Failure with exception.

Example


Example.kt
// refresh rotates the keyshares of the key addressed by keyId without changing
// its public key. The refreshed share is persisted to your StorageClient under
// the same keyId; the refreshed keyshare bytes are also returned.
suspend fun performKeyRefresh(keyId: String, trioSession: TrioSession): ByteArray {
return withContext(Dispatchers.IO) {
trioSession.refresh(
keyId = keyId
).getOrThrow()
}
}
  • keyId identifies the key to refresh; it is returned by keygen and stays the same after the refresh.
  • trioSession.refresh() performs message exchange between mobile and server to "refresh" the MPC wallet. Refer to Key Refresh for more details.
  • Result of trioSession.refresh() could be a Success with ByteArray (client's new share of the MPC wallet) or Failure with Exception
  • This process enhances the long-term security of the MPC wallet by proactively updating the client's and server's secret shares.
  • The wallet's public address or key remains unchanged during this process.