Trait BuilderSignatureKey

Source
pub trait BuilderSignatureKey:
    Send
    + Sync
    + Clone
    + Sized
    + Debug
    + Hash
    + Serialize
    + DeserializeOwned
    + PartialEq
    + Eq
    + PartialOrd
    + Ord
    + Display {
    type BuilderPrivateKey: PrivateSignatureKey;
    type BuilderSignature: Send + Sync + Sized + Clone + Debug + Eq + Serialize + for<'a> Deserialize<'a> + Hash;
    type SignError: Error + Send + Sync;

Show 13 methods // Required methods fn validate_builder_signature( &self, signature: &Self::BuilderSignature, data: &[u8], ) -> bool; fn sign_builder_message( private_key: &Self::BuilderPrivateKey, data: &[u8], ) -> Result<Self::BuilderSignature, Self::SignError>; fn generated_from_seed_indexed( seed: [u8; 32], index: u64, ) -> (Self, Self::BuilderPrivateKey); // Provided methods fn validate_fee_signature<Metadata: EncodeBytes>( &self, signature: &Self::BuilderSignature, fee_amount: u64, metadata: &Metadata, ) -> bool { ... } fn validate_fee_signature_with_vid_commitment<Metadata: EncodeBytes>( &self, signature: &Self::BuilderSignature, fee_amount: u64, metadata: &Metadata, vid_commitment: &VidCommitment, ) -> bool { ... } fn validate_sequencing_fee_signature_marketplace( &self, signature: &Self::BuilderSignature, fee_amount: u64, view_number: u64, ) -> bool { ... } fn validate_bundle_signature<TYPES: NodeType<BuilderSignatureKey = Self>>( &self, bundle: Bundle<TYPES>, ) -> bool { ... } fn validate_block_info_signature( &self, signature: &Self::BuilderSignature, block_size: u64, fee_amount: u64, payload_commitment: &BuilderCommitment, ) -> bool { ... } fn sign_fee<Metadata: EncodeBytes>( private_key: &Self::BuilderPrivateKey, fee_amount: u64, metadata: &Metadata, ) -> Result<Self::BuilderSignature, Self::SignError> { ... } fn sign_fee_with_vid_commitment<Metadata: EncodeBytes>( private_key: &Self::BuilderPrivateKey, fee_amount: u64, metadata: &Metadata, vid_commitment: &VidCommitment, ) -> Result<Self::BuilderSignature, Self::SignError> { ... } fn sign_sequencing_fee_marketplace( private_key: &Self::BuilderPrivateKey, fee_amount: u64, view_number: u64, ) -> Result<Self::BuilderSignature, Self::SignError> { ... } fn sign_bundle<TYPES: NodeType>( private_key: &Self::BuilderPrivateKey, transactions: &[TYPES::Transaction], ) -> Result<Self::BuilderSignature, Self::SignError> { ... } fn sign_block_info( private_key: &Self::BuilderPrivateKey, block_size: u64, fee_amount: u64, payload_commitment: &BuilderCommitment, ) -> Result<Self::BuilderSignature, Self::SignError> { ... }
}
Expand description

Builder Signature Key trait with minimal requirements

Required Associated Types§

Source

type BuilderPrivateKey: PrivateSignatureKey

The type of the keys builder would use to sign its messages

Source

type BuilderSignature: Send + Sync + Sized + Clone + Debug + Eq + Serialize + for<'a> Deserialize<'a> + Hash

The type of the signature builder would use to sign its messages

Source

type SignError: Error + Send + Sync

Type of error that can occur when signing data

Required Methods§

Source

fn validate_builder_signature( &self, signature: &Self::BuilderSignature, data: &[u8], ) -> bool

validate the message with the builder’s public key

Source

fn sign_builder_message( private_key: &Self::BuilderPrivateKey, data: &[u8], ) -> Result<Self::BuilderSignature, Self::SignError>

sign the message with the builder’s private key

§Errors

If unable to sign the data with the key

Source

fn generated_from_seed_indexed( seed: [u8; 32], index: u64, ) -> (Self, Self::BuilderPrivateKey)

Generate a new key pair

Provided Methods§

Source

fn validate_fee_signature<Metadata: EncodeBytes>( &self, signature: &Self::BuilderSignature, fee_amount: u64, metadata: &Metadata, ) -> bool

validate signature over sequencing fee information with the builder’s public key

Source

fn validate_fee_signature_with_vid_commitment<Metadata: EncodeBytes>( &self, signature: &Self::BuilderSignature, fee_amount: u64, metadata: &Metadata, vid_commitment: &VidCommitment, ) -> bool

validate signature over sequencing fee information with the builder’s public key, including vid commitment

Source

fn validate_sequencing_fee_signature_marketplace( &self, signature: &Self::BuilderSignature, fee_amount: u64, view_number: u64, ) -> bool

validate signature over sequencing fee information with the builder’s public key (marketplace version)

Source

fn validate_bundle_signature<TYPES: NodeType<BuilderSignatureKey = Self>>( &self, bundle: Bundle<TYPES>, ) -> bool

validate the bundle’s signature using the builder’s public key

Source

fn validate_block_info_signature( &self, signature: &Self::BuilderSignature, block_size: u64, fee_amount: u64, payload_commitment: &BuilderCommitment, ) -> bool

validate signature over block information with the builder’s public key

Source

fn sign_fee<Metadata: EncodeBytes>( private_key: &Self::BuilderPrivateKey, fee_amount: u64, metadata: &Metadata, ) -> Result<Self::BuilderSignature, Self::SignError>

sign sequencing fee offer

§Errors

If unable to sign the data with the key

Source

fn sign_fee_with_vid_commitment<Metadata: EncodeBytes>( private_key: &Self::BuilderPrivateKey, fee_amount: u64, metadata: &Metadata, vid_commitment: &VidCommitment, ) -> Result<Self::BuilderSignature, Self::SignError>

sign sequencing fee offer, with the payload commitment included

§Errors

If unable to sign the data with the key

Source

fn sign_sequencing_fee_marketplace( private_key: &Self::BuilderPrivateKey, fee_amount: u64, view_number: u64, ) -> Result<Self::BuilderSignature, Self::SignError>

sign fee offer (marketplace version)

§Errors

If unable to sign the data with the key

Source

fn sign_bundle<TYPES: NodeType>( private_key: &Self::BuilderPrivateKey, transactions: &[TYPES::Transaction], ) -> Result<Self::BuilderSignature, Self::SignError>

sign transactions (marketplace version)

§Errors

If unable to sign the data with the key

Source

fn sign_block_info( private_key: &Self::BuilderPrivateKey, block_size: u64, fee_amount: u64, payload_commitment: &BuilderCommitment, ) -> Result<Self::BuilderSignature, Self::SignError>

sign information about offered block

§Errors

If unable to sign the data with the key

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.

Implementors§

Source§

impl BuilderSignatureKey for BuilderKey

Source§

type BuilderPrivateKey = SignKey

Source§

type BuilderSignature = <BLSOverBN254CurveSignatureScheme as SignatureScheme>::Signature

Source§

type SignError = SignatureError