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 TrioSession if you haven't already.
Step 2 : Perform Key-Refresh
- Call trioSession.keyRefresh() which returns
ResultofSuccesswith Refreshed-Keyshare bytes asDataorFailurewitherror.
Example
Example.swift
func performKeyRefresh(keyshare: Data, trioSession: TrioSession) async -> Data?
{
let result = await trioSession.keyRefresh(
keyshare: keyshare
)
// returns nil if operation fails or other flow you might have
switch result {
case .success(let dataBytes):
do {
// do something with bytes
Swift.print(dataBytes)
return dataBytes
}
case .failure(let error):
do {
// show error to user or abort process
Swift.print(error)
return nil
}
}
}
keyshareis the client's "share" of the MPC wallet.- trioSession.keyRefresh() performs message exchange between mobile and server to "refresh" the MPC wallet. Refer to Key Refresh for more details.
- Result of trioSession.keyRefresh() could be a
Successwith bytes asData(client's new share of the MPC wallet) orFailurewitherror - 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.