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(
keyshare: ByteArray,
duoSession: DuoSession,
): ByteArray {
return withContext(Dispatchers.IO) {
//signature example for context
duoSession.signature(
keyshare = keyshare,
message = messageHash,
derivationPath = "m" // This is the default, use your desired path here. For e.g. 'm/1/2'
).getOrThrow()
// child public key derivation
SilentShard.ECDSA.deriveChildPublicKey(
keyshare = keyshare,
derivationPath = "m/1"
).getOrThrow()
}
}
Example.kt
suspend fun deriveChildPublicKeyUsingKeyshare(
keyshare: ByteArray,
duoSession: DuoSession,
): ByteArray {
return withContext(Dispatchers.IO) {
//signature example for context
duoSession.signature(
keyshare = keyshare,
message = messageHash,
derivationPath = "m" // This is the default, use your desired path here. For e.g. 'm/1/2'
).getOrThrow()
// child public key derivation
SilentShard.EdDSA.deriveChildPublicKey(
keyshare = keyshare,
derivationPath = "m/1"
).getOrThrow()
}
}
- When duoSession.signature() 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.