feat(zig): Implement HDWallet + Transaction builder utilities via eth.zig#385
Open
koko1123 wants to merge 1 commit intoevmts:mainfrom
Open
feat(zig): Implement HDWallet + Transaction builder utilities via eth.zig#385koko1123 wants to merge 1 commit intoevmts:mainfrom
koko1123 wants to merge 1 commit intoevmts:mainfrom
Conversation
….zig Add BIP-32/44 HD Wallet derivation and BIP-39 mnemonic support via eth.zig dependency. Implement transaction signing for EIP-1559, EIP-4844, and EIP-7702 types, plus sender recovery via ECDSA ecrecover. - Add eth.zig v0.2.3 as build dependency - Create HDWallet module with fromSeed, derivePath, deriveChild, deriveEthereum, getAddress, getPublicKey - Create Mnemonic utilities (generate, validate, toSeed, fromEntropy) - Create transaction_utils with sign/recover for all modern tx types - Fix pre-existing duplicate declarations in primitives/root.zig - 18 new tests (13 HDWallet + 5 transaction utils) Fixes evmts#353, Fixes evmts#368
|
@koko1123 is attempting to deploy a commit to the evmts Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Implements BIP-32/44 HD Wallet derivation and transaction signing/recovery utilities for Voltaire's Zig packages, powered by eth.zig v0.2.3.
HDWallet (
crypto/HDWallet/hdwallet.zig):HDWallet.fromSeed/derivePath/deriveChild/deriveEthereum/deriveEthereumFromSeedgetPrivateKey/getPublicKey(compressed SEC1) /getAddress/getChainCodeMnemonic.generate/generate24/toSeed/validate/fromEntropy128/fromEntropy256HARDENED,ETH_COIN_TYPETransaction builder utilities (
primitives/Transaction/transaction_utils.zig):signEip1559Transaction/signEip4844Transaction/signEip7702TransactionrecoverLegacySender/recoverEip1559Sender(ECDSA ecrecover via eth.zig)detectTransactionType(re-export)Bugfix: Removes duplicate
ConsensusSpec,ForkConfig,LightClientHeader,LightClientUpdate,SyncCommittee,SyncAggregate, andconsensusdeclarations inprimitives/root.zigthat caused compilation errors on main.AI Disclosure
AI Tools Used
Claude (Anthropic)
Prompts Used
Human Explanation
Voltaire needed HD wallet support (#353, critical priority) and transaction builder utilities (#368). Rather than implementing from scratch or wrapping libwally-core via C FFI, this PR adds eth.zig as a Zig package dependency - it already has complete, tested implementations of BIP-32/39/44 key derivation and secp256k1 ECDSA that have been validated against standard test vectors.
Related Issues
Fixes #353
Fixes #368
Type of Change
Testing
zig buildcompletes successfullyabandon...about->0x9858EfFD232B4033E47d90003D41EC34EcaEda94deriveEthereummatchesderiveEthereumFromSeed(same BIP-44 path)Note:
blockchain-testshas a pre-existing compilation error (BlockTagmember not found) unrelated to this PR.Checklist