Skip to main content
Skill — Copyable reference implementation. Use as-is or customize. See Skills Philosophy.

Ethers v6 Style Signer

This Skill documents an ethers v6-compatible Signer implementation built on Voltaire primitives. It provides the same API surface as ethers v6 Wallet while using Voltaire’s cryptographic primitives.

Overview

The EthersSigner class implements the full ethers v6 signer API:
  • Private key management
  • Transaction signing (Legacy, EIP-1559)
  • Message signing (EIP-191 personal sign)
  • Typed data signing (EIP-712)
  • EIP-7702 authorization signing
  • Provider connection for network operations

Installation

The signer is located in examples/ethers-signer/:

Quick Start

Creating a Signer

API Reference

Properties

Methods

Offline Methods (No Provider Required)

Provider Methods (Provider Required)

Signing Messages

EIP-191 Personal Sign

The signature format is 0x + r (64 hex) + s (64 hex) + v (2 hex) = 132 characters.

EIP-712 Typed Data

Signing Transactions

EIP-1559 Transaction

Legacy Transaction

Send Transaction

EIP-7702 Authorization

Sign authorization tuples for account abstraction:

Transaction Population

The signer automatically populates missing transaction fields:

Auto-detection Logic

  1. Nonce: From provider.getTransactionCount(address, "pending")
  2. Gas Limit: From provider.estimateGas(tx)
  3. Chain ID: From provider.getNetwork()
  4. Type: Auto-detect based on fee data:
    • EIP-1559 network: type: 2 with maxFeePerGas, maxPriorityFeePerGas
    • Legacy network: type: 0 with gasPrice

Error Handling

Error Types

Provider Interface

The signer requires a provider implementing:
Compatible with:
  • EthersProvider (from ethers-provider playbook)
  • ethers v6 JsonRpcProvider
  • Any compliant provider

Voltaire Primitives Used

  • Address - Address validation and checksumming
  • PrivateKey - Private key management
  • SignedData.Hash - EIP-191 message hashing
  • EIP712.signTypedData - EIP-712 typed data signing
  • Secp256k1.sign - ECDSA signing
  • Keccak256.hash - Keccak256 hashing
  • Transaction.EIP1559 - Transaction serialization

Migration from ethers v6

The API is designed to be drop-in compatible:

Differences from ethers v6

Current limitations:
  1. HDNode derivation - No mnemonic/HD wallet support
  2. Keystore JSON - No encrypt/decrypt JSON keystore
  3. Crowdsale JSON - No crowdsale wallet support
  4. ENS in TypedData - ENS names in typed data not auto-resolved
These can be added as needed.

Source Files

  • examples/ethers-signer/EthersSigner.js - Implementation
  • examples/ethers-signer/EthersSignerTypes.ts - TypeScript types
  • examples/ethers-signer/errors.ts - Error classes
  • examples/ethers-signer/EthersSigner.test.ts - Tests
  • examples/ethers-signer/REQUIREMENTS.md - Full API requirements