Keygen
Please refer to the Session creation section to learn how to create a new session.
Full example
- ECDSA
- EdDSA
App.tsx
import { type EcdsaSession } from '@silencelaboratories/silent-shard-sdk';
export const keygen = async (session: EcdsaSession) => {
const keyshare = await session.keygen();
console.log('Created new keyshare with public key: ', keyshare.publicKeyHex);
};
App.tsx
import { type EddsaSession } from '@silencelaboratories/silent-shard-sdk';
export const keygen = async (session: EddsaSession) => {
const keyshare = await session.keygen();
console.log('Created new keyshare with public key: ', keyshare.publicKeyHex);
};
- When
session.keygen()is called, the app and the server exchange messages to generate a new MPC wallet. - Two new "shares" are generated: one for the client and one for the server. Both shares together form the MPC wallet.
keyshareis of type Keyshare and represents the client's "share" of the MPC wallet.- The
keyshare.publicKeyHexproperty is the public key of the MPC wallet in hex format.