Skip to main content

Keygen

This distributed key generation forms the basis for all subsequent MPC operations, providing a secure foundation for the wallet with enhanced privacy and security guarantees.

Step 1 : Create Session


Step 2 : Perform Keygen


  • Call trioSession.keygen() which returns Result of Success with a keyId (String) or Failure with exception.

Example


Example.kt
// keygen runs distributed key generation and returns the new keyId.
// The keyshare itself is persisted to your StorageClient — keep the keyId to
// address it in later operations (sign, refresh, export, delete, …).
suspend fun performKeygen(trioSession: TrioSession): String {
return withContext(Dispatchers.IO) {
trioSession.keygen().getOrThrow()
}
}
  • trioSession.keygen() performs message exchange between mobile and server to generate a new MPC wallet.
  • Three new "shares" are generated: one for the client(on mobile) and two for the respective servers(on server). All of the shares together form the MPC wallet.
  • Result of trioSession.keygen() could be a Success with a String (the keyId addressing the client's keyshare in your storage) or Failure with Exception
  • SilentShard.ECDSA.deriveChildPublicKey() or SilentShard.EdDSA.deriveChildPublicKey() could be used to get the compressed public key of the MPC wallet. Refer to SDK-Reference for additional Info and Utils.