Skip to main content

Crate erc8128

Crate erc8128 

Source
Expand description

§erc8128 — Signed HTTP Requests with Ethereum

Rust implementation of ERC-8128: authenticate HTTP requests using HTTP Message Signatures (RFC 9421) with Ethereum accounts.

Two core operations:

Chain-specific signature verification (EOA / ERC-1271) is pluggable via the Verifier trait.

§Examples

use erc8128::{Request, SignOptions, sign_request};

let request = Request {
    method: "GET",
    url: "https://api.example.com/resource",
    headers: &[],
    body: None,
};
let signed = sign_request(&request, &signer, &SignOptions::default()).await?;

Modules§

keyid
KeyID formatting and parsing (erc8128:<chainId>:<address>).
nonce
Cryptographically secure nonce generation. Cryptographically secure nonce generation for replay-attack prevention.

Structs§

Address
An Ethereum address, 20 bytes in length.
MemoryNonceStore
In-memory nonce store for development and testing.
NoNonceStore
No-op nonce store that rejects all nonces.
RejectReplayable
Reject all replayable signatures (default secure behavior).
ReplayableInfo
Information about a replayable signature, passed to ReplayablePolicy::invalidated.
Request
An HTTP request to be signed or verified.
SignOptions
Options for sign_request.
SignatureParams
RFC 9421 signature parameters.
SignedHeaders
Headers produced by sign_request.
VerifyPolicy
Policy for verify_request.
VerifySuccess
Successful verification result.

Enums§

Binding
How tightly a signature is bound to a specific request.
ContentDigest
How to handle the Content-Digest header during signing.
Erc8128Error
Errors produced by ERC-8128 signing and verification.
Replay
Whether a signature can be validly reused.

Traits§

NonceStore
Nonce store for replay protection.
ReplayablePolicy
Policy for replayable (nonce-less) signature acceptance and invalidation.
Signer
Ethereum message signer.
Verifier
Signature verifier for Ethereum accounts.

Functions§

sign_request
Sign an HTTP request according to ERC-8128.
verify_request
Verify a signed HTTP request according to ERC-8128.