<p>Since you don't have a public key, you need to use a different strategy: you need to query the blockchain to see if there are any transactions for each possible address.</p>
<p>The following bash script tests different bip39 english words as the 25th word for a given mnemonic:</p>
<ul>
<li>extracts the private key from the mnemonic + passphrase</li>
<li>generates public key for derivation paths 44, 49 and 84:
<ul>
<li>generate address for locking scripts p2pkh, p2wpkh, p2shwpkh and p2tr:
<ul>
<li>queries blockchain for address transaction count</li>
<li>If transaction count greater than 0, a big green blob of text will be displayed with all the information needed and the script will exit</li>
</ul>
</li>
</ul>
</li>
</ul>
<p>For each passphrase, a total of 12 addresses will be queried.</p>
<p>Requires:</p>
<ul>
<li>hal from <a href="https://github.com/stevenroose/hal" rel="nofollow noreferrer">https://github.com/stevenroose/hal</a></li>
<li>jq from <a href="https://jqlang.github.io/jq/" rel="nofollow noreferrer">https://jqlang.github.io/jq/</a></li>
</ul>
<p>Script code:</p>
<pre><code>#!/bin/bash

# given a mnemonic, try different bip39 english words as passphrase

# requires hal (https://github.com/stevenroose/hal)
# requires jq (https://jqlang.github.io/jq/)

# font colors
GREEN='\033[0;32m'
NC='\033[0m' # No Color

# put your mnemonic here
mnemonic=&quot;embrace traffic prepare fatigue burger hood shed comic royal whisper sibling suspect silver spoon erupt edge top squirrel ancient seek start noble window autumn&quot;

# all 2048 bip39 english words
dictionary=`curl -s https://raw.githubusercontent.com/bitcoin/bips/master/bip-0039/english.txt`
# or try with just a few: uncomment next line
# dictionary=&quot;prepare bacon burger&quot;

for passphrase in $dictionary
do
  echo &quot;Testing passphrase: $passphrase&quot;
  xpriv=`hal bip39 get-seed --passphrase $passphrase &quot;$mnemonic&quot; | jq -r .seed.bip32_xpriv`
  for d in 44 49 84 # derivation paths
  do
    echo
    derivationPath=&quot;m/$d'/0'/0'/0/0&quot;
    echo -e &quot;  $derivationPath&quot;
    for lock in p2pkh p2wpkh p2shwpkh p2tr # locking scripts
    do
      echo -e &quot;    $lock&quot;
      address=`hal bip32 derive &quot;$xpriv&quot; &quot;$derivationPath&quot; | jq -r .addresses.$lock`
      txcount=`curl -sSL &quot;https://mempool.space/api/address/$address&quot; | jq .chain_stats.tx_count`
      echo -e &quot;      $address = $txcount&quot;
      if [[ $txcount -gt 0 ]]
      then
        echo -e &quot;${GREEN}&quot;
        echo -e &quot;FOUND!&quot;
        echo -e &quot;mnemonic: $mnemonic&quot;
        echo -e &quot;passphrase: $passphrase&quot;
        echo -e &quot;derivation path: $derivationPath&quot;
        echo -e &quot;locking script: $lock&quot;
        echo -e &quot;address: $address&quot;
        echo -e &quot;tx count: $txcount&quot;
        echo -e &quot;${NC}&quot;
        exit
      fi
    done
  done
done
</code></pre>
<p>Save the code to a file called <code>main.sh</code>, <code>chmod +x main.sh</code> and then run <code>./main.sh</code></p>

