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

    // 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,
        vid_commitment: &<VidSchemeType as VidScheme>::Commit
    ) -> bool { ... }
    fn validate_sequencing_fee_signature_marketplace(
        &self,
        signature: &Self::BuilderSignature,
        fee_amount: 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,
        vid_commitment: &<VidSchemeType as VidScheme>::Commit
    ) -> Result<Self::BuilderSignature, Self::SignError> { ... }
    fn sign_sequencing_fee_marketplace(
        private_key: &Self::BuilderPrivateKey,
        fee_amount: 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: Send + Sync + Sized + Clone + Debug + Eq + Serialize + for<'a> Deserialize<'a> + Hash

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, vid_commitment: &<VidSchemeType as VidScheme>::Commit ) -> bool

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

source

fn validate_sequencing_fee_signature_marketplace( &self, signature: &Self::BuilderSignature, fee_amount: 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, vid_commitment: &<VidSchemeType as VidScheme>::Commit ) -> Result<Self::BuilderSignature, Self::SignError>

sign sequencing fee offer for proposed payload

§Errors

If unable to sign the data with the key

source

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

sign fee offer for proposed payload (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

Object Safety§

This trait is not object safe.

Implementors§

source§

impl BuilderSignatureKey for BuilderKey

§

type BuilderPrivateKey = SignKey

§

type BuilderSignature = <BLSOverBN254CurveSignatureScheme as SignatureScheme>::Signature

§

type SignError = SignatureError