pub struct SignedTransaction {
pub transaction: Transaction,
pub signature: Signature,
pub pq_signature: Vec<u8>,
/* private fields */
}Expand description
A signed transaction ready for submission
Contains the transaction and the composite signature (classical +
post-quantum) proving authorization. Both legs are mandatory — there is
no classical-only path. Verifiers reject a SignedTransaction whose
pq_signature is absent or wrong-sized.
§Wire layout
signature— classical Ed25519 / Secp256k1 leg (existing field, raw bytes insignature.bytesand the classical pubkey insignature.public_key).pq_signature— ML-DSA-65 signature (FIPS 204, exactly 3309 bytes).- The ML-DSA-65 verifying key lives in
transaction.pq_public_keyso that the hash preimage commits to the PQ identity.
Fields§
§transaction: TransactionThe underlying transaction
signature: SignatureThe classical signature authorizing the transaction
pq_signature: Vec<u8>ML-DSA-65 signature over transaction.hash() (FIPS 204, exactly 3309
bytes). Mandatory; mis-sized payloads are rejected at deserialization.
Implementations§
Source§impl SignedTransaction
impl SignedTransaction
Sourcepub fn new(
transaction: Transaction,
signature: Signature,
pq_signature: Vec<u8>,
) -> Self
pub fn new( transaction: Transaction, signature: Signature, pq_signature: Vec<u8>, ) -> Self
Creates a new signed transaction. Both the classical signature and the ML-DSA-65 signature are mandatory.
Sourcepub fn validate(&self) -> Result<(), &'static str>
pub fn validate(&self) -> Result<(), &'static str>
Validates the signed transaction
Performs basic validation checks:
- Classical signature bytes are non-empty
- Classical public key is non-empty
- PQ signature is exactly ML_DSA_65_SIG_LEN bytes (3309)
- PQ public key (carried in
transaction.pq_public_key) is exactly ML_DSA_65_VK_LEN bytes (1952) - Gas limit is non-zero
- Addresses are non-zero
- Transaction data size is within limits
Note: This does NOT verify the cryptographic signature. Signature verification requires the crypto crate.
Trait Implementations§
Source§impl Clone for SignedTransaction
impl Clone for SignedTransaction
Source§fn clone(&self) -> SignedTransaction
fn clone(&self) -> SignedTransaction
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SignedTransaction
impl Debug for SignedTransaction
Source§impl<'de> Deserialize<'de> for SignedTransaction
impl<'de> Deserialize<'de> for SignedTransaction
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for SignedTransaction
Source§impl PartialEq for SignedTransaction
impl PartialEq for SignedTransaction
Source§fn eq(&self, other: &SignedTransaction) -> bool
fn eq(&self, other: &SignedTransaction) -> bool
self and other values to be equal, and is used by ==.