Key Refresh
Update the client's and server's secret shares without altering the wallet's public address or key.
Step 1 : Create Session
- Create DuoSession if you haven't already.
Step 2 : Perform Key-Refresh
- Call
duoSession.keyRefresh()
which returns Result of Success with Refreshed-KeyshareByteArray
or Failure with exception.
Example
Example.kt
suspend fun performKeyRefresh(keyshare: ByteArray, duoSession: DuoSession): ByteArray {
return withContext(Dispatchers.IO) {
duoSession.keyRefresh(
keyshare = keyshare
).getOrThrow()
}
}
keyshare
is the client's "share" of the MPC wallet.duoSession.keyRefresh()
performs message exchange between mobile and server to "refresh" the MPC wallet. Refer to Key Refresh for more details.- Result of
duoSession.keyRefresh()
could be aSuccess
withByteArray
(client's new share of the MPC wallet) orFailure
withException
- 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.