Skip to content

007: add Wallet class for private key signing#314

Open
dawsbot wants to merge 1 commit intomasterfrom
feat/007-wallet
Open

007: add Wallet class for private key signing#314
dawsbot wants to merge 1 commit intomasterfrom
feat/007-wallet

Conversation

@dawsbot
Copy link
Owner

@dawsbot dawsbot commented Jan 31, 2026

Adds a Wallet class for private key management and message signing. Supports address derivation, signMessage (EIP-191 personal_sign), and lays groundwork for signTypedData and sendTransaction. Uses @noble/secp256k1 (already a dependency). Part of Phase 1 roadmap (Wallet & Signing - THE Big One).

What is included

  • Wallet class (src/classes/Wallet.ts)

    • Constructor validates 32-byte hex private key (with/without 0x prefix)
    • .address getter derives checksummed Ethereum address via secp256k1 + keccak256
    • .publicKey getter returns uncompressed public key (65 bytes, 04 prefix)
    • signMessage(message) follows EIP-191 personal_sign standard
    • signTypedData() placeholder (throws Not yet implemented)
    • .connect(provider) attaches provider for future sendTransaction support
  • 16 tests (src/classes/test/Wallet.test.ts)

    • Address derivation from known test vectors
    • Signature validity (65-byte output)
    • Signature recovery (recover signer address from signature)
    • String vs Uint8Array message parity
    • Invalid key rejection
    • Provider attachment

Dependencies

No new dependencies — uses existing @noble/secp256k1 and @noble/hashes.

@vercel
Copy link

vercel bot commented Jan 31, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
essential-eth Ready Ready Preview, Comment Feb 16, 2026 6:56pm

- Wallet class with private key management and address derivation
- signMessage following EIP-191 (personal_sign) standard
- Address derivation using secp256k1 + keccak256
- publicKey getter, connect(provider) method
- signTypedData placeholder (throws Not yet implemented)
- Uses existing @noble/secp256k1 and @noble/hashes dependencies
- 16 passing tests covering address derivation, signing, recovery, and edge cases
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants