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<sdk.DklsKeyshare> keygen(sdk.EcdsaSession session) async {
final sdk.DklsKeyshare keyshare = await session.keygen();
print('Keyshare created, public key: ${keyshare.publicKeyHex}');
return keyshare;
}
  • When session.keygen() is called, the app and the server exchange messages to generate a new MPC wallet.
  • Two new DklsKeyshare are generated: one for the client and one for the server. Both shares together form the MPC wallet.
  • The keyshare.publicKeyHex property is the public key of the MPC wallet in hex format.