pub trait Signer<H: Hashable> {
// Required methods
fn sign(
&mut self,
kp: &Keypair,
input: &H,
nonce_mode: NonceMode,
) -> Signature;
fn verify(&mut self, sig: &Signature, pub_key: &PubKey, input: &H) -> bool;
}Expand description
Interface for signed objects
Signer interface for signing [Hashable] inputs and verifying
Signatures using Keypairs and
PubKeys
Required Methods§
Sourcefn sign(&mut self, kp: &Keypair, input: &H, nonce_mode: NonceMode) -> Signature
fn sign(&mut self, kp: &Keypair, input: &H, nonce_mode: NonceMode) -> Signature
Sign input (see [Hashable]) using keypair kp and return the
corresponding signature.
§Parameters
kp- The keypair to use for signinginput- The message to sign (must implement [Hashable])nonce_mode- Controls nonce derivation method:NonceMode::Legacy: For user commands (payments, delegations)NonceMode::Chunked: For zkApp transactions (o1js compatible)
§Returns
A Signature over the input message.