1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//! [EIP-8141] frame transaction constants and types.
//!
//! Targets, signers, and signed messages are typed: [`FrameAddress`] distinguishes an omitted
//! address from an explicit one and [`SignatureMessage`] distinguishes the canonical transaction
//! hash from an explicit digest. Decoding rejects malformed lengths and the reserved zero digest
//! but not the remaining signature constraints: call [`FrameSignature::validate_structure`] or
//! [`FrameSignature::validate_structure_with_sender`] before cryptographic verification.
//!
//! The `serde` feature encodes protocol discriminants and gas counters as hex quantities, and
//! optional addresses and signature messages as hex byte strings (empty values are `"0x"`).
//!
//! ```
//! use alloy_eip8141::{FrameAddress, FrameSignature, SignatureMessage};
//! use alloy_primitives::{Signature, U256};
//!
//! // Construct a structurally valid entry; the signature still needs cryptographic verification.
//! let signature = Signature::new(U256::from(1), U256::from(2), false);
//! let entry = FrameSignature::from_secp256k1(
//! FrameAddress::Empty,
//! SignatureMessage::TransactionHash,
//! signature,
//! )?;
//! assert!(entry.signs_transaction_hash());
//! assert_eq!(entry.secp256k1_signature(), Some(signature));
//! # Ok::<(), alloy_eip8141::Eip8141Error>(())
//! ```
//!
//! [EIP-8141]: https://eips.ethereum.org/EIPS/eip-8141
extern crate alloc;
pub use FrameAddress;
pub use Eip8141Error;
pub use *;
pub use *;
pub use *;
pub use *;