Skip to content

Add Rust port of btcrecover for Bitcoin and Ethereum functionality#687

Draft
Copilot wants to merge 3 commits intomasterfrom
copilot/port-codebase-to-rust-bitcoin-ethereum
Draft

Add Rust port of btcrecover for Bitcoin and Ethereum functionality#687
Copilot wants to merge 3 commits intomasterfrom
copilot/port-codebase-to-rust-bitcoin-ethereum

Conversation

Copy link
Copy Markdown

Copilot AI commented Mar 13, 2026

Rust implementation of btcrecover's core Bitcoin and Ethereum wallet recovery functionality in btcrecover-rs/. Self-contained project, no changes to existing Python code.

Modules

  • bip39/ — Mnemonic validation, checksum verification, PBKDF2-HMAC-SHA512 seed derivation, embedded English wordlist
  • bip32/ — HD key derivation via HMAC-SHA512 chain, hardened/normal child keys, secp256k1 public key generation
  • bitcoin/ — P2PKH, P2SH-P2WPKH, P2WPKH (Bech32) address generation; Bitcoin Core wallet.dat password verification (SHA512 + AES-256-CBC)
  • ethereum/ — Keccak-256 address derivation, EIP-55 checksums; MetaMask vault recovery (Desktop: PBKDF2-SHA256 + AES-256-GCM, Mobile: PBKDF2-SHA512 + AES-256-CBC); Ethereum Keystore V3 MAC verification
  • recovery/ — Parallel seed recovery (single-word replacement across all positions) and password recovery engines using Rayon
  • CLIaddress, validate, seed-recover, password-recover subcommands via clap

Usage

cd btcrecover-rs && cargo build --release

# Generate addresses
btcrecover-rs address -m "abandon abandon ... about" -b ethereum
btcrecover-rs address -m "abandon abandon ... about" -b bitcoin --address-type p2wpkh

# Recover seed with one wrong word
btcrecover-rs seed-recover \
  -m "abandon abandon ... wrong" \
  -a "0x9858EfFD232B4033E47d90003D41EC34EcaEda94" \
  -b ethereum

Testing

51 tests (49 unit + 2 doc-tests) verified against official BIP39/BIP32 test vectors. Existing Python test suite (670 tests) unaffected.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits March 13, 2026 03:49
Implements:
- BIP39 mnemonic handling (validation, seed derivation, English wordlist)
- BIP32 HD key derivation (secp256k1, hardened/normal child keys)
- Bitcoin address generation (P2PKH, P2SH-P2WPKH, P2WPKH/Bech32)
- Ethereum address generation (Keccak-256, EIP-55 checksums)
- Bitcoin Core wallet password recovery (SHA512 + AES-256-CBC)
- MetaMask vault password recovery (Desktop GCM, Mobile CBC)
- Ethereum keystore V3 password verification
- Parallel seed and password recovery engines (Rayon)
- CLI interface with clap (address, validate, seed-recover, password-recover)
- 49 unit tests + 2 doc tests, all passing

Co-authored-by: 3rdIteration <2230318+3rdIteration@users.noreply.github.com>
Co-authored-by: 3rdIteration <2230318+3rdIteration@users.noreply.github.com>
Copilot AI changed the title [WIP] Port codebase to Rust for Bitcoin and Ethereum functionality Add Rust port of btcrecover for Bitcoin and Ethereum functionality Mar 13, 2026
Copilot AI requested a review from 3rdIteration March 13, 2026 03:56
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