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
ResultofSuccesswith Child Public-Key bytes asDataor Failure witherror.
Example
- ECDSA
- EdDSA
Example.swift
// deriveChildPublicKey computes a child public key locally, without any MPC round.
// It takes keyshare bytes, which you read from your own StorageClient by keyId
// (the SDK owns keyshare storage). This is a public-key-only derivation — for a
// signable child keyshare use trioSession.hardDerivation(keyId:derivationPath:).
func deriveChildPublicKey(keyshare: Data) async -> Data? {
let result = await SilentShard.ECDSA.deriveChildPublicKey(
keyshare,
derivationPath: "m/1" // your desired BIP32 path
)
// returns nil if the operation fails, or handle it however your flow needs
switch result {
case .success(let childPublicKey):
// do something with the child public-key bytes
Swift.print(childPublicKey)
return childPublicKey
case .failure(let error):
// show the error to the user or abort the process
Swift.print(error)
return nil
}
}
Example.swift
// deriveChildPublicKey computes a child public key locally, without any MPC round.
// It takes keyshare bytes, which you read from your own StorageClient by keyId
// (the SDK owns keyshare storage).
func deriveChildPublicKey(keyshare: Data) async -> Data? {
let result = await SilentShard.EdDSA.deriveChildPublicKey(
keyshare,
derivationPath: "m/1" // your desired BIP32 path
)
// returns nil if the operation fails, or handle it however your flow needs
switch result {
case .success(let childPublicKey):
// do something with the child public-key bytes
Swift.print(childPublicKey)
return childPublicKey
case .failure(let error):
// show the error to the user or abort the process
Swift.print(error)
return nil
}
}
- When trioSession.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.