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;
// 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,
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,
vid_commitment: &<VidSchemeType as VidScheme>::Commit,
) -> 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§
sourcetype BuilderPrivateKey: PrivateSignatureKey
type BuilderPrivateKey: PrivateSignatureKey
The type of the keys builder would use to sign its messages
Required Methods§
sourcefn validate_builder_signature(
&self,
signature: &Self::BuilderSignature,
data: &[u8],
) -> bool
fn validate_builder_signature( &self, signature: &Self::BuilderSignature, data: &[u8], ) -> bool
validate the message with the builder’s public key
sourcefn sign_builder_message(
private_key: &Self::BuilderPrivateKey,
data: &[u8],
) -> Result<Self::BuilderSignature, Self::SignError>
fn sign_builder_message( private_key: &Self::BuilderPrivateKey, data: &[u8], ) -> Result<Self::BuilderSignature, Self::SignError>
sourcefn generated_from_seed_indexed(
seed: [u8; 32],
index: u64,
) -> (Self, Self::BuilderPrivateKey)
fn generated_from_seed_indexed( seed: [u8; 32], index: u64, ) -> (Self, Self::BuilderPrivateKey)
Generate a new key pair
Provided Methods§
sourcefn validate_fee_signature<Metadata: EncodeBytes>(
&self,
signature: &Self::BuilderSignature,
fee_amount: u64,
metadata: &Metadata,
vid_commitment: &<VidSchemeType as VidScheme>::Commit,
) -> bool
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
sourcefn validate_sequencing_fee_signature_marketplace(
&self,
signature: &Self::BuilderSignature,
fee_amount: u64,
view_number: u64,
) -> bool
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)
sourcefn validate_bundle_signature<TYPES: NodeType<BuilderSignatureKey = Self>>(
&self,
bundle: Bundle<TYPES>,
) -> bool
fn validate_bundle_signature<TYPES: NodeType<BuilderSignatureKey = Self>>( &self, bundle: Bundle<TYPES>, ) -> bool
validate the bundle’s signature using the builder’s public key
sourcefn validate_block_info_signature(
&self,
signature: &Self::BuilderSignature,
block_size: u64,
fee_amount: u64,
payload_commitment: &BuilderCommitment,
) -> bool
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
sourcefn 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_fee<Metadata: EncodeBytes>( private_key: &Self::BuilderPrivateKey, fee_amount: u64, metadata: &Metadata, vid_commitment: &<VidSchemeType as VidScheme>::Commit, ) -> Result<Self::BuilderSignature, Self::SignError>
sourcefn sign_sequencing_fee_marketplace(
private_key: &Self::BuilderPrivateKey,
fee_amount: u64,
view_number: u64,
) -> 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>
sign fee offer for proposed payload (marketplace version)
§Errors
If unable to sign the data with the key
sourcefn sign_bundle<TYPES: NodeType>(
private_key: &Self::BuilderPrivateKey,
transactions: &[TYPES::Transaction],
) -> Result<Self::BuilderSignature, Self::SignError>
fn sign_bundle<TYPES: NodeType>( private_key: &Self::BuilderPrivateKey, transactions: &[TYPES::Transaction], ) -> Result<Self::BuilderSignature, Self::SignError>
sourcefn sign_block_info(
private_key: &Self::BuilderPrivateKey,
block_size: u64,
fee_amount: u64,
payload_commitment: &BuilderCommitment,
) -> 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>
Object Safety§
This trait is not object safe.