<p>It may too late to answer your question but if you still can't recover your wallet. try this method.</p>
<p>There are some questions to ask before coding.</p>
<p><strong>1. The private key</strong></p>
<p>There are many format type of private key, for example</p>
<ul>
<li>Hexadecimal private key (64 length key combination from '0123456789abcdef' letters, case insensitive)</li>
<li>Base58 WIF (51 - 52 length key start with L or K or 5, case sensitive)</li>
</ul>
<p>for 4 missing char, there will be 65,536 (16x16x16x16) key to test in first scenario and 11,316,496 (58x58x58x58) in second scenario
So, What format of your private key?</p>
<p><strong>2. The missing position</strong></p>
<p>Do you know where the missing position is?
If you know, It will be easy to find the key that match with your address, but if not, you must try all possible position and the possible key to test will be very huge</p>
<p><strong>3. The address of damage private key</strong></p>
<p>Do you know the address of that key?
According to your post, there is a p2sh wallet. So the address will start with '3' right? if you know the address, you can loop all possible key above until it match with your target address</p>
<p>the code below is in python. it create on scenario that your private key is hexadecimal format, missing first 4 characters, and you know the address of that damage private key</p>
<pre><code>import hdwallet
import itertools

from hdwallet import HDWallet
from hdwallet.symbols import BTC
hdwallet = HDWallet(symbol=BTC)


#key = 'f79495fda777197ce73551bcd8e162ceca19167575760d3cc2bced4bf2a213dc'

corrupted_key = '95fda777197ce73551bcd8e162ceca19167575760d3cc2bced4bf2a213dc'
Target_address = &quot;3GQVUFePz517Hf61Vsa9H2tHj5jw5y6ngV&quot;


Possible_missing_key = list(itertools.product('0123456789abcdef', repeat=4))

for i in Possible_missing_key:
    Missing_part = ''.join(i)
    privateKey = Missing_part + corrupted_key    
    hdwallet.from_private_key(private_key = privateKey)
    if hdwallet.p2sh_address() == Target_address:
        print(privateKey)        
    hdwallet.clean_derivation()
</code></pre>
<p>You can adjust the code above to suit your case. Hope this help.
if you have any question, there's an email and telegram contact in my profile, feel free to ask.</p>

CC BY-SA 4.0
2022-12-17T08:18:04.863Z
2022-12-17T08:18:04.863Z
Romo
<p>I have a wallet from past with p2sh format, also I know my private key but I just lost 4 character of that, I tried few apps to recover that but no one works(they work on another wallets prefectly), I think cause of p2sh they cant find my lost characters.is there any way to find and recover my private key?(it has +1000btc i really need to recover that and I give very good award if someone help me) sorry for my bad english :)</p>

CC BY-SA 4.0
2021-12-23T12:11:00.723Z
if i understand it correct: do you have 1 p2sh address and with the 1 privkey recovered you can access all of the funds?
Antoni
CC BY-SA 4.0
2021-12-23T13:40:48.670Z
a bitcoin private key is in base58 format (right?), so for bruteforcing 4 characters you need to check 11316496 (11.3 million) private keys... (can take a while)
Antoni
CC BY-SA 4.0
2021-12-23T13:43:09.413Z
maybe your coins are already gone. if one of the tools you tried had evil thoughts about your private key there is no way to get them back
Antoni
CC BY-SA 4.0
2022-01-13T14:26:35.517Z
a private key has checksum bytes, right? the last 4 characters can be made using the 256 bit priv key
Antoni
CC BY-SA 4.0
2022-01-13T14:30:58.077Z
check out this, maybe it helps

- https://en.bitcoin.it/wiki/Wallet_import_format

- https://en.bitcoin.it/wiki/Base58Check_encoding
Antoni
<blockchain><private-key><p2sh><recover-private-key>
Can I recover missed phrase on p2sh wallet?
amirreza karimi
# Can I recover missed phrase on p2sh wallet?

(Asked by: username_0 on 2021-12-07)

I have a wallet from past with p2sh format, also I know my private key but I just lost 4 character of that, I tried few apps to recover that but no one works(they work on another wallets prefectly), I think cause of p2sh they cant find my lost characters.is there any way to find and recover my private key?(it has +1000btc i really need to recover that and I give very good award if someone help me) sorry for my bad english :)

**Tags:** blockchain, private-key, p2sh, recover-private-key

> **Comments:**
> **username_1**: if i understand it correct: do you have 1 p2sh address and with the 1 privkey recovered you can access all of the funds?  
> **username_1**: a bitcoin private key is in base58 format (right?), so for bruteforcing 4 characters you need to check 11316496 (11.3 million) private keys... (can take a while)  
> **username_1**: maybe your coins are already gone. if one of the tools you tried had evil thoughts about your private key there is no way to get them back  
> **username_1**: a private key has checksum bytes, right? the last 4 characters can be made using the 256 bit priv key  
> **username_1**: check out this, maybe it helps  - https://en.bitcoin.it/wiki/Wallet_import_format  - https://en.bitcoin.it/wiki/Base58Check_encoding  

---

## 1 answers

### Answer by username_2 on 2022-12-17. Score: 0

It may too late to answer your question but if you still can't recover your wallet. try this method.

There are some questions to ask before coding.

**1. The private key**

There are many format type of private key, for example

* Hexadecimal private key (64 length key combination from '0123456789abcdef' letters, case insensitive)
* Base58 WIF (51 - 52 length key start with L or K or 5, case sensitive)

for 4 missing char, there will be 65,536 (16x16x16x16) key to test in first scenario and 11,316,496 (58x58x58x58) in second scenario
So, What format of your private key?

**2. The missing position**

Do you know where the missing position is?
If you know, It will be easy to find the key that match with your address, but if not, you must try all possible position and the possible key to test will be very huge

**3. The address of damage private key**

Do you know the address of that key?
According to your post, there is a p2sh wallet. So the address will start with '3' right? if you know the address, you can loop all possible key above until it match with your target address

the code below is in python. it create on scenario that your private key is hexadecimal format, missing first 4 characters, and you know the address of that damage private key

```
import hdwallet
import itertools

from hdwallet import HDWallet
from hdwallet.symbols import BTC
hdwallet = HDWallet(symbol=BTC)

#key = 'f79495fda777197ce73551bcd8e162ceca19167575760d3cc2bced4bf2a213dc'

corrupted_key = '95fda777197ce73551bcd8e162ceca19167575760d3cc2bced4bf2a213dc'
Target_address = "3GQVUFePz517Hf61Vsa9H2tHj5jw5y6ngV"

Possible_missing_key = list(itertools.product('0123456789abcdef', repeat=4))

for i in Possible_missing_key:
    Missing_part = ''.join(i)
    privateKey = Missing_part + corrupted_key    
    hdwallet.from_private_key(private_key = privateKey)
    if hdwallet.p2sh_address() == Target_address:
        print(privateKey)        
    hdwallet.clean_derivation()

```

You can adjust the code above to suit your case. Hope this help.
if you have any question, there's an email and telegram contact in my profile, feel free to ask.


---

