keygen

suspend fun keygen(): Result<String>

Generates a new distributed key through two-party MPC and returns its keyId.

Neither party learns the whole private key. The resulting keyshare is persisted to the session's StorageClient; address it in later operations by the returned keyId.

Keygen reconciles the new share internally (the staged share becomes the active one). If that final step is interrupted — a dropped connection or a crash — the share remains staged and reconcile completes it without repeating the expensive MPC computation.

Return

the hex-encoded keyId of the new key.

See also

for completing an interrupted keygen.