CC BY-SA 4.0
2024-06-28T10:57:50.337Z
Thanks for your help! With my 24 words i was able to create the 12 addresses and no one has a transaction. So how can i found out the public key without the passphrase? :/
Christian
CC BY-SA 4.0
2024-06-28T11:01:00.927Z
And where can i add the passphrase at your bash here? Thanks a lot!
Christian
CC BY-SA 4.0
2024-06-28T14:27:53.573Z
Save the code to a file called main.sh and then run:
```
./main.sh "embrace traffic prepare fatigue burger hood shed comic royal whisper sibling suspect silver spoon erupt edge top squirrel ancient seek start noble window autumn" "other mnemonic..."
```
bordalix
CC BY-SA 4.0
2024-06-28T14:30:47.810Z
@Christian It seems markdown is not allowed on comments, so I updated the original answer.
bordalix
CC BY-SA 4.0
2024-06-28T19:33:11.983Z
Thanks a lot!
So where can i add my 25 word (the passphrase) there?
Also i dont have other mnemonic. I have that 24 words and i'm missing the passphrase.
So do i need to brutforce all possibilities of the 25 word? Should crazy.
Christian
CC BY-SA 4.0
2024-06-28T21:50:45.040Z
@Christian ahhh, I misunderstood your question, sorry about that. I edited the answer with a new bash script that tests every bip39 english word as passphrase for a given mnemonic. I think this is what you need.
bordalix
CC BY-SA 4.0
2024-06-29T16:49:40.173Z
Thanks! Is it possible to recover unknown words? My friend wrote the passphrase down and we are not able to read it correctly. Maybe possible to recover with knowing the public address?
Christian
CC BY-SA 4.0
2024-06-29T21:56:22.237Z
Yes, just add the words you want. Passphrases don't need to be bip39 words, any string is valid.
bordalix
CC BY-SA 4.0
2024-06-26T15:28:36.310Z
2024-06-28T21:48:04.417Z
2024-06-28T21:48:04.417Z
bordalix
<blockquote>
<p><strong>Is it possible ...</strong></p>
</blockquote>
<p>It is possible to recover a wallet using only the seed phrase and passphrase (if one was used). That is what they are designed for.</p>
<blockquote>
<p><strong>...without having the public key?</strong></p>
</blockquote>
<p>You only need a public key or address if you don't have the whole seed phrase and pass phrase. They are used to check if a guess was correct.</p>
<blockquote>
<p><strong>BEP39</strong> (sic)</p>
</blockquote>
<p>Electrum <a href="https://electrum.readthedocs.io/en/latest/seedphrase.html" rel="nofollow noreferrer">generally doesn't use BIP-39</a>. You need to make sure whatever recovery tools you are using are configured for Electrum and probably configured for the specific choices of configuration you made for Electrum when it (or other software) generated that phrase.</p>
<blockquote>
<p><strong>electrum [doesn't like] my seed</strong></p>
</blockquote>
<p>The message &quot;seed or key not recognized&quot; means your <code>'word1 ... word24'</code> <a href="https://github.com/spesmilo/electrum/blob/9b82321fc083f3fb4728d9f3785a04861a617011/electrum/wallet.py#L2054-L2059" rel="nofollow noreferrer">doesn't look like a seed phrase to Electrum</a>. I have not checked but I suspect the apostrophes/single-quotes are not needed and the phrase should be placed after all other options.</p>
<blockquote>
<pre><code>usage: electrum restore [-h] [-v] [-D ELECTRUM_PATH] [-P] [-w WALLET_PATH]
                   [-o]
                   text
</code></pre>
</blockquote>
<p><sup>Source: some random 2017 webpage - may be outdated. Try <code>electrum help restore</code> with <em>your</em> version. caveat emptor</sup></p>

CC BY-SA 4.0
2024-06-26T13:40:12.220Z
2024-06-26T13:45:51.717Z
2024-06-26T13:45:51.717Z
RedGrittyBrick
<p>Is it possible to recover my wallet (BEP39 with 24 Words and a passphrase) without having the public key?</p>
<p>The problem is that I'm not sure about my passphrase and I need to test around 50 combinations, because I can't read my letters clearly.</p>
<p>I tried to recover around five times but had a wrong passphrase each time. I create a new wallet and I need to do the process over and over.</p>
<p>Is it maybe possible to make a Python script, so that it attempts to recover over and over with various passphrases, and outputs the passphrase that produces the wallet with the balance?</p>
<p>I <strong>tried with btcrecover</strong>, but they need a public key to check the passphrase <strong>and Electrum</strong> doesn't accept my 24-word seed (don't know why)</p>
<p>This is my Python attempt on Linux with Electrum</p>
<pre><code>~/electrum# **/root/.local/bin/electrum restore 'word1 ... word24' --offline  --passphrase password_list.txt -v**
  0.43 | I | simple_config.SimpleConfig | electrum directory /root/.electrum
  0.43 | I | logging | Electrum version: 4.5.5 - https://electrum.org - https://github.com/spesmilo/electrum
  0.44 | I | logging | Python version: 3.8.10 (default, Nov 22 2023, 10:22:35) 
