Skip to main content

Try it Live

Run Signature examples in the interactive playground

EIP-2098: Compact Signature Representation

Space-efficient signature format that embeds the recovery ID in the s component.

Overview

EIP-2098 defines a compact 64-byte signature format that includes recovery information by utilizing the highest bit of the s component. This reduces signature size from 65 bytes to 64 bytes while preserving recovery capability. Benefits:
  • 🔹 64 bytes instead of 65 bytes (1.5% space savings)
  • 🔹 Preserves recovery functionality
  • 🔹 Compatible with existing ECDSA signatures
  • 🔹 Reduces gas costs in smart contracts

Format Structure

Standard (65 bytes)

EIP-2098 Compact (64 bytes)

Encoding

Compact Encoding Process

Decoding Process

Validation

Check if Signature is EIP-2098 Compact

Canonical Form Requirement

EIP-2098 signatures MUST be canonical (low-s form) because the high bit of s is used for yParity:

Smart Contract Usage

Solidity Example

Gas Savings

Conversion Utilities

Bidirectional Conversion

Real-World Examples

MetaMask Personal Sign

API Response

Batch Verification

Compatibility

EIP-155 Chain ID Encoding

EIP-2098 uses yParity (0 or 1) instead of full v value. For EIP-155 signatures:

Supporting Multiple Formats

Security Considerations

Canonical Requirement

Why? The highest bit of s is used for yParity. Non-canonical signatures have high s values that would conflict.

High Bit Validation

Malleability Protection

Performance

Space Savings

Gas Savings (Ethereum)

Encoding Performance

See Also