Skip to content

Conversation

@dirrrtyjesus
Copy link

This commit implements BIP-44 compliant activity-based wallet discovery to find ALL wallets with activity when importing from seed phrase, instead of just checking the first 20 addresses.

Changes

Core Implementation

  • Add GAP_LIMIT (20) and MAX_DISCOVERY_ADDRESSES (1000) constants
  • Implement gap limit discovery algorithm in activityDetection.ts
  • Support batched parallel checking for performance optimization
  • Add progress callback support for UI integration

Blockchain-Specific Activity Checkers

  • Solana: Check SOL balance + transaction history
  • Ethereum: Check ETH balance + nonce (tx count)
  • Both include caching for efficiency

API Updates

  • Export ethereumIndexed() for Ethereum path generation
  • Add getStandardDerivationPath() helper function
  • Update derivationPaths.ts to support activity-based discovery

Benefits

✅ Discovers ALL wallets with activity (not just first 20) ✅ BIP-44 standard compliant gap limit algorithm
✅ Efficient - stops after 20 consecutive empty addresses ✅ Performance optimized with batched parallel RPC calls ✅ Works for both Solana and Ethereum chains
✅ Comprehensive documentation included

Usage

When importing a seed phrase, the wallet will now:

  1. Check addresses sequentially starting from index 0
  2. Detect activity (balance or transactions)
  3. Continue until finding 20 consecutive empty addresses
  4. Return only wallets that have been used

See ACTIVITY_BASED_WALLET_DISCOVERY.md for detailed documentation.

🤖 Generated with Claude Code

This commit implements BIP-44 compliant activity-based wallet discovery
to find ALL wallets with activity when importing from seed phrase, instead
of just checking the first 20 addresses.

## Changes

### Core Implementation
- Add GAP_LIMIT (20) and MAX_DISCOVERY_ADDRESSES (1000) constants
- Implement gap limit discovery algorithm in activityDetection.ts
- Support batched parallel checking for performance optimization
- Add progress callback support for UI integration

### Blockchain-Specific Activity Checkers
- Solana: Check SOL balance + transaction history
- Ethereum: Check ETH balance + nonce (tx count)
- Both include caching for efficiency

### API Updates
- Export ethereumIndexed() for Ethereum path generation
- Add getStandardDerivationPath() helper function
- Update derivationPaths.ts to support activity-based discovery

## Benefits

✅ Discovers ALL wallets with activity (not just first 20)
✅ BIP-44 standard compliant gap limit algorithm
✅ Efficient - stops after 20 consecutive empty addresses
✅ Performance optimized with batched parallel RPC calls
✅ Works for both Solana and Ethereum chains
✅ Comprehensive documentation included

## Usage

When importing a seed phrase, the wallet will now:
1. Check addresses sequentially starting from index 0
2. Detect activity (balance or transactions)
3. Continue until finding 20 consecutive empty addresses
4. Return only wallets that have been used

See ACTIVITY_BASED_WALLET_DISCOVERY.md for detailed documentation.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
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.

1 participant