[GCC 9.4.0]. On platform: Linux-5.4.0-166-generic-x86_64-with-glibc2.29
  0.44 | I | logging | Logging to file: None
  0.44 | I | logging | Log filters: verbosity '*', verbosity_shortcuts ''
  0.44 | I | storage.WalletStorage | wallet path /root/.electrum/wallets/default_wallet
  0.44 | I | p/plugin.Plugins | registering hardware coldcard: ('hardware', 'coldcard', 'Coldcard Wallet')
  0.44 | I | p/plugin.Plugins | registering hardware digitalbitbox: ('hardware', 'digitalbitbox', 'Digital Bitbox wallet')
  0.44 | I | p/plugin.Plugins | registering hardware jade: ('hardware', 'jade', 'Jade wallet')
  0.44 | I | p/plugin.Plugins | registering hardware keepkey: ('hardware', 'keepkey', 'KeepKey wallet')
  0.44 | I | p/plugin.Plugins | registering hardware ledger: ('hardware', 'ledger', 'Ledger wallet')
  0.44 | I | p/plugin.Plugins | registering hardware safe_t: ('hardware', 'safe_t', 'Safe-T mini wallet')
  0.44 | I | p/plugin.Plugins | registering hardware trezor: ('hardware', 'trezor', 'Trezor wallet')
  0.44 | I | p/plugin.Plugins | registering wallet type ('2fa', 'trustedcoin')
  0.44 | D | util.profiler | Plugins.__init__ 0.0039 sec
  0.44 | I | storage.WalletStorage | wallet path /root/.electrum/wallets/default_wallet
  0.44 | D | util.profiler | WalletDB.load_transactions 0.0002 sec
  0.45 | I | p/plugin.Plugins | stopped

Seed or key not recognized
</code></pre>

CC BY-SA 4.0
2024-06-26T13:21:04.730Z
Hey Christian, I think you are missing some words, could you perhaps give your question post another read?
Murch
CC BY-SA 4.0
2024-06-28T10:57:36.143Z
if i restore the wallet, the 24 words are working correct. So the words must be correct, is it?
Christian
CC BY-SA 4.0
2024-06-28T14:31:52.223Z
Sorry, I meant that there are some sentences in your question that appear to be incomplete, and I was suggesting that you proofread especially the sentence with the bold text.
Murch
CC BY-SA 4.0
2024-06-28T19:29:36.103Z
Thanks and sorry!
"I tried with btcrecover, but they need a public key to check the passphrase and electrum doesnt accept my 24 words seed (dont know why)"
Christian
<electrum><wallet-recovery><mnemonic-seed><seed><passphrase>
BTC Wallet with Seed but without public key
Christian
# BTC Wallet with Seed but without public key

(Asked by: username_0 on 2024-06-26)

Is it possible to recover my wallet (BEP39 with 24 Words and a passphrase) without having the public key?

The problem is that I'm not sure about my passphrase and I need to test around 50 combinations, because I can't read my letters clearly.

I tried to recover around five times but had a wrong passphrase each time. I create a new wallet and I need to do the process over and over.

Is it maybe possible to make a Python script, so that it attempts to recover over and over with various passphrases, and outputs the passphrase that produces the wallet with the balance?

I **tried with btcrecover**, but they need a public key to check the passphrase **and Electrum** doesn't accept my 24-word seed (don't know why)

This is my Python attempt on Linux with Electrum

