Skip to content

Chain registry, dynamic EVM/UTXO, EIP-1559 and EIP-712#38

Merged
GalaxySciTech merged 1 commit into
masterfrom
cursor/tokencore-global-chains-evm-5ddf
May 3, 2026
Merged

Chain registry, dynamic EVM/UTXO, EIP-1559 and EIP-712#38
GalaxySciTech merged 1 commit into
masterfrom
cursor/tokencore-global-chains-evm-5ddf

Conversation

@GalaxySciTech

Copy link
Copy Markdown
Owner

Summary

This change implements runtime chain registration for EVM and bitcoin-style UTXO networks, unifies chain validation and mnemonic import routing through ChainRegistry, extends AddressCreatorManager and Identity derivation for registered chains, and adds EIP-1559 type-2 transaction signing plus EIP-712 typed-data hashing and signing.

Details

  • ChainRegistry (org.consenlabs.tokencore.wallet.chain): EvmChainRegistration, UtxoChainRegistration, ChainFamily, thread-safe singleton registry.
  • ChainCatalogLoader: bulk register from JSON (family: EVM|UTXO, chainId, slip44 or explicit paths; UTXO rows require address/BIP32 header fields).
  • CustomBitcoinStyleNetParams: configurable NetworkParameters for registered UTXO chains (genesis/difficulty scaffolding cloned from mainnet or testnet3 template).
  • WalletManager / ChainType.validate / Identity: use registry for EVM vs UTXO vs TRON/Filecoin/EOS; findWalletByPrivateKey validates private key for all registered EVM types.
  • Eip1559Transaction: 0x02 || rlp signing; legacy EthereumTransaction unchanged.
  • Eip712Hasher + TypedDataSigner + EthereumSign.signDigest for structured data.
  • README: global chain strategy, catalog note, (chainType, address) wallet keying.
  • Tests: registry/catalog, BIP44 path helpers, EIP-1559 smoke, EIP-712 determinism and signature shape.

Notes

  • EIP-712 implementation covers common atomic types and struct/array-of-struct patterns used in typical dapp payloads; exotic Solidity-only types may need follow-up.
  • Registered UTXO NetworkParameters reuse bitcoin mainnet/testnet3 genesis scaffolding for library compatibility; callers supply real address and BIP32 magic bytes for their chain.
Open in Web Open in Cursor 

Introduce ChainRegistry with EvmChainRegistration and UtxoChainRegistration
plus CustomBitcoinStyleNetParams and ChainCatalogLoader for JSON bulk
registration. ChainType.validate and WalletManager mnemonic import routes
use the registry; AddressCreatorManager resolves registered EVM and UTXO
chains. Identity derives registered EVM/UTXO wallets from default paths.

Add Eip1559Transaction (type-2 raw tx), Eip712Hasher and TypedDataSigner,
and EthereumSign.signDigest for reuse. Document global chain strategy in
README and add unit tests for registry, BIP44 helpers, EIP-1559, and EIP-712.

Co-authored-by: Galaxy <GalaxySciTech@users.noreply.github.com>
@GalaxySciTech GalaxySciTech marked this pull request as ready for review May 3, 2026 06:43
@GalaxySciTech GalaxySciTech merged commit 8d9195d into master May 3, 2026
3 checks passed
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