signatureSignature

ECDSA signature components

ECDSA signature components (v, r, s) for signed transactions.

Overview

Signature is an immutable dataclass containing the three components of an ECDSA signature. It's used when manually signing transactions or working with raw signature data.

Definition

@dataclass(frozen=True)
class Signature:
    """ECDSA signature components (all-or-nothing).

    Attributes:
        v: Recovery identifier (0 or 1, per EIP-155 / y-parity).
        r: First 32-byte integer of the signature.
        s: Second 32-byte integer of the signature.
    """
    v: int
    r: int
    s: int

Fields

Field
Type
Description

v

int

Recovery identifier (0 or 1, per EIP-155 y-parity)

r

int

First 32-byte integer of the signature

s

int

Second 32-byte integer of the signature

Examples

Create from Signature Components

Extract from eth_keys Signature

Use in Transaction Serialization

Properties

  • Immutable - Cannot be modified after construction (frozen=True)

  • Hashable - Can be used as dictionary keys

  • Type-safe - All fields are validated at construction

Recovery Identifier (v)

The v value in Seismic transactions:

  • 0 or 1 - Represents y-parity (EIP-155 style)

  • Used to recover the public key from the signature

  • Different from legacy Ethereum v values (27 or 28)

Notes

  • All three components must be provided together

  • Typically created automatically by signing functions

  • Used internally by sign_seismic_tx_eip712

  • Part of the final RLP-encoded transaction

See Also

Last updated