bitcoin-dev

Idea for BIP : Deterministic Wallets with Token support

Idea for BIP : Deterministic Wallets with Token support

Original Postby Forrest96er

Posted on: July 6, 2024 20:41 UTC

In the evolving landscape of Ethereum and similar blockchain platforms, a notable increase in the number of new tokens has been observed.

This surge in token variety has outpaced the development of wallet structures designed for managing these assets. Traditional Hierarchical Deterministic (HD) wallets utilize a uniform derivation path for all tokens, leading to the creation of identical addresses for different tokens when managed under a single seed. This phenomenon severely undermines user privacy by making transaction histories more transparent across various tokens.

Addressing this challenge requires a thoughtful revision of the HD wallet structure. The current methodology, which employs a standardized derivation path across all tokens, is not sufficiently adaptable to the diverse ecosystem that Ethereum now hosts. Introducing an additional node to the existing derivation path, while straightforward, presents practical difficulties and does not offer a robust solution to the problem at hand.

A more sophisticated approach involves leveraging the unique address or identifier associated with each token to generate distinct private and public keys. By incorporating an additional input into the HMAC function responsible for child key generation, wallets can achieve enhanced privacy and security. Specifically, it is proposed that a collision-free hash function be applied prior to the use of HMAC, ensuring the integrity and uniqueness of the keys generated. This adjustment is recommended at the "Change" level of the derivation path, allowing for the differentiation between base coin addresses and those of various tokens.

Such a modification not only improves the privacy of transactions but also streamlines the process of managing multiple tokens within a single wallet. In particular, this approach facilitates the use of hardware wallets by eliminating the need for repeated exports of extended public keys. Once an extended public key for a coin is exported to a front-end application, the application can autonomously generate all necessary public keys for scanning transactions across any tokens associated with that coin, even those tokens that were not present at the time of the initial export.

This innovation also addresses potential security concerns. Even if an attacker were to obtain certain public keys used in transactions, the proposed method ensures that they cannot calculate other public keys or access the base coin, thereby safeguarding user assets across different tokens.