Skill — Copyable reference implementation. Use as-is or customize. See Skills Philosophy.
Viem Account Abstraction
Drop-in replacement for viem’s account module using Voltaire primitives. Implements the fullLocalAccount interface for signing messages, transactions, and typed data.
Quick Start
API Reference
privateKeyToAccount
Creates a viem-compatiblePrivateKeyAccount from a hex-encoded private key.
privateKey- 32-byte private key as hex string with0xprefixoptions.nonceManager- Optional nonce manager for transaction ordering
PrivateKeyAccount with all signing methods
Throws:
InvalidPrivateKeyError- If private key is invalid length or zero
Account Methods
sign()
Signs a raw 32-byte hash.signMessage()
Signs a message using EIP-191 personal sign format.signTypedData()
Signs EIP-712 typed structured data.signTransaction(transaction, options)
Signs an Ethereum transaction.signAuthorization()
Signs EIP-7702 authorization for account abstraction.Standalone Signing Functions
For tree-shaking, use standalone functions:Factory Pattern
For dependency injection:Type Definitions
Viem Compatibility Notes
Full Compatibility
- Account structure matches viem’s
LocalAccount - All signing methods return the same format
- Address is EIP-55 checksummed
- Public key is uncompressed (65 bytes)
- Signatures are 65 bytes (r + s + v)
Known Differences
- EIP-712 addresses: Voltaire’s EIP712 expects
Addressprimitives (Uint8Array), not strings. Convert addresses usingAddress.from('0x...')before signing typed data with address fields. - Transaction serialization: Uses placeholder serializer. For production, integrate with Voltaire’s Transaction primitive.

