Skip to main content

Import

Import takes a previously exported private key and runs an internal keygen that derives fresh shares for all parties from those raw key bytes. The output is a wallet with the same keyId, public key, and blockchain address as the original — but the on-disk share bytes are new.

For the SDK contract see Import Key (Kotlin) and Import Key (Swift).

How the example does it

vault/.../session/VaultSessionManager.kt
suspend fun importKeyshare(privateKey: ByteArray, keyType: KeyType): KeyResult {
val keyId = sessionFor(keyType).import(keysharePrivateKey = privateKey).getOrThrow()
val publicKey = extractPublicKey(keyId)
return KeyResult(keyId, publicKey)
}

Note: trio's import takes only privateKey (no rootChainCode parameter, unlike duo). The SDK auto-persists the new keyshare via the registered storage client.

Import screen