Skip to main content

Keygen

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

Full example

main.dart
import 'package:silent_shard_sdk/silent_shard_sdk.dart' as sdk;

Future<void> keygen(sdk.EcdsaSession session) async {
final keyshare = await session.keygen();
print('Keyshare generated ${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.
  • keyshare is of type ECDSA Keyshare or EdDSA Keyshare and represents the client's "share" of the MPC wallet.
  • The keyshare.publicKeyHex property is the public key of the MPC wallet in hex format.