```
~/electrum# **/root/.local/bin/electrum restore 'word1 ... word24' --offline  --passphrase password_list.txt -v**
  0.43 | I | simple_config.SimpleConfig | electrum directory /root/.electrum
  0.43 | I | logging | Electrum version: 4.5.5 - https://electrum.org - https://github.com/spesmilo/electrum
  0.44 | I | logging | Python version: 3.8.10 (default, Nov 22 2023, 10:22:35) 
[GCC 9.4.0]. On platform: Linux-5.4.0-166-generic-x86_64-with-glibc2.29
  0.44 | I | logging | Logging to file: None
  0.44 | I | logging | Log filters: verbosity '*', verbosity_shortcuts ''
  0.44 | I | storage.WalletStorage | wallet path /root/.electrum/wallets/default_wallet
  0.44 | I | p/plugin.Plugins | registering hardware coldcard: ('hardware', 'coldcard', 'Coldcard Wallet')
  0.44 | I | p/plugin.Plugins | registering hardware digitalbitbox: ('hardware', 'digitalbitbox', 'Digital Bitbox wallet')
  0.44 | I | p/plugin.Plugins | registering hardware jade: ('hardware', 'jade', 'Jade wallet')
  0.44 | I | p/plugin.Plugins | registering hardware keepkey: ('hardware', 'keepkey', 'KeepKey wallet')
  0.44 | I | p/plugin.Plugins | registering hardware ledger: ('hardware', 'ledger', 'Ledger wallet')
  0.44 | I | p/plugin.Plugins | registering hardware safe_t: ('hardware', 'safe_t', 'Safe-T mini wallet')
  0.44 | I | p/plugin.Plugins | registering hardware trezor: ('hardware', 'trezor', 'Trezor wallet')
  0.44 | I | p/plugin.Plugins | registering wallet type ('2fa', 'trustedcoin')
  0.44 | D | util.profiler | Plugins.__init__ 0.0039 sec
  0.44 | I | storage.WalletStorage | wallet path /root/.electrum/wallets/default_wallet
  0.44 | D | util.profiler | WalletDB.load_transactions 0.0002 sec
  0.45 | I | p/plugin.Plugins | stopped

Seed or key not recognized

```

**Tags:** electrum, wallet-recovery, mnemonic-seed, seed, passphrase

> **Comments:**
> **username_1**: Hey username_0, I think you are missing some words, could you perhaps give your question post another read?  
> **username_0**: if i restore the wallet, the 24 words are working correct. So the words must be correct, is it?  
> **username_1**: Sorry, I meant that there are some sentences in your question that appear to be incomplete, and I was suggesting that you proofread especially the sentence with the bold text.  
> **username_0**: Thanks and sorry! "I tried with btcrecover, but they need a public key to check the passphrase and electrum doesnt accept my 24 words seed (dont know why)"  

---

## 2 answers

### Answer by username_2 on 2024-06-26. Score: 1 | Accepted answer

Since you don't have a public key, you need to use a different strategy: you need to query the blockchain to see if there are any transactions for each possible address.

The following bash script tests different bip39 english words as the 25th word for a given mnemonic:

* extracts the private key from the mnemonic + passphrase
* generates public key for derivation paths 44, 49 and 84:
  + generate address for locking scripts p2pkh, p2wpkh, p2shwpkh and p2tr:
    - queries blockchain for address transaction count
    - If transaction count greater than 0, a big green blob of text will be displayed with all the information needed and the script will exit

For each passphrase, a total of 12 addresses will be queried.

Requires:

* hal from <https://github.com/stevenroose/hal>
* jq from <https://jqlang.github.io/jq/>

Script code:

```
#!/bin/bash

# given a mnemonic, try different bip39 english words as passphrase

# requires hal (https://github.com/stevenroose/hal)
# requires jq (https://jqlang.github.io/jq/)

# font colors
GREEN='\033[0;32m'
NC='\033[0m' # No Color

# put your mnemonic here
mnemonic="embrace traffic prepare fatigue burger hood shed comic royal whisper sibling suspect silver spoon erupt edge top squirrel ancient seek start noble window autumn"

# all 2048 bip39 english words
dictionary=`curl -s https://raw.githubusercontent.com/bitcoin/bips/master/bip-0039/english.txt`
# or try with just a few: uncomment next line
# dictionary="prepare bacon burger"

