Skip to main content

Keygen

Keygen creates a new distributed key pair — one share stays on the device, the other lives on the cloud server. Neither party holds the full private key. The public key (and the derived blockchain address) are available immediately after keygen returns.

For the SDK contract see Keygen (Kotlin) and Keygen (Swift).

How the example does it

vault/.../session/VaultSessionManager.kt
suspend fun keygen(keyType: KeyType): KeyResult {
val keyshare = sessionFor(keyType).keygen().getOrThrow()
val keyId = extractKeyId(keyType, keyshare)
val publicKey = extractPublicKey(keyType, keyshare)
return KeyResult(keyId, publicKey)
}

The example does not persist the keyshare manually after keygen — the SDK writes it via the registered storage client automatically. The KeyResult returned contains the keyId (hex-encoded keyshare identifier) and the publicKey (used by the app layer for address derivation).

The session is selected by KeyType: SilentShard.ECDSA.createDuoSession(...) for Ethereum, SilentShard.EdDSA.createDuoSession(...) for Solana.

Wallet type selectionKeygen success