Skip to content

Conversation

@Gaubee
Copy link
Contributor

@Gaubee Gaubee commented Jan 4, 2026

Summary

This PR adds Tron as a first-class chain and introduces a unified chain derivation architecture.

Breaking Changes

  • type -> chainKind: All chain config references to type field have been renamed to chainKind for consistency
  • bip39 -> bitcoin: The chainKind value bip39 has been renamed to bitcoin for semantic clarity

New Features

  1. Tron Support

    • Full address derivation using industry standard path: m/44'/195'/accountIndex'/0/0
    • Base58check address encoding
    • Integrated into chain selector UI
  2. Unified Chain Derivation Module (src/services/wallet/chain-derivation/)

    • KeyMaterialProvider: Shared BIP44 key derivation with caching
    • Strategy pattern for different chain types:
      • EvmStrategy: EVM chains (shared address)
      • BitcoinStrategy: Bitcoin P2PKH
      • TronStrategy: Tron base58check
      • BioforestStrategy: BioForest Ed25519
    • buildWalletChainAddresses(): Single entry point for all derivations
  3. Refactored Pages

    • recover.tsx and create.tsx now use the unified derivation module
    • chain-selector.tsx groups chains by chainKind

Testing

  • 10 new unit tests for chain-derivation module
  • All existing tests updated for chainKind migration
  • TypeScript type-checks pass

Files Changed

  • 56 files modified
  • ~950 lines added, ~270 lines removed

Gaubee added 6 commits January 4, 2026 23:34
BREAKING CHANGE: Chain config 'type' field renamed to 'chainKind'

- Migrate all chain configs from 'type' to 'chainKind' field
- Change 'bip39' chainKind to 'bitcoin' for semantic clarity
- Add new chain-derivation module with Strategy pattern:
  - KeyMaterialProvider: shared BIP44 key derivation
  - EvmStrategy, BitcoinStrategy, TronStrategy, BioforestStrategy
  - buildWalletChainAddresses() as single entry point
- Refactor create/recover pages to use unified derivation
- Update chain-selector to group by chainKind
- Tron now uses industry standard path: m/44'/195'/accountIndex'/0/0
- All unit tests for chain-derivation pass
- Add chainConfigService mocks in chain-adapter tests
- Refactor BioforestChainService and BioforestTransactionService to use lazy config loading
- Fix chain-config tests with saveDefaultVersion in beforeEach
- Update chain-selector tests for new chainKind values
- Fix wallet-storage version test (2 instead of 1)
Merge PR #165 fix/eth-history and adapt for chainKind architecture:
- transactionService(web) now supports all chain types via ChainProvider
- Fix chainKind references (was using type from PR #165)
- Refactor services to use chainId string instead of ChainConfig object:
  - TronIdentityService, TronTransactionService
  - BitcoinIdentityService
  - BioforestIdentityService
- All services now use lazy config loading pattern
@Gaubee Gaubee merged commit b80b7ef into main Jan 5, 2026
5 checks passed
@Gaubee Gaubee deleted the feat/tron-support branch January 5, 2026 01:44
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