lambdaclass / lambdaclass/eth-agent

BIP-39/BIP-32 mnemonic derivation implemented but not tested

Open
#43 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

medium-priority testing
Dominant language
TypeScript
Stars
10
Forks
1
PR merge metrics
No merged PRs in 30d

Description

Problem

The codebase has BIP-39 mnemonic and BIP-32 HD key derivation implementation, but there are no tests verifying correctness against standard test vectors.

Location

src/protocol/account.ts - mnemonic-related functions

Risk

  • Implementation bugs could generate wrong keys
  • Users could lose funds if derivation is incorrect
  • No verification against BIP-39/BIP-32 test vectors

Recommendation

  1. Add tests using official BIP-39 test vectors
  2. Add tests using official BIP-32 test vectors
  3. Test edge cases (invalid mnemonics, hardened vs non-hardened paths)
// Example test vectors from BIP-39
const TEST_VECTORS = [
  {
    mnemonic: 'abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about',
    seed: '5eb00bbddcf069084889a8ab9155568165f5c453ccb85e70811aaed6f6da5fc19a5ac40b389cd370d086206dec8aa6c43daea6690f20ad3d8d48b2d2ce9e38e4',
    // ... derived keys
  }
];

Priority

Medium - Security-critical code path

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read the mnemonic-related functions in src/protocol/account.ts and compare their behavior with the official BIP-39 and BIP-32 test vectors. Add coverage for valid vectors, invalid mnemonics, and hardened versus non-hardened paths. Done means the implementation matches the published vectors and the listed edge cases are verified by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cryptography
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.