BIP32 Support
We support generating signatures for a BIP32 child key. Perform keygen once, and generate signatures for all BIP32 child keys!
Perform Derive Child Public-Key
- Call SilentShard.ECDSA.deriveChildPublicKey() or SilentShard.EdDSA.deriveChildPublicKey() which returns Result of Success with Child Public-Key ByteArray or Failure with exception.
Example
- ECDSA
- EdDSA
Example.kt
suspend fun deriveChildPublicKeyUsingKeyshare(
keyId: String,
duoSession: DuoSession,
): ByteArray {
return withContext(Dispatchers.IO) {
//signature example for context
duoSession.sign(
keyId = keyId,
message = messageHash,
derivationPath = "m" // This is the default, use your desired path here. For e.g. 'm/1/2'
).getOrThrow()
// child public key derivation runs on keyshare bytes — read them from your
// StorageClient by keyId.
val keyshare = (storageClient.read(keyId) as ReconcileStoreDao).currentKeyshare!!
SilentShard.ECDSA.deriveChildPublicKey(
keyshare = keyshare,
derivationPath = "m/1"
).getOrThrow()
}
}
Example.kt
suspend fun deriveChildPublicKeyUsingKeyshare(
keyId: String,
duoSession: DuoSession,
): ByteArray {
return withContext(Dispatchers.IO) {
//signature example for context
duoSession.sign(
keyId = keyId,
message = messageHash,
derivationPath = "m" // This is the default, use your desired path here. For e.g. 'm/1/2'
).getOrThrow()
// child public key derivation runs on keyshare bytes — read them from your
// StorageClient by keyId.
val keyshare = (storageClient.read(keyId) as ReconcileStoreDao).currentKeyshare!!
SilentShard.EdDSA.deriveChildPublicKey(
keyshare = keyshare,
derivationPath = "m/1"
).getOrThrow()
}
}
- When duoSession.sign() is called with a
derivationPath, the signature is generated for the specified BIP32 derivation path. derivationPathis a string that specifies the path to the child key. It defaults to 'm' (no derivation) if not provided.