-
Notifications
You must be signed in to change notification settings - Fork 5
Description
ElectrumTransform handles the forward direction - generating keys the way old Electrum deterministic wallets did. But there's no ElectrumAnalyzer to go the other way: given a private key, check whether it could have come from Electrum's scheme.
Electrum was one of the most widely used Bitcoin wallets, and its early deterministic derivation (stretching a seed through 100k rounds of SHA256) has a detectable structure. The seed stretching output feeds into get_sequence() which uses the master public key to derive child keys via scalar addition on secp256k1.
An analyzer could:
- Check if the key's scalar relationship to known Electrum master public keys matches the derivation pattern
- For brute-force mode, iterate candidate seeds through the stretching function and compare derived keys
- Support both receiving (for_change=0) and change (for_change=1) chains
The shared module src/electrum.rs already has all the crypto primitives (stretch_key, get_sequence, derive_key). The analyzer would mostly wire these into the Analyzer trait.
Every other major vulnerability type (milksad, mt64, lcg, xorshift, sha256_chain, multibit) has both a transform and an analyzer. Electrum is the gap.