Search content
Sort by

Showing 16 of 16 results by j55rrt
Post
Topic
Board Bitcoin Technical Support
Re: Private Key lost one character
by
j55rrt
on 16/06/2016, 07:35:19 UTC

yes, it is from bitaddress.org.
My private key start with 5KALGPT****.

Based on bitaddress, private key with 52 characters base58, starts with a 'K' or 'L

Indeed, default they'll give you a WIF Compressed private key, starting with K or L, so i wonder what happened since you ended up with 50 letters starting with a 5.
The two things popping to mind:

1) you used the wallet details to get a private key in WIF format, written it down and forgot 1 letter... Maybe even switched some other letters or couldn't read your handwriting
2) you've written down the WIF compressed PK, but forgot the initial K or L AND one extra letter... The odds of the second letter in the WIF compressed pk being 5 is pretty small tough...

I have to ask: is there any chance you might have printed out the page from bitaddress... Chances of mixing up letters and bad handwriting are pretty small on a printed piece of paper.... I know, it's a longshot, but it's certainly worth your effort to try and remember this

you are right.

Nothing loss to add extra K or L in front and run the script again, although the odds pretty small thought.
I used to tried to replace some character from my writing key, like "o" to zero, "f" to capital F.....perhaps i should spend much effort to try again and again with the script.

Post
Topic
Board Bitcoin Technical Support
Re: Private Key lost one character
by
j55rrt
on 16/06/2016, 07:06:21 UTC
I know it's gonna be a trust issue, but if I were you, I'd ask someone for help with running the scripts. Maybe one of the coders that were helping you. You are running a windows computer, right?

i've ran the script on linux, and it work perfectly to find missing one character with others bitcoin private key.
The issue is my key written on paper just simply doesn't work out as expected , no ideas where gone wrong...hehe

Well, if you did this:
  • generated a new private key
  • removed 1 character
  • ran it trough kn_b_y's script
  • got some valid private keys back, imported them, worked ok

