pub trait TransactionAuthenticator {
// Required methods
fn get_signature(
&self,
pub_key_commitment: PublicKeyCommitment,
signing_inputs: &SigningInputs,
) -> impl FutureMaybeSend<Result<Signature, AuthenticationError>>;
fn get_public_key(
&self,
pub_key_commitment: PublicKeyCommitment,
) -> impl FutureMaybeSend<Option<&PublicKey>>;
}Expand description
Defines an authenticator for transactions.
The main purpose of the authenticator is to generate signatures for a given message against a key managed by the authenticator. That is, the authenticator maintains a set of public- private key pairs, and can be requested to generate signatures against any of the managed keys.
The public keys are defined by PublicKeyCommitment’s which are the hashes of the actual public keys.
Required Methods§
Sourcefn get_signature(
&self,
pub_key_commitment: PublicKeyCommitment,
signing_inputs: &SigningInputs,
) -> impl FutureMaybeSend<Result<Signature, AuthenticationError>>
fn get_signature( &self, pub_key_commitment: PublicKeyCommitment, signing_inputs: &SigningInputs, ) -> impl FutureMaybeSend<Result<Signature, AuthenticationError>>
Retrieves a signature for a specific message as a list of Felt.
The request is initiated by the VM as a consequence of the SigToStack advice injector.
pub_key_commitment: the hash of the public key used for signature generation.signing_inputs: description of the message to be singed. The inputs could contain arbitrary data or a TransactionSummary which would describe the changes made to the account up to the point of callingget_signature(). This allows the authenticator to review any alterations to the account prior to signing. It should not be directly used in the signature computation.
Sourcefn get_public_key(
&self,
pub_key_commitment: PublicKeyCommitment,
) -> impl FutureMaybeSend<Option<&PublicKey>>
fn get_public_key( &self, pub_key_commitment: PublicKeyCommitment, ) -> impl FutureMaybeSend<Option<&PublicKey>>
Retrieves a public key for a specific public key commitment.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementations on Foreign Types§
Source§impl TransactionAuthenticator for ()
impl TransactionAuthenticator for ()
fn get_signature( &self, _pub_key_commitment: PublicKeyCommitment, _signing_inputs: &SigningInputs, ) -> impl FutureMaybeSend<Result<Signature, AuthenticationError>>
fn get_public_key( &self, _pub_key_commitment: PublicKeyCommitment, ) -> impl FutureMaybeSend<Option<&PublicKey>>
Implementors§
impl TransactionAuthenticator for BasicAuthenticator
impl TransactionAuthenticator for FilesystemKeyStore
std only.