for passphrase in $dictionary
do
  echo "Testing passphrase: $passphrase"
  xpriv=`hal bip39 get-seed --passphrase $passphrase "$mnemonic" | jq -r .seed.bip32_xpriv`
  for d in 44 49 84 # derivation paths
  do
    echo
    derivationPath="m/$d'/0'/0'/0/0"
    echo -e "  $derivationPath"
    for lock in p2pkh p2wpkh p2shwpkh p2tr # locking scripts
    do
      echo -e "    $lock"
      address=`hal bip32 derive "$xpriv" "$derivationPath" | jq -r .addresses.$lock`
      txcount=`curl -sSL "https://mempool.space/api/address/$address" | jq .chain_stats.tx_count`
      echo -e "      $address = $txcount"
      if [[ $txcount -gt 0 ]]
      then
        echo -e "${GREEN}"
        echo -e "FOUND!"
        echo -e "mnemonic: $mnemonic"
        echo -e "passphrase: $passphrase"
        echo -e "derivation path: $derivationPath"
        echo -e "locking script: $lock"
        echo -e "address: $address"
        echo -e "tx count: $txcount"
        echo -e "${NC}"
        exit
      fi
    done
  done
done

```

Save the code to a file called `main.sh`, `chmod +x main.sh` and then run `./main.sh`

> **Comments:**
> **username_0**: Thanks for your help! With my 24 words i was able to create the 12 addresses and no one has a transaction. So how can i found out the public key without the passphrase? :/  
> **username_0**: And where can i add the passphrase at your bash here? Thanks a lot!  
> **username_2**: Save the code to a file called main.sh and then run: ``` ./main.sh "embrace traffic prepare fatigue burger hood shed comic royal whisper sibling suspect silver spoon erupt edge top squirrel ancient seek start noble window autumn" "other mnemonic..." ```  
> **username_2**: @username_0 It seems markdown is not allowed on comments, so I updated the original answer.  
> **username_0**: Thanks a lot! So where can i add my 25 word (the passphrase) there? Also i dont have other mnemonic. I have that 24 words and i'm missing the passphrase. So do i need to brutforce all possibilities of the 25 word? Should crazy.  
> **username_2**: @username_0 ahhh, I misunderstood your question, sorry about that. I edited the answer with a new bash script that tests every bip39 english word as passphrase for a given mnemonic. I think this is what you need.  
> **username_0**: Thanks! Is it possible to recover unknown words? My friend wrote the passphrase down and we are not able to read it correctly. Maybe possible to recover with knowing the public address?  
> **username_2**: Yes, just add the words you want. Passphrases don't need to be bip39 words, any string is valid.  

---

### Answer by username_3 on 2024-06-26. Score: 0

> **Is it possible ...**

It is possible to recover a wallet using only the seed phrase and passphrase (if one was used). That is what they are designed for.

> **...without having the public key?**

You only need a public key or address if you don't have the whole seed phrase and pass phrase. They are used to check if a guess was correct.

> **BEP39** (sic)

Electrum [generally doesn't use BIP-39](https://electrum.readthedocs.io/en/latest/seedphrase.html). You need to make sure whatever recovery tools you are using are configured for Electrum and probably configured for the specific choices of configuration you made for Electrum when it (or other software) generated that phrase.

> **electrum [doesn't like] my seed**

The message "seed or key not recognized" means your `'word1 ... word24'` [doesn't look like a seed phrase to Electrum](https://github.com/spesmilo/electrum/blob/9b82321fc083f3fb4728d9f3785a04861a617011/electrum/wallet.py#L2054-L2059). I have not checked but I suspect the apostrophes/single-quotes are not needed and the phrase should be placed after all other options.

> ```
> usage: electrum restore [-h] [-v] [-D ELECTRUM_PATH] [-P] [-w WALLET_PATH]
>                    [-o]
>                    text
>
> ```

Source: some random 2017 webpage - may be outdated. Try `electrum help restore` with *your* version. caveat emptor


---

