johguse / profanity

Vanity address generator for Ethereum
831 stars 321 forks source link

Are there mnemonic words to generate? #70

Open CryptoLagom opened 2 years ago

CryptoLagom commented 2 years ago

I would like to know if there are mnemonics generated and if so, how should I get them?

ef1m0ff commented 2 years ago

no way

bobanm commented 2 years ago

Short answer

No, that would be a security risk.

Detailed answer

Fortunately, that's not how BIP-39 hierarchical deterministic [HD] wallets work. This is the process in a nutshell:

  1. generate entropy
  2. generate a mnemonic from the entropy and its checksum, using a wordlist
  3. generate a seed from the mnemonic and an optional passphrase
  4. generate a master key from the seed
  5. generate one or more private keys from the master key
  6. generate a public key from each private key
  7. generate an address from each public key

As everything else in public-key cryptography, all derivations go in one direction only:

entropy > mnemonic > seed > master key > private key > public key > address

The same reason why you can't generate a private key from an address, is the reason why you can't generate a mnemonic from a private key.

Think of it from security standpoint, if you could generate a seed and a mnemonic from your private key, and that seed is used to derive the master key and all your private keys... Then someone who steals your private key could generate your seed, and then generate all the private keys for all the addresses which correspond to that private key.

Having said all that, it should be absolutely possible to create a program which brute forces different MNEMONICS instead of PRIVATE KEYS as input, searching for an address which fits the given pattern 🤔

To study the topic in more depth, this article nicely explains the ins and outs:

https://medium.com/mycrypto/the-journey-from-mnemonic-phrase-to-address-6c5e86e11e14