Skip to main content
Platform

Key Refresh

Rotate both keyshares without changing the wallet address. After a refresh, the previous shares no longer match the new ones, so they are invalidated and can no longer be used for signing.

Please refer to the Session creation section to learn how to create a new session.

Using the session object and an existing keyshare, refresh it to generate a new keyshare.

Full example:

App.tsx
import { type EcdsaSession } from '@silencelaboratories/silent-shard-sdk/ecdsa';

export const refresh = async (session: EcdsaSession) => {
// Creating a new keyshare for demo purpose. In real application, you can use an existing keyshare.
const keyshare = await session.keygen();
console.log('Keyshare: ', keyshare.keyIdHex);

const refreshedKeyshare = await session.refresh(keyshare);
console.log('Refreshed keyshare: ', refreshedKeyshare.keyIdHex);
};
  • When session.refresh(keyshare) is called, the app and the server exchange messages to "refresh" the MPC wallet. Refer to Key Refresh for more details.
  • 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.
  • The refreshedKeyshare object is of type Keyshare and represents the client's new share of the MPC wallet.

A refresh rewrites both shares, so an interrupted refresh could leave the device without a usable share. The reconcile protocol is the fallback that prevents this.