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 duoSession.keygen() which returns Result of Success with Keyshare ByteArray or Failure with exception.

Example


Example.kt
suspend fun performKeygen(duoSession: DuoSession): ByteArray {
return withContext(Dispatchers.IO) {
duoSession.keygen().getOrThrow()
}
}
  • duoSession.keygen() performs message exchange between mobile and server to generate a new MPC wallet.
  • Two new "shares" are generated: one for the client(on mobile) and one for the server(on server). Both shares together form the MPC wallet.
  • Result of duoSession.keygen() could be a Success with ByteArray (client's keyshare) or Failure with Exception
  • SilentShard.ECDSA.getKeysharePublicKey or SilentShard.EdDSA.getKeysharePublicKey could be used to get the compressed public key of the MPC wallet. Refer to SDK-Reference for additional Info and Utils.