Expand description
Implementation of Ethereum public addresses for Rust.
This crate provides an Address
type for representing Ethereum public
addresses.
Checksums
Addresses are by default formatted with ERC-55 mixed-case checksum
encoding. Addresses checksums may optionally be verified when parsing with
Address::from_str_checksum()
.
address!
Macro
This crate exports an address!
macro that can be used for creating
compile-time address constants. Under the hood, it is implemented with
const fn
and does not use procedural macros.
Features
- default
std
: Additional integration with Rust standard library types. Notably, this includesstd::error::Error
implementation on theParseAddressError
type and conversions fromVec<u8>
. serde
: Serialization traits for theserde
crate. Note that the implementation is very much geared towards JSON serialization withserde_json
.sha3
: Use the Rust Crypto Keccak-256 implementation (provided by thesha3
crate) instead of the built-in one. Note that theaddress!
macro will always use the built-in Keccak-256 implementation for checksum verification, assha3
does not expose aconst fn
API.
Macros
- Macro to create Ethereum public address values from string literals that get verified at compile time. A compiler error will be generated if an invalid address is specified.
Structs
- An Ethereum public address.
Enums
- Represents an error parsing an address from a string.