Skip to main content
Platform

Key Recovery

Restore the client's secret shares to regain access to the wallet without changing its public address or key.

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

Full example:

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

export const recovery = 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 recoveredKeyshare = await session.recovery(keyshare.publicKeyHex);
console.log('Recovered keyshare: ', recoveredKeyshare.keyIdHex);
};
  • When session.recovery(keyshare) is called, the app and the server exchange message to "recover" the MPC wallet. Refer to Key Recovery for more details.
  • publicKeyHex is the public key of the client's share of the MPC wallet to be recovered.
  • 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.
  • recoveredKeyshare is of type Keyshare and represents the client's new share of the MPC wallet.