But you cannot run the private key you have on paper trough the same script (0 outputs), chances are pretty high the string you have on paper isn't correct to begin with Sad
A private key in WIF is indeed 51 characters (if i'm not mistaking), so i'm finding it a bit odd...

you say you:
  • generated a private key with bitaddress (i can only assume that's the online bitaddress.org, or maybe the downloaded sourcecode)
  • if i'm not mistaking, bitaddress gives you a Private Key WIF Compressed (52 characters base58, starts with a 'K' or 'L')
  • since your private key starts with a 5, you might have clicked on 'wallet details', so you can see the private key wif compressed, private key wif (51 characters, starts with 5), Private Key Hexadecimal Format and Private Key Base64
  • To begin with, i find it odd that you would have saved the private key wif, instead of the private key wif compressed (since that's the default one)
  • are you sure you already imported in in a wallet like that?

yes, it is from bitaddress.org.
My private key start with 5KALGPT****.

Based on bitaddress, private key with 52 characters base58, starts with a 'K' or 'L
Post
Topic
Board Bitcoin Technical Support
Re: Private Key bad transcription recovery
by
j55rrt
on 16/06/2016, 07:00:04 UTC
.... all we need to do is feed different text possibilities into the validator logically. It may be possible to programmatically find the private key with several characters mistranscribed or missing:

- Starts with "5"? No? Add "5" if missing characters; substitute "5" if right length; add "5" and drop other characters if right length;
- Correct Length: substitute alternate upper/lower case for one character, check all positions for one character wrong, then iterate for increasing numbers of multiple incorrect cases, incorrect letters, etc;
- Missing one character? Try adding all Base58 characters at all positions.

Missing two characters? It becomes a slightly harder problem. Adding two characters in all possible positions = 3,956,064 possibilities (if the 5 at the start is correct). Single-threaded python does about 300,000 SHA256 hashes a second on my PC, so probably less than a minute to try all.

This might be an interesting programming project, but I wouldn't bother until it's actually going to recover some Bitcoins.

It sounds like the private key may need more massaging to recover, whether programmatically, or by analysis of what was written down. I would start by analyzing how you transcribed the private key to paper, and think for yourself where you were and how it might have been written in error. Did you lose your place when writing it down, are there any letters close to each other that repeat? Did you make a mistake in lower/upper case when transcribing. Picture yourself with pen and paper in one hand and screen, you will be your own best resource for figuring out how it might have gone wrong.

Programming a solution to "brute force" what was written down now needs to be informed about further possible ways that mistakes were made.

hehe, i hope i knew where it went wrong  Huh, and it is impossible to recall.... Cry
Post
Topic
Board Bitcoin Technical Support
Re: Private Key lost one character
by
j55rrt
on 16/06/2016, 06:45:46 UTC
I know it's gonna be a trust issue, but if I were you, I'd ask someone for help with running the scripts. Maybe one of the coders that were helping you. You are running a windows computer, right?

i've ran the script on linux, and it work perfectly to find missing one character with others bitcoin private key.
The issue is my key written on paper just simply doesn't work out as expected , no ideas where gone wrong...hehe
Post
Topic
Board Bitcoin Technical Support
Re: Private Key lost one character
by
j55rrt
on 16/06/2016, 06:25:15 UTC
i stored the altcoin in bitcoin address and it was generated from bitaddress, subsequently import the address in omniwallet to view/transfer the coins.

1. 50 characters private key on hand under WIF format, start with "5".
2. I cann't import my private key into omniwallet, now i recall i used to be imported before...but not sure i copy it from clipboard or on my paper written paper.
3. subsequently i found bitaddress private key was generated with 51 characters, and i suspect my 50 characters written on paper was incorrect, and it should be 51 char instead...

Thank you for all dudes in assist to provide the script to find the missing char, but no smiling from lucky lady  Huh Angry
Post
Topic
Board Bitcoin Technical Support
Re: Private Key lost one character
by
j55rrt
on 16/06/2016, 06:12:42 UTC
This is a pretty common problem when recording such a long key.
Always best to test the recorded key before sending bitcoins to it.

I am curious as to how much bitcoins are stuck there for now?

>10 btc Sad
Post
Topic
Board Bitcoin Technical Support
Re: Private Key lost one character
by
j55rrt
on 10/06/2016, 05:57:00 UTC
Here's a script in python which uses deepceleron's idea of using the checksum to filter out bad candidates.

It does depend on python-bitcoinlib.
https://github.com/petertodd/python-bitcoinlib

Code:
import bitcoin.base58
from bitcoin.core import b2x, x
from bitcoin.wallet import CBitcoinSecret, P2PKHBitcoinAddress
from bitcoin.core import Hash

def insert_char(string, char, i):
    return string[:i+1]+char+string[i+1:]

def verify_wif_checksum(wif):
    byte_string = b2x(bitcoin.base58.decode(wif))
    private = byte_string[:-8]
    checksum = byte_string[-8:]
    return checksum == b2x(Hash(x(private)))[:8]

def candidate_wifs(corrupted_wif):
    candidates = []
    for i in range(len(corrupted_wif)):
        for char in bitcoin.base58.B58_DIGITS:
            candidate_wif = insert_char(corrupted_wif, char, i)
            if verify_wif_checksum(candidate_wif):   
                candidates.append(candidate_wif)
    return candidates


# Provide a WIF private key with a single missing character.
corrupted_wif = '5HueCGU8rMjxEXxiPuD5BDku4kFqeZyd4dZ1jvhTVqvbTLvyTJ'
#   Should be:  '5HueCGU8rMjxEXxiPuD5BDku4MkFqeZyd4dZ1jvhTVqvbTLvyTJ'

for candidate_wif in candidate_wifs(corrupted_wif):
    print(candidate_wif)

It should hopefully output any candidate private keys.

For example:
5HueCGU8rMjxEXxiPuD5BDku4MkFqeZyd4dZ1jvhTVqvbTLvyTJ


Hi, the script run perfectly as i did some test. Many thanks!  Wink
However, it show no result when i insert my 50 characters private key. I'm completely out of clue now.... Huh
Post
Topic
Board Bitcoin Technical Support
Re: Private Key lost one character
by
j55rrt
on 18/04/2016, 11:03:09 UTC
@deepceleron: thanks for the info, i never tought about the problem like that.

Since it seems to be an interesting problem, i'll try to write a perl script to take a private key in WIF format with x missing letters as input, and permutate all allowed characters in this string, test if the permutated pk is valid and write all the valid keys to a logfile (or import them in bitcoin core directly).

Since this is a bit more difficult, and i can only work on the problem during my luchbreak, it might take a couple of days tough.

I cann't appreciate enough for your help Cheesy . Take your time, this is not a problem.
Post
Topic
Board Bitcoin Technical Support
Re: Private Key lost one character
by
j55rrt
on 15/04/2016, 12:13:05 UTC
thanks dude, i will run it in cygwin  Wink

If you cannot get it fixed, let us know and i'll rewrite it in perl (not much work, but i won't do it if it's not needed)

that will be great if you can rewrite it in perl.
i just ran it in the cygwin, same error  Grin
Post
Topic
Board Bitcoin Technical Support
Re: Private Key lost one character
by
j55rrt
on 15/04/2016, 07:12:50 UTC
I'm using perl in window, and encounter an error as below. Do i have to define the variables like i='(A..Z)' ??

C:\Strawberry\perl\test>perl test.pl
Missing $ on loop variable at test.pl line 1.

Quote
for i in `perl -e '$,=" ";
print +(A..Z),(a..z),(0..9)'`;

"for i in something; do something; done" is not perl. It's bash, and I don't think you get that in stock windows boxes even today. Install cygwin and try there.

^^ this is correct... I'm running on a linux box (and i wrongly assumed so were you), so it's basically a combination between bash and perl (which is installed by default on 90+% of the linux distros, but not on windows... you need something like mobaXterm or cygwin with some addons to do this task)...
Did you get this solved, or do i have to rewrite it in pure perl?
I'm using perl in window, and encounter an error as below. Do i have to define the variables like i='(A..Z)' ??

C:\Strawberry\perl\test>perl test.pl
Missing $ on loop variable at test.pl line 1.

Quote
for i in `perl -e '$,=" ";
print +(A..Z),(a..z),(0..9)'`;

"for i in something; do something; done" is not perl. It's bash, and I don't think you get that in stock windows boxes even today. Install cygwin and try there.

thanks dude, i will run it in cygwin  Wink
Post
Topic
Board Bitcoin Technical Support
Re: Private Key lost one character
by
j55rrt
on 15/04/2016, 07:05:28 UTC
maybe you can use crunch - wordlist generator
https://sourceforge.net/projects/crunch-wordlist/

Code:
./crunch 52 52 123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz -t L4rK1yDtCWekvXuE6oXD9jCYfFNV2cWRpVuPLBcCU2z8TrisoyY@ -o found.txt

cool tool, i give a try  Cheesy
Post
Topic
Board Bitcoin Technical Support
Re: Private Key lost one character
by
j55rrt
on 15/04/2016, 05:58:29 UTC
I'm using perl in window, and encounter an error as below. Do i have to define the variables like i='(A..Z)' ??

C:\Strawberry\perl\test>perl test.pl
Missing $ on loop variable at test.pl line 1.

Quote
for i in `perl -e '$,=" ";
print +(A..Z),(a..z),(0..9)'`;
Post
Topic
Board Bitcoin Technical Support
Re: Private Key lost one character
by
j55rrt
on 23/03/2016, 13:21:04 UTC
i'm sorry i'm not a programmer Cheesy, any open source tool available to do that?

Do you have bitcoind running on a linux server?
In that case, something like this might work:
Code:
for i in `perl -e '$,=" ";print +(A..Z),(a..z),(0..9)'` ; do bitcoin-cli  importprivkey "yourkey"$i ; done

Bravo! Many thanks! Grin, i don't have bitcoind running now, but i will get one to do so.

That will only guess a final character (i.e. is assuming you missed the very last character only). If you are not certain which character you missed then you'd need to basically repeat like this:

Code:
for i in `perl -e '$,=" ";print +(A..Z),(a..z),(0..9)'` ; do bitcoin-cli  importprivkey "y"$i"ourkey" ; done
for i in `perl -e '$,=" ";print +(A..Z),(a..z),(0..9)'` ; do bitcoin-cli  importprivkey "yo"$i"urkey" ; done
for i in `perl -e '$,=" ";print +(A..Z),(a..z),(0..9)'` ; do bitcoin-cli  importprivkey "you"$i"rkey" ; done
for i in `perl -e '$,=" ";print +(A..Z),(a..z),(0..9)'` ; do bitcoin-cli  importprivkey "your"$i"key" ; done
for i in `perl -e '$,=" ";print +(A..Z),(a..z),(0..9)'` ; do bitcoin-cli  importprivkey "yourk"$i"ey" ; done
for i in `perl -e '$,=" ";print +(A..Z),(a..z),(0..9)'` ; do bitcoin-cli  importprivkey "yourke"$i"y" ; done
for i in `perl -e '$,=" ";print +(A..Z),(a..z),(0..9)'` ; do bitcoin-cli  importprivkey "yourkey"$i ; done

(hope that makes sense and of course the first character is always going to be the 5)


Indeed, i'm going to do so. The missing character is not really the last character but somewhere inside the 50.
Your guys are awesome.
Post
Topic
Board Bitcoin Technical Support
Re: Private Key lost one character
by
j55rrt
on 23/03/2016, 13:11:40 UTC
i'm sorry i'm not a programmer Cheesy, any open source tool available to do that?

Do you have bitcoind running on a linux server?
In that case, something like this might work:
Code:
for i in `perl -e '$,=" ";print +(A..Z),(a..z),(0..9)'` ; do bitcoin-cli  importprivkey "yourkey"$i ; done

Bravo! Many thanks! Grin, i don't have bitcoind running now, but i will get one to do so.
Post
Topic
Board Bitcoin Technical Support
Re: Private Key lost one character
by
j55rrt
on 23/03/2016, 12:59:39 UTC
i'm sorry i'm not a programmer Cheesy, any open source tool available to do that?
Post
Topic
Board Bitcoin Technical Support
Merits 1 from 1 user
Topic OP
Private Key lost one character
by
j55rrt
on 23/03/2016, 12:30:23 UTC
⭐ Merited by ETFbitcoin (1)
Hi,

I wrote my private key on the paper, and i tried to retrieve the btc from the address recently, but found my private key only contain 50 characters! It is my mistake when record down the private key!!

The private key format is WIF without any compressed, base58, start with "5".
I've 50 characters on hand, is there any brute force tools to calculate the key in quick way?

Thank you.