Get In Touch
541 Melville Ave, Palo Alto, CA 94301,
[email protected]
Ph: +1.831.705.5448
Work Inquiries
[email protected]
Ph: +1.831.306.6725
Back

Ethereum: How does the client know the number of keys and coins when recovering from a seed?

How Ethereum Clients Determine Which Keys and Coins Are Associated with a Seed

Ethereum clients use a process called “seed recovery” to recover the private keys associated with a seed. Once you have a seed, it is a string of characters that uniquely identifies your wallet and allows you to recover its contents. However, recovering from a seed can be challenging because there are an infinite number of possible seeds. This article will explain how Ethereum clients determine which keys and coins are associated with a given seed.

Ethereum: How does the client know the number of keys and coins when recovering from a seed?

Determining the Seed

First, Ethereum clients need to obtain a valid source for the wallet they want to recover. A valid source is generated randomly when you create a new wallet or import an existing one. To create the source, your wallet provider (such as MetaMask) uses a random number generator to create a series of numbers, which are then combined with a timestamp and other information.

Generating a Seed Hash

The client then uses a cryptographic hash function (such as SHA-256) to combine the source with a timestamp. This creates a fixed-length string called a “seed hash.” A seed hash is typically around 32-64 characters long.

Recovering a Wallet Address

Once you have the initial hash, your Ethereum client will use it to recover the wallet address associated with your private keys. To do this, your client will:

  • Look up the seed hash in a table or database (known as a “seed table”).
  • Use the initial hash value and other information (such as a timestamp) to generate a new public key.
  • Use the new public key to derive the corresponding private key.

Find out which keys are associated with each coin

Now that you have recovered your wallet address, you can use the following steps to find out which keys are associated with each coin:

  • Get a list of available coins (known as the “coin list”).
  • For each coin, check if it exists in the seed table.
  • If the coin exists, add the corresponding public key and private key to your wallet.

Sample tutorial

Here is an example of how Ethereum clients can recover from a seed:

Let’s say you have a seed hash: 0x1234567890abcdef. Your client has created a new wallet with a private key: 0x1234567890123456.

To recover your wallet address, your client uses the seed hash to generate a new public key and derive the corresponding private key. The new public key is: 0x1abcdef

Your client then checks to see if this public key exists in the coin list:

  • Bitcoin (BIP-44): 0x1234567890abcdef
  • Ethereum (EIP-1559): 0x9876543210987654
  • Other coins…

Since there is no public key for Bitcoin and Ethereum, your client knows that the only remaining coin in the seed table is:

Your client adds the corresponding private key to your wallet: 0x1234567890123456.

This is a basic example of how Ethereum clients recover from a seed. This process can be more complex, especially when dealing with multiple coins and advanced cryptographic techniques. However, it should give you an idea of ​​​​how wallets retrieve their contents from seeds.

Jason setie
Jason setie

Leave a Reply

Your email address will not be published. Required fields are marked *

This website stores cookies on your computer. Cookie Policy