Skill — Copyable reference implementation. Use as-is or customize. See Skills Philosophy.
Ethers v6 Style Signer
This Skill documents an ethers v6-compatibleSigner implementation built on Voltaire primitives. It provides the same API surface as ethers v6 Wallet while using Voltaire’s cryptographic primitives.
Overview
TheEthersSigner 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 inexamples/ethers-signer/:
Quick Start
Creating a Signer
- From Hex String
- From Uint8Array
- With Provider
API Reference
Properties
| Property | Type | Description |
|---|---|---|
address | string | Checksummed Ethereum address |
privateKey | string | Private key as hex string with 0x prefix |
provider | SignerProvider | null | Connected provider or null |
Methods
Offline Methods (No Provider Required)
Provider Methods (Provider Required)
Signing Messages
EIP-191 Personal Sign
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
- Nonce: From
provider.getTransactionCount(address, "pending") - Gas Limit: From
provider.estimateGas(tx) - Chain ID: From
provider.getNetwork() - Type: Auto-detect based on fee data:
- EIP-1559 network:
type: 2withmaxFeePerGas,maxPriorityFeePerGas - Legacy network:
type: 0withgasPrice
- EIP-1559 network:
Error Handling
Error Types
| Error | Cause |
|---|---|
MissingProviderError | Operation requires provider, none connected |
InvalidPrivateKeyError | Private key invalid (wrong length, zero) |
InvalidTransactionError | Transaction fields invalid |
AddressMismatchError | tx.from doesn’t match signer address |
ChainIdMismatchError | tx.chainId doesn’t match network |
Provider Interface
The signer requires a provider implementing:EthersProvider(from ethers-provider playbook)- ethers v6
JsonRpcProvider - Any compliant provider
Voltaire Primitives Used
Address- Address validation and checksummingPrivateKey- Private key managementSignedData.Hash- EIP-191 message hashingEIP712.signTypedData- EIP-712 typed data signingSecp256k1.sign- ECDSA signingKeccak256.hash- Keccak256 hashingTransaction.EIP1559- Transaction serialization
Migration from ethers v6
The API is designed to be drop-in compatible:Differences from ethers v6
Current limitations:- HDNode derivation - No mnemonic/HD wallet support
- Keystore JSON - No encrypt/decrypt JSON keystore
- Crowdsale JSON - No crowdsale wallet support
- ENS in TypedData - ENS names in typed data not auto-resolved
Source Files
examples/ethers-signer/EthersSigner.js- Implementationexamples/ethers-signer/EthersSignerTypes.ts- TypeScript typesexamples/ethers-signer/errors.ts- Error classesexamples/ethers-signer/EthersSigner.test.ts- Testsexamples/ethers-signer/REQUIREMENTS.md- Full API requirements

