pub trait ExternalSigner: Send + Sync {
Show 19 methods
// Required methods
fn identity_public_key(&self) -> Result<PublicKeyBytes, SignerError>;
fn derive_public_key<'life0, 'async_trait>(
&'life0 self,
path: String,
) -> Pin<Box<dyn Future<Output = Result<PublicKeyBytes, SignerError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn sign_ecdsa<'life0, 'async_trait>(
&'life0 self,
message: Vec<u8>,
path: String,
) -> Pin<Box<dyn Future<Output = Result<EcdsaSignatureBytes, SignerError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn sign_ecdsa_recoverable<'life0, 'async_trait>(
&'life0 self,
message: Vec<u8>,
path: String,
) -> Pin<Box<dyn Future<Output = Result<RecoverableEcdsaSignatureBytes, SignerError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn ecies_encrypt<'life0, 'async_trait>(
&'life0 self,
message: Vec<u8>,
path: String,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, SignerError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn ecies_decrypt<'life0, 'async_trait>(
&'life0 self,
message: Vec<u8>,
path: String,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, SignerError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn sign_hash_schnorr<'life0, 'async_trait>(
&'life0 self,
hash: Vec<u8>,
path: String,
) -> Pin<Box<dyn Future<Output = Result<SchnorrSignatureBytes, SignerError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn generate_frost_signing_commitments<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<ExternalFrostCommitments, SignerError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_public_key_for_node<'life0, 'async_trait>(
&'life0 self,
id: ExternalTreeNodeId,
) -> Pin<Box<dyn Future<Output = Result<PublicKeyBytes, SignerError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn generate_random_key<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<ExternalPrivateKeySource, SignerError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_static_deposit_private_key_source<'life0, 'async_trait>(
&'life0 self,
index: u32,
) -> Pin<Box<dyn Future<Output = Result<ExternalPrivateKeySource, SignerError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_static_deposit_private_key<'life0, 'async_trait>(
&'life0 self,
index: u32,
) -> Pin<Box<dyn Future<Output = Result<PrivateKeyBytes, SignerError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_static_deposit_public_key<'life0, 'async_trait>(
&'life0 self,
index: u32,
) -> Pin<Box<dyn Future<Output = Result<PublicKeyBytes, SignerError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn subtract_private_keys<'life0, 'async_trait>(
&'life0 self,
signing_key: ExternalPrivateKeySource,
new_signing_key: ExternalPrivateKeySource,
) -> Pin<Box<dyn Future<Output = Result<ExternalPrivateKeySource, SignerError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn split_secret<'life0, 'async_trait>(
&'life0 self,
secret: ExternalSecretToSplit,
threshold: u32,
num_shares: u32,
) -> Pin<Box<dyn Future<Output = Result<Vec<ExternalVerifiableSecretShare>, SignerError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn encrypt_private_key_for_receiver<'life0, 'async_trait>(
&'life0 self,
private_key: ExternalEncryptedPrivateKey,
receiver_public_key: PublicKeyBytes,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, SignerError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_public_key_from_private_key_source<'life0, 'async_trait>(
&'life0 self,
private_key: ExternalPrivateKeySource,
) -> Pin<Box<dyn Future<Output = Result<PublicKeyBytes, SignerError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn sign_frost<'life0, 'async_trait>(
&'life0 self,
request: ExternalSignFrostRequest,
) -> Pin<Box<dyn Future<Output = Result<ExternalFrostSignatureShare, SignerError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn aggregate_frost_signatures<'life0, 'async_trait>(
&'life0 self,
request: ExternalAggregateFrostRequest,
) -> Pin<Box<dyn Future<Output = Result<ExternalFrostSignature, SignerError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
External signer trait that can be implemented by users and passed to the SDK.
This trait mirrors the BreezSigner trait but uses FFI-compatible types (bytes, strings)
instead of Rust-specific types. This allows it to be exposed through FFI and WASM bindings.
All methods accept and return simple types:
- Derivation paths as strings (e.g., “m/44’/0’/0’”)
- Public keys, signatures, and other crypto primitives as Vec
- Spark-specific types as serialized representations
Errors are returned as SignerError for FFI compatibility.
Required Methods§
Sourcefn identity_public_key(&self) -> Result<PublicKeyBytes, SignerError>
fn identity_public_key(&self) -> Result<PublicKeyBytes, SignerError>
Returns the identity public key as 33 bytes (compressed secp256k1 key).
Sourcefn derive_public_key<'life0, 'async_trait>(
&'life0 self,
path: String,
) -> Pin<Box<dyn Future<Output = Result<PublicKeyBytes, SignerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn derive_public_key<'life0, 'async_trait>(
&'life0 self,
path: String,
) -> Pin<Box<dyn Future<Output = Result<PublicKeyBytes, SignerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sourcefn sign_ecdsa<'life0, 'async_trait>(
&'life0 self,
message: Vec<u8>,
path: String,
) -> Pin<Box<dyn Future<Output = Result<EcdsaSignatureBytes, SignerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn sign_ecdsa<'life0, 'async_trait>(
&'life0 self,
message: Vec<u8>,
path: String,
) -> Pin<Box<dyn Future<Output = Result<EcdsaSignatureBytes, SignerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sourcefn sign_ecdsa_recoverable<'life0, 'async_trait>(
&'life0 self,
message: Vec<u8>,
path: String,
) -> Pin<Box<dyn Future<Output = Result<RecoverableEcdsaSignatureBytes, SignerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn sign_ecdsa_recoverable<'life0, 'async_trait>(
&'life0 self,
message: Vec<u8>,
path: String,
) -> Pin<Box<dyn Future<Output = Result<RecoverableEcdsaSignatureBytes, SignerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sourcefn ecies_encrypt<'life0, 'async_trait>(
&'life0 self,
message: Vec<u8>,
path: String,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, SignerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn ecies_encrypt<'life0, 'async_trait>(
&'life0 self,
message: Vec<u8>,
path: String,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, SignerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sourcefn ecies_decrypt<'life0, 'async_trait>(
&'life0 self,
message: Vec<u8>,
path: String,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, SignerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn ecies_decrypt<'life0, 'async_trait>(
&'life0 self,
message: Vec<u8>,
path: String,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, SignerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sourcefn sign_hash_schnorr<'life0, 'async_trait>(
&'life0 self,
hash: Vec<u8>,
path: String,
) -> Pin<Box<dyn Future<Output = Result<SchnorrSignatureBytes, SignerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn sign_hash_schnorr<'life0, 'async_trait>(
&'life0 self,
hash: Vec<u8>,
path: String,
) -> Pin<Box<dyn Future<Output = Result<SchnorrSignatureBytes, SignerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sourcefn generate_frost_signing_commitments<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<ExternalFrostCommitments, SignerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn generate_frost_signing_commitments<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<ExternalFrostCommitments, SignerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Generates Frost signing commitments for multi-party signing.
§Returns
Frost commitments with nonces, or a SignerError
Sourcefn get_public_key_for_node<'life0, 'async_trait>(
&'life0 self,
id: ExternalTreeNodeId,
) -> Pin<Box<dyn Future<Output = Result<PublicKeyBytes, SignerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_public_key_for_node<'life0, 'async_trait>(
&'life0 self,
id: ExternalTreeNodeId,
) -> Pin<Box<dyn Future<Output = Result<PublicKeyBytes, SignerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sourcefn generate_random_key<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<ExternalPrivateKeySource, SignerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn generate_random_key<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<ExternalPrivateKeySource, SignerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Generates a random private key.
§Returns
A randomly generated private key source, or an error string