Skip to main content

Export 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';

export const exportKey = 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 privateKeyHex = await session.export({
keyshare,
});
console.log('Exported private key: ', privateKeyHex);
};
  • The export method takes a EcdsaExportConfig object as an argument.
    • keyshare is of type Keyshare and represents the client's share of the MPC wallet
  • privateKeyHex: The expored private key in hex format.