Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: j55rrt on March 23, 2016, 12:30:23 PM



Title: Private Key lost one character
Post by: j55rrt on March 23, 2016, 12:30:23 PM
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.


Title: Re: Private Key lost one character
Post by: DannyHamilton on March 23, 2016, 12:52:50 PM
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.

If you're sure that you are only missing 1 character, and that you got ALL the other characters correct, then you have less than 3,000 possibilities to try.  A computer program could probably try all the possibilities in less than a second.

Do not give your private key to anybody else to try for you (unless you are VERY CERTAIN that they are trustworthy).  And be VERY careful about any programs anybody else gives you (since they could be trying to trick you into running wallet stealing software).


Title: Re: Private Key lost one character
Post by: mocacinno on March 23, 2016, 12:55:21 PM
Pretty easy to hack something together in bash or perl, just loop trough all the characters, add them to the end of your private key, and try to import them using JSON-RPC, either into bitcoin core or to blockchain.info


Title: Re: Private Key lost one character
Post by: j55rrt on March 23, 2016, 12:59:39 PM
i'm sorry i'm not a programmer :D, any open source tool available to do that?


Title: Re: Private Key lost one character
Post by: mocacinno on March 23, 2016, 01:04:51 PM
i'm sorry i'm not a programmer :D, 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


Title: Re: Private Key lost one character
Post by: j55rrt on March 23, 2016, 01:11:40 PM
i'm sorry i'm not a programmer :D, 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! ;D, i don't have bitcoind running now, but i will get one to do so.


Title: Re: Private Key lost one character
Post by: CIYAM on March 23, 2016, 01:16:06 PM
i'm sorry i'm not a programmer :D, 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! ;D, 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)


Title: Re: Private Key lost one character
Post by: j55rrt on March 23, 2016, 01:21:04 PM
i'm sorry i'm not a programmer :D, 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! ;D, 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.


Title: Re: Private Key lost one character
Post by: mocacinno on March 23, 2016, 01:51:08 PM
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.

Sorry, i wrongfully assumed it was the last character that went missing (wrong copy/paste), but like CIYAM already said, you can repeat the step 50 times ;)

EDIT: btw: you can get the bitcoin-cli binary, connect it to blockchain.info's JSON-RPC API in case you don't want to sync the whole blockchain:

for i in `perl -e '$,=" ";print +(A..Z),(a..z),(0..9)'` ; do bitcoin-cli -rpcconnect=rpc.blockchain.info -rpcport=443 -rpcssl -rpcuser=YourWalletIdentifier -rpcpassword=YourPassword importprivkey "yourkey"$i ; done

Just be carefull: i'm not sure if blockchain will ban your ip after x ammount of tries ;) ALSO: sweep your wallet and move your funds to a secure wallet once you've used blockchain's API, i would personally not trust an online wallet....
(btw: the approach is untested)


Title: Re: Private Key lost one character
Post by: j55rrt on April 15, 2016, 05:58:29 AM
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)'`;


Title: Re: Private Key lost one character
Post by: dserrano5 on April 15, 2016, 06:30:38 AM
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.


Title: Re: Private Key lost one character
Post by: mocacinno on April 15, 2016, 06:33:47 AM
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?


Title: Re: Private Key lost one character
Post by: vlamer on April 15, 2016, 06:35:01 AM
maybe you can use crunch - wordlist generator
https://sourceforge.net/projects/crunch-wordlist/ (https://sourceforge.net/projects/crunch-wordlist/)

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


Title: Re: Private Key lost one character
Post by: mocacinno on April 15, 2016, 06:36:38 AM
maybe you can use crunch - wordlist generator
https://sourceforge.net/projects/crunch-wordlist/ (https://sourceforge.net/projects/crunch-wordlist/)

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

it's a nice tool... I didn't know that one, seems like a really cool tool to use in the future.
Thanks for the link :)


Title: Re: Private Key lost one character
Post by: j55rrt on April 15, 2016, 07:05:28 AM
maybe you can use crunch - wordlist generator
https://sourceforge.net/projects/crunch-wordlist/ (https://sourceforge.net/projects/crunch-wordlist/)

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

cool tool, i give a try  :D


Title: Re: Private Key lost one character
Post by: j55rrt on April 15, 2016, 07:12:50 AM
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  ;)


Title: Re: Private Key lost one character
Post by: mocacinno on April 15, 2016, 09:11:58 AM
thanks dude, i will run it in cygwin  ;)

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)


Title: Re: Private Key lost one character
Post by: j55rrt on April 15, 2016, 12:13:05 PM
thanks dude, i will run it in cygwin  ;)

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  ;D


Title: Re: Private Key bad transcription recovery
Post by: deepceleron on April 17, 2016, 09:21:04 AM
The wallet import format has a checksum in it just like Bitcoin addresses. It is possible to quickly determine if a candidate "recovered" key is valid:

WIF checksum checking

1 - Take the Wallet Import Format string
Code:
   5HueCGU8rMjxEXxiPuD5BDku4MkFqeZyd4dZ1jvhTVqvbTLvyTJ

2 - Convert it to a byte string using Base58Check encoding
Code:
   800C28FCA386C7A227600B2FE50B7CAE11EC86D3BF1FBE471BE89827E19D72AA1D507A5B8D

3 - is the beginning byte string 0x80? If not, invalid.

4 - Drop the last 4 checksum bytes from the byte string
Code:
   800C28FCA386C7A227600B2FE50B7CAE11EC86D3BF1FBE471BE89827E19D72AA1D

5 - Perform SHA-256 hash on the shortened string
Code:
   8147786C4D15106333BF278D71DADAF1079EF2D2440A4DDE37D747DED5403592

6 - Perform SHA-256 hash on result of SHA-256 hash
Code:
   507A5B8DFED0FC6FE8801743720CEDEC06AA5C6FCA72B07C49964492FB98A714

7 - Take the first 4 bytes of the second SHA-256 hash, this is the checksum
Code:
   507A5B8D

8 - Is #7 the same as the last 4 bytes of #2? If not, invalid.

If we have such a checking routine that can try hundreds of WIF key checksums per second, then 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.


Title: Re: Private Key lost one character
Post by: mocacinno on April 18, 2016, 05:49:06 AM
@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.


Title: Re: Private Key lost one character
Post by: j55rrt on April 18, 2016, 11:03:09 AM
@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 :D . Take your time, this is not a problem.


Title: Re: Private Key lost one character
Post by: mocacinno on April 20, 2016, 12:33:33 PM
It isn't finished (yet), i just had 10 minutes over my lunchbreak, so i made a first "draft".. No checking for correct keys ATM.
Just enter the characters that can be used to insert into your key in the $db string, and the key (missing 1 character) in the $privatekey_wif string, and the script will generate all possible combinations...

It should run on windows  :-\ with activestate perl, without any extra modules... It's untested, and i don't take any blame if things go wrong  ;D

You can take this script, and invoke any windows command (like bitcoin-cli  importprivkey $key) and make this work, or you can wait untill i've included a checking-function (if and when i find the time to do this).


Code:
#!c:\perl64\bin\perl.exe
$db = "allvalidcharacters";
$privatekey_wif="mykeymissingonecharacter";
@delen = split('',$privatekey_wif);
@letters = split('',$db);
$length = length($privatekey_wif);
for ($position = 0; $position < $length+1; $position++)
{
foreach(@letters)
{
@new = @delen;
splice(@new, $position, 0, $_);
print join('',@new)."\n";
}
}


Title: Re: Private Key lost one character
Post by: kn_b_y on April 28, 2016, 01:09:54 AM
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


Title: Re: Private Key lost one character
Post by: xhomerx10 on April 28, 2016, 02:48:39 AM
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.

  How many coins are stored in the address?


Title: Re: Private Key lost one character
Post by: mocacinno on April 28, 2016, 06:07:21 AM
Seems like kn_b_y solved your problem  ;D
@kn_b_y: nice work man, just a little tip: try to avoid posting real private keys... The address you generated was empty (luckily), but still used, so if it's part of a wallet of yours, it might be a good idear to "freeze" it, so you don't accidently receive any coins in it...


Title: Re: Private Key lost one character
Post by: kn_b_y on April 28, 2016, 10:02:13 AM
Seems like kn_b_y solved your problem  ;D
@kn_b_y: nice work man, just a little tip: try to avoid posting real private keys... The address you generated was empty (luckily), but still used, so if it's part of a wallet of yours, it might be a good idear to "freeze" it, so you don't accidently receive any coins in it...

Thanks. I'm available for work.  ;) Anybody??

Yeah, I too was curious to see if the address had been used before and noticed some activity.

It's not a key I generated. It's the one from deepceleron's post which is also used in the WIF docs at:
https://en.bitcoin.it/wiki/Wallet_import_format


Title: Re: Private Key lost one character
Post by: kn_b_y on April 28, 2016, 11:51:07 AM
Seems like kn_b_y solved your problem  ;D
@kn_b_y: nice work man, just a little tip: try to avoid posting real private keys... The address you generated was empty (luckily), but still used, so if it's part of a wallet of yours, it might be a good idear to "freeze" it, so you don't accidently receive any coins in it...

Though I noticed the generated address was incorrect - a potential hazzard!

So I've edited the post.


Title: Re: Private Key lost one character
Post by: immangrace on April 30, 2016, 04:49:27 PM
The possibilities to find the missing character seems simple. It is very hard to find it correct. If you're not sure the place of the character in your private key, it may be impossible to generate the correct address.


Title: Re: Private Key lost one character
Post by: mocacinno on May 02, 2016, 09:45:42 AM
The possibilities to find the missing character seems simple. It is very hard to find it correct. If you're not sure the place of the character in your private key, it may be impossible to generate the correct address.

If you read the code kn_b_y has produced, you'll see that it's not only possible, but even not that hard to do... If you're not familiar with python, i already gave a basic start on how to solve the problem with perl (altough kn_b_y's version is a lot better, it only produces valid private keys)


Title: Re: Private Key lost one character
Post by: j55rrt on June 10, 2016, 05:57:00 AM
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!  ;)
However, it show no result when i insert my 50 characters private key. I'm completely out of clue now.... ???


Title: Re: Private Key lost one character
Post by: Rune on June 12, 2016, 05:06:28 PM
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?


Title: Re: Private Key lost one character
Post by: j55rrt on June 16, 2016, 06:12:42 AM
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 :(


Title: Re: Private Key lost one character
Post by: j55rrt on June 16, 2016, 06:25:15 AM
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  ??? >:(


Title: Re: Private Key lost one character
Post by: PantminerS7 on June 16, 2016, 06:36:07 AM
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?


Title: Re: Private Key lost one character
Post by: j55rrt on June 16, 2016, 06:45:46 AM
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


Title: Re: Private Key bad transcription recovery
Post by: deepceleron on June 16, 2016, 06:50:54 AM
.... 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.


Title: Re: Private Key lost one character
Post by: mocacinno on June 16, 2016, 06:58:37 AM
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
You can be pretty sure you're doing it right ;)

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 :(
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?


Title: Re: Private Key bad transcription recovery
Post by: j55rrt on June 16, 2016, 07:00:04 AM
.... 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  ???, and it is impossible to recall.... :'(


Title: Re: Private Key lost one character
Post by: j55rrt on June 16, 2016, 07:06:21 AM
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 :(
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


Title: Re: Private Key lost one character
Post by: mocacinno on June 16, 2016, 07:22:37 AM

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


Title: Re: Private Key lost one character
Post by: j55rrt on June 16, 2016, 07:35:19 AM

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.



Title: Re: Private Key lost one character
Post by: mocacinno on June 16, 2016, 08:30:46 AM
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.



>10BTC is worth >$7k at current preev rate. If i were you, i'd try everything to get that money back. $7k is not the end of the world, but i'd have to work for a really long time in order to put $7k in my savings account...

You can try to interpolate all letters you're unsure about, generate addresses starting with K or L,.... Maye you'll get lucky :)
The other option is to offer a 10 or 20% finders fee and let some REALLY, REALLY, REALLY trusted member try to solve your problem. It's certainly something you shouldn't do very lightly, since it'll involve sending this person everything you know (including the written pk). If you take this path, defenately chose somebody who has been around for a long time, did business worth at least 100BTC on this forum, has a lot of green trust, didn't change his/her password recently, and can sign a message with a really old staked address. Sending over the private key should be a "last resort", but if it's chosing between forfeiting 10BTC or giving 2BTC finders fee and recuperating 8BTC with a reasonable risk, i'd chose the latter.


Title: Re: Private Key lost one character
Post by: jackjack on June 21, 2016, 01:25:57 PM
Nearly everything has been said I think :(

You can also try to generate many empty WIF private keys, write them down and then compare your writings with the original ones
With much luck you may find what errors you tend to make: mixing one letter with another, mixing two consecutive letters, capitalizing downcase letters, etc


Title: Re: Private Key lost one character
Post by: miguelmorales85 on June 25, 2016, 10:25:34 AM

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.



I wonder if you could recover your key. update us please


Title: Re: Private Key lost one character
Post by: kn_b_y on September 29, 2016, 10:37:10 PM
I missed the recent activity in this thread.

Here's another script that substitutes replacements from the base58 character set for each character in the bad wif, and then inserts all base58 chars at each position in the string.

So it should deal with all private keys that have one missing character plus one mistranscribed character.

It takes about 15 minutes to run on my old, slow laptop, but I've included progress output so that you can tell something is at least happening.

Code:
import bitcoin.base58
from bitcoin.core import b2x, x
from bitcoin.core import Hash
import sys

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

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 = set()
    for i in range(len(corrupted_wif)):
        #print("%i of %i" % (i, len(corrupted_wif)),)
        sys.stdout.write("%3i of %3i : " % (i, len(corrupted_wif)))
        for char in bitcoin.base58.B58_DIGITS:
            sys.stdout.write(char)
            candidate_wif = replace_char(corrupted_wif, char, i)
            for c in insertion_candidates(candidate_wif):
                candidates.add(c)
        print()
    return candidates

def insertion_candidates(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):
                print("\nFound: %s" % candidate_wif)
                candidates.append(candidate_wif)
    return candidates

# Provide a WIF private key with a single missing character.
# Wrong Char              v
corrupted_wif = '5HueCGU8rkjxEXxiPuD5BDku4kFqeZyd4dZ1jvhTVqvbTLvyTJ'
#  Should be:   '5HueCGU8rMjxEXxiPuD5BDku4MkFqeZyd4dZ1jvhTVqvbTLvyTJ'
#  Missing Char                           ^
for candidate_wif in candidate_wifs(corrupted_wif):
    print(candidate_wif)


Title: Re: Private Key lost one character
Post by: JBRai on March 02, 2020, 06:32:16 PM
Hi All

I was wanting to know if anyone could provide me a search command as i am missing 4 characters from my private key base 58.  From the search command how would you know if the private key is valid or not?

My private key starts with K i have 48/49 characters i just require a search command so my friend can complete this for me?

please let me know thanks


Title: Re: Private Key lost one character
Post by: DaveF on March 02, 2020, 11:51:28 PM
Hi All

I was wanting to know if anyone could provide me a search command as i am missing 4 characters from my private key base 58.  From the search command how would you know if the private key is valid or not?

My private key starts with K i have 48/49 characters i just require a search command so my friend can complete this for me?

please let me know thanks

If you know where the characters are missing then take a look here:

https://bitcointalk.org/index.php?topic=5214021.0

Download and run. Depending on the speed of your system should not take long at all.

-Dave


Title: Re: Private Key lost one character
Post by: JBRai on April 12, 2020, 11:23:20 PM
Hi I saw your Post as i am trying to retrieve my misssing character how would i run this code on a mac book pro?

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



Title: Re: Private Key lost one character
Post by: HCP on April 13, 2020, 02:55:54 AM
Hi I saw your Post as i am trying to retrieve my misssing character how would i run this code on a mac book pro?
It's a Python script... a MacBook Pro should have python install by default. You just need to copy/paste the 'script' from that post into a text file, edit the 'corrupted_wif' value to be the WIF of yours that is missing one character and then save the file as "corrupt_wif.py" or some other name... as long as it ends in .py

You will also need to make sure you have the python bitcoinlib library installed. So open a 'terminal' and type:
Code:
pip install bitcoinlib

Once that is installed, you then change the current directory in the terminal to where you created the .py file... and use:
Code:
python corrupt_wif.py

That should run the script for you.

This very short video shows how to create the script using the text editor and run it: https://www.youtube.com/watch?v=Txt-cLLa_vo


Title: Re: Private Key lost one character
Post by: JBRai on April 14, 2020, 09:31:50 AM
Thanks

Hi I saw your Post as i am trying to retrieve my misssing character how would i run this code on a mac book pro?
It's a Python script... a MacBook Pro should have python install by default. You just need to copy/paste the 'script' from that post into a text file, edit the 'corrupted_wif' value to be the WIF of yours that is missing one character and then save the file as "corrupt_wif.py" or some other name... as long as it ends in .py

You will also need to make sure you have the python bitcoinlib library installed. So open a 'terminal' and type:
Code:
pip install bitcoinlib

Once that is installed, you then change the current directory in the terminal to where you created the .py file... and use:
Code:
python corrupt_wif.py

That should run the script for you.

This very short video shows how to create the script using the text editor and run it: https://www.youtube.com/watch?v=Txt-cLLa_vo


Title: Re: Private Key lost one character
Post by: JBRai on April 24, 2020, 12:47:36 PM
MY Mac throws back an error when using just python and python3 : [Errno 2]

Hi I saw your Post as i am trying to retrieve my misssing character how would i run this code on a mac book pro?
It's a Python script... a MacBook Pro should have python install by default. You just need to copy/paste the 'script' from that post into a text file, edit the 'corrupted_wif' value to be the WIF of yours that is missing one character and then save the file as "corrupt_wif.py" or some other name... as long as it ends in .py

You will also need to make sure you have the python bitcoinlib library installed. So open a 'terminal' and type:
Code:
pip install bitcoinlib

Once that is installed, you then change the current directory in the terminal to where you created the .py file... and use:
Code:
python corrupt_wif.py

That should run the script for you.

This very short video shows how to create the script using the text editor and run it: https://www.youtube.com/watch?v=Txt-cLLa_vo


Title: Re: Private Key lost one character
Post by: HCP on April 24, 2020, 10:49:35 PM
MY Mac throws back an error when using just python and python3 : [Errno 2]
At which point? When you're running pip... or when you're running python? ???

Are you able to take a screenshot of the command you're entering and the output and then upload it to an image hosting service (like imgur.com (https://imgur.com/) or lightshot (https://prnt.sc/))?


Title: Re: Private Key lost one character
Post by: JBRai on April 26, 2020, 08:53:03 PM
I was trying to use pip3 and python 3 and script was not working invalid error.   I have updated python and python3 reinstalled the updated version and going to try again.

MY Mac throws back an error when using just python and python3 : [Errno 2]
At which point? When you're running pip... or when you're running python? ???

Are you able to take a screenshot of the command you're entering and the output and then upload it to an image hosting service (like imgur.com (https://imgur.com/) or lightshot (https://prnt.sc/))?


Title: Re: Private Key lost one character
Post by: HCP on April 26, 2020, 11:07:39 PM
Ok, well if you have any more troubles, you'll either need to take a screenshot of the error... or copy/paste everything that is being shown in the terminal window when you try to run the commands.

"Invalid Error" and/or "[Errno 2]" don't really tell us anything, so it isn't possible to troubleshoot that properly. :-\


Title: Re: Private Key lost one character
Post by: JBRai on May 03, 2020, 11:00:06 PM
Quote
Ok, well if you have any more troubles, you'll either need to take a screenshot of the error... or copy/paste everything that is being shown in the terminal window when you try to run the commands.

"Invalid Error" and/or "[Errno 2]" don't really tell us anything, so it isn't possible to troubleshoot that properly. :-\

I installed "pip install bitcoinlib & pip install base58
ran using python corrupt_wif.py
failed please help - can't open file 'corrupt_wif.py': [Errno 2] No such file or directory cannot open file

Last login: Fri May  1 12:35:46 on console

The default interactive shell is now zsh.
To update your account to use zsh, please run `chsh -s /bin/zsh`.
For more details, please visit https://support.apple.com/kb/HT208050.
Jaymins-MacBook-Pro:~ jayminr$ cd desktop
Jaymins-MacBook-Pro:desktop jayminr$ cd btc1
Jaymins-MacBook-Pro:btc1 jayminr$ pip install bitcoinlib
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting bitcoinlib
  Using cached https://files.pythonhosted.org/packages/d5/5d/82ee2839784b79a8bbb9448298885ac36d2c865eae135ebd78ae70ca228f/bitcoinlib-0.4.14.tar.gz
Collecting requests>=2.20.0 (from bitcoinlib)
  Using cached https://files.pythonhosted.org/packages/1a/70/1935c770cb3be6e3a8b78ced23d7e0f3b187f5cbfab4749523ed65d7c9b1/requests-2.23.0-py2.py3-none-any.whl
Collecting pyaes==1.6.1 (from bitcoinlib)
  Using cached https://files.pythonhosted.org/packages/44/66/2c17bae31c906613795711fc78045c285048168919ace2220daa372c7d72/pyaes-1.6.1.tar.gz
Collecting scrypt>=0.8.13 (from bitcoinlib)
  Using cached https://files.pythonhosted.org/packages/80/3d/141eb80e754b86f6c25a2ffaf6c3af3acdb65a3e3700829a05ab0c5d965d/scrypt-0.8.13.tar.gz
Collecting SQLAlchemy>=1.3.2 (from bitcoinlib)
  Downloading https://files.pythonhosted.org/packages/75/6a/25db5c553cc45718752886fa849d6f8f828374c3c480ec0b18fdb0a31df6/SQLAlchemy-1.3.16-cp27-cp27m-macosx_10_13_x86_64.whl (1.2MB)
     |████████████████████████████████| 1.2MB 1.7MB/s
Collecting six>=1.10 (from bitcoinlib)
  Downloading https://files.pythonhosted.org/packages/65/eb/1f97cb97bfc2390a276969c6fae16075da282f5058082d4cb10c6c5c1dba/six-1.14.0-py2.py3-none-any.whl
Collecting enum34 (from bitcoinlib)
  Downloading https://files.pythonhosted.org/packages/6f/2c/a9386903ece2ea85e9807e0e062174dc26fdce8b05f216d00491be29fad5/enum34-1.1.10-py2-none-any.whl
Collecting pathlib2 (from bitcoinlib)
  Downloading https://files.pythonhosted.org/packages/e9/45/9c82d3666af4ef9f221cbb954e1d77ddbb513faf552aea6df5f37f1a4859/pathlib2-2.3.5-py2.py3-none-any.whl
Collecting fastecdsa==1.7.5 (from bitcoinlib)
  Downloading https://files.pythonhosted.org/packages/ad/28/8ccec53ea74fb05fe6bca055e67b4a860a664fe2e490fc291e7eff721278/fastecdsa-1.7.5-cp27-cp27m-macosx_10_13_x86_64.whl (46kB)
     |████████████████████████████████| 51kB 11.7MB/s
Collecting urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 (from requests>=2.20.0->bitcoinlib)
  Using cached https://files.pythonhosted.org/packages/e1/e5/df302e8017440f111c11cc41a6b432838672f5a70aa29227bf58149dc72f/urllib3-1.25.9-py2.py3-none-any.whl
Collecting idna<3,>=2.5 (from requests>=2.20.0->bitcoinlib)
  Using cached https://files.pythonhosted.org/packages/89/e3/afebe61c546d18fb1709a61bee788254b40e736cff7271c7de5de2dc4128/idna-2.9-py2.py3-none-any.whl
Collecting chardet<4,>=3.0.2 (from requests>=2.20.0->bitcoinlib)
  Using cached https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl
Collecting certifi>=2017.4.17 (from requests>=2.20.0->bitcoinlib)
  Using cached https://files.pythonhosted.org/packages/57/2b/26e37a4b034800c960a00c4e1b3d9ca5d7014e983e6e729e33ea2f36426c/certifi-2020.4.5.1-py2.py3-none-any.whl
Collecting scandir; python_version < "3.5" (from pathlib2->bitcoinlib)
  Downloading https://files.pythonhosted.org/packages/df/f5/9c052db7bd54d0cbf1bc0bb6554362bba1012d03e5888950a4f5c5dadc4e/scandir-1.10.0.tar.gz
Installing collected packages: urllib3, idna, chardet, certifi, requests, pyaes, scrypt, SQLAlchemy, six, enum34, scandir, pathlib2, fastecdsa, bitcoinlib
  Running setup.py install for pyaes ... done
  Running setup.py install for scrypt ... error
    ERROR: Command errored out with exit status 1:
     command: /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/qm/ty1630ms3zgcn56sg60f8qc80000gn/T/pip-install-l5jxx8/scrypt/setup.py'"'"'; __file__='"'"'/private/var/folders/qm/ty1630ms3zgcn56sg60f8qc80000gn/T/pip-install-l5jxx8/scrypt/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/qm/ty1630ms3zgcn56sg60f8qc80000gn/T/pip-record-b6Ycnk/install-record.txt --single-version-externally-managed --compile
         cwd: /private/var/folders/qm/ty1630ms3zgcn56sg60f8qc80000gn/T/pip-install-l5jxx8/scrypt/
    Complete output (36 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.9-x86_64-2.7
    creating build/lib.macosx-10.9-x86_64-2.7/scrypt
    copying scrypt/__init__.py -> build/lib.macosx-10.9-x86_64-2.7/scrypt
    copying scrypt/scrypt.py -> build/lib.macosx-10.9-x86_64-2.7/scrypt
    running build_ext
    building '_scrypt' extension
    creating build/temp.macosx-10.9-x86_64-2.7
    creating build/temp.macosx-10.9-x86_64-2.7/src
    creating build/temp.macosx-10.9-x86_64-2.7/scrypt-1.2.1
    creating build/temp.macosx-10.9-x86_64-2.7/scrypt-1.2.1/lib
    creating build/temp.macosx-10.9-x86_64-2.7/scrypt-1.2.1/lib/crypto
    creating build/temp.macosx-10.9-x86_64-2.7/scrypt-1.2.1/lib/scryptenc
    creating build/temp.macosx-10.9-x86_64-2.7/scrypt-1.2.1/lib/util
    creating build/temp.macosx-10.9-x86_64-2.7/scrypt-1.2.1/libcperciva
    creating build/temp.macosx-10.9-x86_64-2.7/scrypt-1.2.1/libcperciva/alg
    creating build/temp.macosx-10.9-x86_64-2.7/scrypt-1.2.1/libcperciva/crypto
    creating build/temp.macosx-10.9-x86_64-2.7/scrypt-1.2.1/libcperciva/util
    gcc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DHAVE_CONFIG_H -DHAVE_SYSCTL_HW_USERMEM=1 -Iscrypt-1.2.1 -Iscrypt-1.2.1/lib -Iscrypt-1.2.1/lib/scryptenc -Iscrypt-1.2.1/lib/crypto -Iscrypt-1.2.1/lib/util -Iscrypt-1.2.1/libcperciva/cpusupport -Iscrypt-1.2.1/libcperciva/alg -Iscrypt-1.2.1/libcperciva/util -Iscrypt-1.2.1/libcperciva/crypto -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/scrypt.c -o build/temp.macosx-10.9-x86_64-2.7/src/scrypt.o
    gcc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DHAVE_CONFIG_H -DHAVE_SYSCTL_HW_USERMEM=1 -Iscrypt-1.2.1 -Iscrypt-1.2.1/lib -Iscrypt-1.2.1/lib/scryptenc -Iscrypt-1.2.1/lib/crypto -Iscrypt-1.2.1/lib/util -Iscrypt-1.2.1/libcperciva/cpusupport -Iscrypt-1.2.1/libcperciva/alg -Iscrypt-1.2.1/libcperciva/util -Iscrypt-1.2.1/libcperciva/crypto -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c scrypt-1.2.1/lib/crypto/crypto_scrypt_smix_sse2.c -o build/temp.macosx-10.9-x86_64-2.7/scrypt-1.2.1/lib/crypto/crypto_scrypt_smix_sse2.o
    gcc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DHAVE_CONFIG_H -DHAVE_SYSCTL_HW_USERMEM=1 -Iscrypt-1.2.1 -Iscrypt-1.2.1/lib -Iscrypt-1.2.1/lib/scryptenc -Iscrypt-1.2.1/lib/crypto -Iscrypt-1.2.1/lib/util -Iscrypt-1.2.1/libcperciva/cpusupport -Iscrypt-1.2.1/libcperciva/alg -Iscrypt-1.2.1/libcperciva/util -Iscrypt-1.2.1/libcperciva/crypto -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c scrypt-1.2.1/lib/crypto/crypto_scrypt_smix.c -o build/temp.macosx-10.9-x86_64-2.7/scrypt-1.2.1/lib/crypto/crypto_scrypt_smix.o
    gcc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DHAVE_CONFIG_H -DHAVE_SYSCTL_HW_USERMEM=1 -Iscrypt-1.2.1 -Iscrypt-1.2.1/lib -Iscrypt-1.2.1/lib/scryptenc -Iscrypt-1.2.1/lib/crypto -Iscrypt-1.2.1/lib/util -Iscrypt-1.2.1/libcperciva/cpusupport -Iscrypt-1.2.1/libcperciva/alg -Iscrypt-1.2.1/libcperciva/util -Iscrypt-1.2.1/libcperciva/crypto -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c scrypt-1.2.1/lib/crypto/crypto_scrypt.c -o build/temp.macosx-10.9-x86_64-2.7/scrypt-1.2.1/lib/crypto/crypto_scrypt.o
    gcc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DHAVE_CONFIG_H -DHAVE_SYSCTL_HW_USERMEM=1 -Iscrypt-1.2.1 -Iscrypt-1.2.1/lib -Iscrypt-1.2.1/lib/scryptenc -Iscrypt-1.2.1/lib/crypto -Iscrypt-1.2.1/lib/util -Iscrypt-1.2.1/libcperciva/cpusupport -Iscrypt-1.2.1/libcperciva/alg -Iscrypt-1.2.1/libcperciva/util -Iscrypt-1.2.1/libcperciva/crypto -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c scrypt-1.2.1/lib/scryptenc/scryptenc.c -o build/temp.macosx-10.9-x86_64-2.7/scrypt-1.2.1/lib/scryptenc/scryptenc.o
    gcc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DHAVE_CONFIG_H -DHAVE_SYSCTL_HW_USERMEM=1 -Iscrypt-1.2.1 -Iscrypt-1.2.1/lib -Iscrypt-1.2.1/lib/scryptenc -Iscrypt-1.2.1/lib/crypto -Iscrypt-1.2.1/lib/util -Iscrypt-1.2.1/libcperciva/cpusupport -Iscrypt-1.2.1/libcperciva/alg -Iscrypt-1.2.1/libcperciva/util -Iscrypt-1.2.1/libcperciva/crypto -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c scrypt-1.2.1/lib/scryptenc/scryptenc_cpuperf.c -o build/temp.macosx-10.9-x86_64-2.7/scrypt-1.2.1/lib/scryptenc/scryptenc_cpuperf.o
    gcc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DHAVE_CONFIG_H -DHAVE_SYSCTL_HW_USERMEM=1 -Iscrypt-1.2.1 -Iscrypt-1.2.1/lib -Iscrypt-1.2.1/lib/scryptenc -Iscrypt-1.2.1/lib/crypto -Iscrypt-1.2.1/lib/util -Iscrypt-1.2.1/libcperciva/cpusupport -Iscrypt-1.2.1/libcperciva/alg -Iscrypt-1.2.1/libcperciva/util -Iscrypt-1.2.1/libcperciva/crypto -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c scrypt-1.2.1/lib/util/memlimit.c -o build/temp.macosx-10.9-x86_64-2.7/scrypt-1.2.1/lib/util/memlimit.o
    gcc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DHAVE_CONFIG_H -DHAVE_SYSCTL_HW_USERMEM=1 -Iscrypt-1.2.1 -Iscrypt-1.2.1/lib -Iscrypt-1.2.1/lib/scryptenc -Iscrypt-1.2.1/lib/crypto -Iscrypt-1.2.1/lib/util -Iscrypt-1.2.1/libcperciva/cpusupport -Iscrypt-1.2.1/libcperciva/alg -Iscrypt-1.2.1/libcperciva/util -Iscrypt-1.2.1/libcperciva/crypto -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c scrypt-1.2.1/libcperciva/alg/sha256.c -o build/temp.macosx-10.9-x86_64-2.7/scrypt-1.2.1/libcperciva/alg/sha256.o
    gcc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DHAVE_CONFIG_H -DHAVE_SYSCTL_HW_USERMEM=1 -Iscrypt-1.2.1 -Iscrypt-1.2.1/lib -Iscrypt-1.2.1/lib/scryptenc -Iscrypt-1.2.1/lib/crypto -Iscrypt-1.2.1/lib/util -Iscrypt-1.2.1/libcperciva/cpusupport -Iscrypt-1.2.1/libcperciva/alg -Iscrypt-1.2.1/libcperciva/util -Iscrypt-1.2.1/libcperciva/crypto -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c scrypt-1.2.1/libcperciva/crypto/crypto_aes_aesni.c -o build/temp.macosx-10.9-x86_64-2.7/scrypt-1.2.1/libcperciva/crypto/crypto_aes_aesni.o
    gcc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DHAVE_CONFIG_H -DHAVE_SYSCTL_HW_USERMEM=1 -Iscrypt-1.2.1 -Iscrypt-1.2.1/lib -Iscrypt-1.2.1/lib/scryptenc -Iscrypt-1.2.1/lib/crypto -Iscrypt-1.2.1/lib/util -Iscrypt-1.2.1/libcperciva/cpusupport -Iscrypt-1.2.1/libcperciva/alg -Iscrypt-1.2.1/libcperciva/util -Iscrypt-1.2.1/libcperciva/crypto -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c scrypt-1.2.1/libcperciva/crypto/crypto_aes.c -o build/temp.macosx-10.9-x86_64-2.7/scrypt-1.2.1/libcperciva/crypto/crypto_aes.o
    scrypt-1.2.1/libcperciva/crypto/crypto_aes.c:6:10: fatal error: 'openssl/aes.h' file not found
    #include <openssl/aes.h>
             ^~~~~~~~~~~~~~~
    1 error generated.
    error: command 'gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/qm/ty1630ms3zgcn56sg60f8qc80000gn/T/pip-install-l5jxx8/scrypt/setup.py'"'"'; __file__='"'"'/private/var/folders/qm/ty1630ms3zgcn56sg60f8qc80000gn/T/pip-install-l5jxx8/scrypt/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/qm/ty1630ms3zgcn56sg60f8qc80000gn/T/pip-record-b6Ycnk/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.
WARNING: You are using pip version 19.2.3, however version 20.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Jaymins-MacBook-Pro:btc1 jayminr$ pip install --upgrade pip
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting pip
  Downloading https://files.pythonhosted.org/packages/54/2e/df11ea7e23e7e761d484ed3740285a34e38548cf2bad2bed3dd5768ec8b9/pip-20.1-py2.py3-none-any.whl (1.5MB)
     |████████████████████████████████| 1.5MB 1.7MB/s
Installing collected packages: pip
  Found existing installation: pip 19.2.3
    Uninstalling pip-19.2.3:
      Successfully uninstalled pip-19.2.3
Successfully installed pip-20.1
Jaymins-MacBook-Pro:btc1 jayminr$ pip install bitcoinlib
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting bitcoinlib
  Using cached bitcoinlib-0.4.14.tar.gz (418 kB)
Requirement already satisfied: requests>=2.20.0 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from bitcoinlib) (2.23.0)
Requirement already satisfied: pyaes==1.6.1 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from bitcoinlib) (1.6.1)
Collecting scrypt>=0.8.13
  Using cached scrypt-0.8.13.tar.gz (53 kB)
Collecting SQLAlchemy>=1.3.2
  Using cached SQLAlchemy-1.3.16-cp27-cp27m-macosx_10_13_x86_64.whl (1.2 MB)
Collecting six>=1.10
  Using cached six-1.14.0-py2.py3-none-any.whl (10 kB)
Collecting enum34
  Using cached enum34-1.1.10-py2-none-any.whl (11 kB)
Collecting pathlib2
  Using cached pathlib2-2.3.5-py2.py3-none-any.whl (18 kB)
Collecting fastecdsa==1.7.5
  Using cached fastecdsa-1.7.5-cp27-cp27m-macosx_10_13_x86_64.whl (46 kB)
Requirement already satisfied: idna<3,>=2.5 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from requests>=2.20.0->bitcoinlib) (2.9)
Requirement already satisfied: chardet<4,>=3.0.2 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from requests>=2.20.0->bitcoinlib) (3.0.4)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from requests>=2.20.0->bitcoinlib) (1.25.9)
Requirement already satisfied: certifi>=2017.4.17 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from requests>=2.20.0->bitcoinlib) (2020.4.5.1)
Collecting scandir; python_version < "3.5"
  Using cached scandir-1.10.0.tar.gz (33 kB)
Could not build wheels for bitcoinlib, since package 'wheel' is not installed.
Could not build wheels for requests, since package 'wheel' is not installed.
Could not build wheels for pyaes, since package 'wheel' is not installed.
Could not build wheels for scrypt, since package 'wheel' is not installed.
Could not build wheels for idna, since package 'wheel' is not installed.
Could not build wheels for chardet, since package 'wheel' is not installed.
Could not build wheels for urllib3, since package 'wheel' is not installed.
Could not build wheels for certifi, since package 'wheel' is not installed.
Could not build wheels for scandir, since package 'wheel' is not installed.
Installing collected packages: scrypt, SQLAlchemy, six, enum34, scandir, pathlib2, fastecdsa, bitcoinlib
    Running setup.py install for scrypt ... error
    ERROR: Command errored out with exit status 1:
     command: /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/qm/ty1630ms3zgcn56sg60f8qc80000gn/T/pip-install-9SjoG3/scrypt/setup.py'"'"'; __file__='"'"'/private/var/folders/qm/ty1630ms3zgcn56sg60f8qc80000gn/T/pip-install-9SjoG3/scrypt/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/qm/ty1630ms3zgcn56sg60f8qc80000gn/T/pip-record-7mrMdQ/install-record.txt --single-version-externally-managed --compile --install-headers /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/scrypt
         cwd: /private/var/folders/qm/ty1630ms3zgcn56sg60f8qc80000gn/T/pip-install-9SjoG3/scrypt/
    Complete output (36 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.9-x86_64-2.7
    creating build/lib.macosx-10.9-x86_64-2.7/scrypt
    copying scrypt/__init__.py -> build/lib.macosx-10.9-x86_64-2.7/scrypt
    copying scrypt/scrypt.py -> build/lib.macosx-10.9-x86_64-2.7/scrypt
    running build_ext
    building '_scrypt' extension
    creating build/temp.macosx-10.9-x86_64-2.7
    creating build/temp.macosx-10.9-x86_64-2.7/src
    creating build/temp.macosx-10.9-x86_64-2.7/scrypt-1.2.1
    creating build/temp.macosx-10.9-x86_64-2.7/scrypt-1.2.1/lib
    creating build/temp.macosx-10.9-x86_64-2.7/scrypt-1.2.1/lib/crypto
    creating build/temp.macosx-10.9-x86_64-2.7/scrypt-1.2.1/lib/scryptenc
    creating build/temp.macosx-10.9-x86_64-2.7/scrypt-1.2.1/lib/util
    creating build/temp.macosx-10.9-x86_64-2.7/scrypt-1.2.1/libcperciva
    creating build/temp.macosx-10.9-x86_64-2.7/scrypt-1.2.1/libcperciva/alg
    creating build/temp.macosx-10.9-x86_64-2.7/scrypt-1.2.1/libcperciva/crypto
    creating build/temp.macosx-10.9-x86_64-2.7/scrypt-1.2.1/libcperciva/util
    gcc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DHAVE_CONFIG_H -DHAVE_SYSCTL_HW_USERMEM=1 -Iscrypt-1.2.1 -Iscrypt-1.2.1/lib -Iscrypt-1.2.1/lib/scryptenc -Iscrypt-1.2.1/lib/crypto -Iscrypt-1.2.1/lib/util -Iscrypt-1.2.1/libcperciva/cpusupport -Iscrypt-1.2.1/libcperciva/alg -Iscrypt-1.2.1/libcperciva/util -Iscrypt-1.2.1/libcperciva/crypto -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/scrypt.c -o build/temp.macosx-10.9-x86_64-2.7/src/scrypt.o
    gcc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DHAVE_CONFIG_H -DHAVE_SYSCTL_HW_USERMEM=1 -Iscrypt-1.2.1 -Iscrypt-1.2.1/lib -Iscrypt-1.2.1/lib/scryptenc -Iscrypt-1.2.1/lib/crypto -Iscrypt-1.2.1/lib/util -Iscrypt-1.2.1/libcperciva/cpusupport -Iscrypt-1.2.1/libcperciva/alg -Iscrypt-1.2.1/libcperciva/util -Iscrypt-1.2.1/libcperciva/crypto -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c scrypt-1.2.1/lib/crypto/crypto_scrypt_smix_sse2.c -o build/temp.macosx-10.9-x86_64-2.7/scrypt-1.2.1/lib/crypto/crypto_scrypt_smix_sse2.o
    gcc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DHAVE_CONFIG_H -DHAVE_SYSCTL_HW_USERMEM=1 -Iscrypt-1.2.1 -Iscrypt-1.2.1/lib -Iscrypt-1.2.1/lib/scryptenc -Iscrypt-1.2.1/lib/crypto -Iscrypt-1.2.1/lib/util -Iscrypt-1.2.1/libcperciva/cpusupport -Iscrypt-1.2.1/libcperciva/alg -Iscrypt-1.2.1/libcperciva/util -Iscrypt-1.2.1/libcperciva/crypto -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c scrypt-1.2.1/lib/crypto/crypto_scrypt_smix.c -o build/temp.macosx-10.9-x86_64-2.7/scrypt-1.2.1/lib/crypto/crypto_scrypt_smix.o
    gcc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DHAVE_CONFIG_H -DHAVE_SYSCTL_HW_USERMEM=1 -Iscrypt-1.2.1 -Iscrypt-1.2.1/lib -Iscrypt-1.2.1/lib/scryptenc -Iscrypt-1.2.1/lib/crypto -Iscrypt-1.2.1/lib/util -Iscrypt-1.2.1/libcperciva/cpusupport -Iscrypt-1.2.1/libcperciva/alg -Iscrypt-1.2.1/libcperciva/util -Iscrypt-1.2.1/libcperciva/crypto -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c scrypt-1.2.1/lib/crypto/crypto_scrypt.c -o build/temp.macosx-10.9-x86_64-2.7/scrypt-1.2.1/lib/crypto/crypto_scrypt.o
    gcc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DHAVE_CONFIG_H -DHAVE_SYSCTL_HW_USERMEM=1 -Iscrypt-1.2.1 -Iscrypt-1.2.1/lib -Iscrypt-1.2.1/lib/scryptenc -Iscrypt-1.2.1/lib/crypto -Iscrypt-1.2.1/lib/util -Iscrypt-1.2.1/libcperciva/cpusupport -Iscrypt-1.2.1/libcperciva/alg -Iscrypt-1.2.1/libcperciva/util -Iscrypt-1.2.1/libcperciva/crypto -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c scrypt-1.2.1/lib/scryptenc/scryptenc.c -o build/temp.macosx-10.9-x86_64-2.7/scrypt-1.2.1/lib/scryptenc/scryptenc.o
    gcc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DHAVE_CONFIG_H -DHAVE_SYSCTL_HW_USERMEM=1 -Iscrypt-1.2.1 -Iscrypt-1.2.1/lib -Iscrypt-1.2.1/lib/scryptenc -Iscrypt-1.2.1/lib/crypto -Iscrypt-1.2.1/lib/util -Iscrypt-1.2.1/libcperciva/cpusupport -Iscrypt-1.2.1/libcperciva/alg -Iscrypt-1.2.1/libcperciva/util -Iscrypt-1.2.1/libcperciva/crypto -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c scrypt-1.2.1/lib/scryptenc/scryptenc_cpuperf.c -o build/temp.macosx-10.9-x86_64-2.7/scrypt-1.2.1/lib/scryptenc/scryptenc_cpuperf.o
    gcc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DHAVE_CONFIG_H -DHAVE_SYSCTL_HW_USERMEM=1 -Iscrypt-1.2.1 -Iscrypt-1.2.1/lib -Iscrypt-1.2.1/lib/scryptenc -Iscrypt-1.2.1/lib/crypto -Iscrypt-1.2.1/lib/util -Iscrypt-1.2.1/libcperciva/cpusupport -Iscrypt-1.2.1/libcperciva/alg -Iscrypt-1.2.1/libcperciva/util -Iscrypt-1.2.1/libcperciva/crypto -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c scrypt-1.2.1/lib/util/memlimit.c -o build/temp.macosx-10.9-x86_64-2.7/scrypt-1.2.1/lib/util/memlimit.o
    gcc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DHAVE_CONFIG_H -DHAVE_SYSCTL_HW_USERMEM=1 -Iscrypt-1.2.1 -Iscrypt-1.2.1/lib -Iscrypt-1.2.1/lib/scryptenc -Iscrypt-1.2.1/lib/crypto -Iscrypt-1.2.1/lib/util -Iscrypt-1.2.1/libcperciva/cpusupport -Iscrypt-1.2.1/libcperciva/alg -Iscrypt-1.2.1/libcperciva/util -Iscrypt-1.2.1/libcperciva/crypto -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c scrypt-1.2.1/libcperciva/alg/sha256.c -o build/temp.macosx-10.9-x86_64-2.7/scrypt-1.2.1/libcperciva/alg/sha256.o
    gcc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DHAVE_CONFIG_H -DHAVE_SYSCTL_HW_USERMEM=1 -Iscrypt-1.2.1 -Iscrypt-1.2.1/lib -Iscrypt-1.2.1/lib/scryptenc -Iscrypt-1.2.1/lib/crypto -Iscrypt-1.2.1/lib/util -Iscrypt-1.2.1/libcperciva/cpusupport -Iscrypt-1.2.1/libcperciva/alg -Iscrypt-1.2.1/libcperciva/util -Iscrypt-1.2.1/libcperciva/crypto -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c scrypt-1.2.1/libcperciva/crypto/crypto_aes_aesni.c -o build/temp.macosx-10.9-x86_64-2.7/scrypt-1.2.1/libcperciva/crypto/crypto_aes_aesni.o
    gcc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DHAVE_CONFIG_H -DHAVE_SYSCTL_HW_USERMEM=1 -Iscrypt-1.2.1 -Iscrypt-1.2.1/lib -Iscrypt-1.2.1/lib/scryptenc -Iscrypt-1.2.1/lib/crypto -Iscrypt-1.2.1/lib/util -Iscrypt-1.2.1/libcperciva/cpusupport -Iscrypt-1.2.1/libcperciva/alg -Iscrypt-1.2.1/libcperciva/util -Iscrypt-1.2.1/libcperciva/crypto -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c scrypt-1.2.1/libcperciva/crypto/crypto_aes.c -o build/temp.macosx-10.9-x86_64-2.7/scrypt-1.2.1/libcperciva/crypto/crypto_aes.o
    scrypt-1.2.1/libcperciva/crypto/crypto_aes.c:6:10: fatal error: 'openssl/aes.h' file not found
    #include <openssl/aes.h>
             ^~~~~~~~~~~~~~~
    1 error generated.
    error: command 'gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/qm/ty1630ms3zgcn56sg60f8qc80000gn/T/pip-install-9SjoG3/scrypt/setup.py'"'"'; __file__='"'"'/private/var/folders/qm/ty1630ms3zgcn56sg60f8qc80000gn/T/pip-install-9SjoG3/scrypt/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/qm/ty1630ms3zgcn56sg60f8qc80000gn/T/pip-record-7mrMdQ/install-record.txt --single-version-externally-managed --compile --install-headers /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/scrypt Check the logs for full command output.
Jaymins-MacBook-Pro:btc1 jayminr$ pip install openssl
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
ERROR: Could not find a version that satisfies the requirement openssl (from versions: none)
ERROR: No matching distribution found for openssl
Jaymins-MacBook-Pro:btc1 jayminr$ pip install base58
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting base58
  Downloading base58-1.0.3-py2-none-any.whl (3.1 kB)
Installing collected packages: base58
Successfully installed base58-1.0.3
Jaymins-MacBook-Pro:btc1 jayminr$ python corrupt_wif.py
/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python: can't open file 'corrupt_wif.py': [Errno 2] No such file or directory
Jaymins-MacBook-Pro:btc1 jayminr$ pip currupt_wif.py
ERROR: unknown command "currupt_wif.py"
Jaymins-MacBook-Pro:btc1 jayminr$ python corrupt_wif.py
/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python: can't open file 'corrupt_wif.py': [Errno 2] No such file or directory
Jaymins-MacBook-Pro:btc1 jayminr$


Title: Re: Private Key lost one character
Post by: JBRai on May 03, 2020, 11:38:12 PM
I tried running it in application "IDLE" and got this error;
Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    corrupted_wif.py
NameError: name 'corrupted_wif' is not defined
tried again with different file name
Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    corrupt_wif.py
NameError: name 'corrupt_wif' is not defined

please help me as i want to get this working and withdraw my btc i will transfer you some once it completes

Quote
Ok, well if you have any more troubles, you'll either need to take a screenshot of the error... or copy/paste everything that is being shown in the terminal window when you try to run the commands.

"Invalid Error" and/or "[Errno 2]" don't really tell us anything, so it isn't possible to troubleshoot that properly. :-\

I installed "pip install bitcoinlib & pip install base58
ran using python corrupt_wif.py
failed please help - can't open file 'corrupt_wif.py': [Errno 2] No such file or directory cannot open file

Last login: Fri May  1 12:35:46 on console

The default interactive shell is now zsh.
To update your account to use zsh, please run `chsh -s /bin/zsh`.
For more details, please visit https://support.apple.com/kb/HT208050.
Jaymins-MacBook-Pro:~ jayminr$ cd desktop
Jaymins-MacBook-Pro:desktop jayminr$ cd btc1
Jaymins-MacBook-Pro:btc1 jayminr$ pip install bitcoinlib
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting bitcoinlib
  Using cached https://files.pythonhosted.org/packages/d5/5d/82ee2839784b79a8bbb9448298885ac36d2c865eae135ebd78ae70ca228f/bitcoinlib-0.4.14.tar.gz
Collecting requests>=2.20.0 (from bitcoinlib)
  Using cached https://files.pythonhosted.org/packages/1a/70/1935c770cb3be6e3a8b78ced23d7e0f3b187f5cbfab4749523ed65d7c9b1/requests-2.23.0-py2.py3-none-any.whl
Collecting pyaes==1.6.1 (from bitcoinlib)
  Using cached https://files.pythonhosted.org/packages/44/66/2c17bae31c906613795711fc78045c285048168919ace2220daa372c7d72/pyaes-1.6.1.tar.gz
Collecting scrypt>=0.8.13 (from bitcoinlib)
  Using cached https://files.pythonhosted.org/packages/80/3d/141eb80e754b86f6c25a2ffaf6c3af3acdb65a3e3700829a05ab0c5d965d/scrypt-0.8.13.tar.gz
Collecting SQLAlchemy>=1.3.2 (from bitcoinlib)
  Downloading https://files.pythonhosted.org/packages/75/6a/25db5c553cc45718752886fa849d6f8f828374c3c480ec0b18fdb0a31df6/SQLAlchemy-1.3.16-cp27-cp27m-macosx_10_13_x86_64.whl (1.2MB)
     |████████████████████████████████| 1.2MB 1.7MB/s
Collecting six>=1.10 (from bitcoinlib)
  Downloading https://files.pythonhosted.org/packages/65/eb/1f97cb97bfc2390a276969c6fae16075da282f5058082d4cb10c6c5c1dba/six-1.14.0-py2.py3-none-any.whl
Collecting enum34 (from bitcoinlib)
  Downloading https://files.pythonhosted.org/packages/6f/2c/a9386903ece2ea85e9807e0e062174dc26fdce8b05f216d00491be29fad5/enum34-1.1.10-py2-none-any.whl
Collecting pathlib2 (from bitcoinlib)
  Downloading https://files.pythonhosted.org/packages/e9/45/9c82d3666af4ef9f221cbb954e1d77ddbb513faf552aea6df5f37f1a4859/pathlib2-2.3.5-py2.py3-none-any.whl
Collecting fastecdsa==1.7.5 (from bitcoinlib)
  Downloading https://files.pythonhosted.org/packages/ad/28/8ccec53ea74fb05fe6bca055e67b4a860a664fe2e490fc291e7eff721278/fastecdsa-1.7.5-cp27-cp27m-macosx_10_13_x86_64.whl (46kB)
     |████████████████████████████████| 51kB 11.7MB/s
Collecting urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 (from requests>=2.20.0->bitcoinlib)
  Using cached https://files.pythonhosted.org/packages/e1/e5/df302e8017440f111c11cc41a6b432838672f5a70aa29227bf58149dc72f/urllib3-1.25.9-py2.py3-none-any.whl
Collecting idna<3,>=2.5 (from requests>=2.20.0->bitcoinlib)
  Using cached https://files.pythonhosted.org/packages/89/e3/afebe61c546d18fb1709a61bee788254b40e736cff7271c7de5de2dc4128/idna-2.9-py2.py3-none-any.whl
Collecting chardet<4,>=3.0.2 (from requests>=2.20.0->bitcoinlib)
  Using cached https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl
Collecting certifi>=2017.4.17 (from requests>=2.20.0->bitcoinlib)
  Using cached https://files.pythonhosted.org/packages/57/2b/26e37a4b034800c960a00c4e1b3d9ca5d7014e983e6e729e33ea2f36426c/certifi-2020.4.5.1-py2.py3-none-any.whl
Collecting scandir; python_version < "3.5" (from pathlib2->bitcoinlib)
  Downloading https://files.pythonhosted.org/packages/df/f5/9c052db7bd54d0cbf1bc0bb6554362bba1012d03e5888950a4f5c5dadc4e/scandir-1.10.0.tar.gz
Installing collected packages: urllib3, idna, chardet, certifi, requests, pyaes, scrypt, SQLAlchemy, six, enum34, scandir, pathlib2, fastecdsa, bitcoinlib
  Running setup.py install for pyaes ... done
  Running setup.py install for scrypt ... error
    ERROR: Command errored out with exit status 1:
     command: /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/qm/ty1630ms3zgcn56sg60f8qc80000gn/T/pip-install-l5jxx8/scrypt/setup.py'"'"'; __file__='"'"'/private/var/folders/qm/ty1630ms3zgcn56sg60f8qc80000gn/T/pip-install-l5jxx8/scrypt/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/qm/ty1630ms3zgcn56sg60f8qc80000gn/T/pip-record-b6Ycnk/install-record.txt --single-version-externally-managed --compile
         cwd: /private/var/folders/qm/ty1630ms3zgcn56sg60f8qc80000gn/T/pip-install-l5jxx8/scrypt/
    Complete output (36 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.9-x86_64-2.7
    creating build/lib.macosx-10.9-x86_64-2.7/scrypt
    copying scrypt/__init__.py -> build/lib.macosx-10.9-x86_64-2.7/scrypt
    copying scrypt/scrypt.py -> build/lib.macosx-10.9-x86_64-2.7/scrypt
    running build_ext
    building '_scrypt' extension
    creating build/temp.macosx-10.9-x86_64-2.7
    creating build/temp.macosx-10.9-x86_64-2.7/src
    creating build/temp.macosx-10.9-x86_64-2.7/scrypt-1.2.1
    creating build/temp.macosx-10.9-x86_64-2.7/scrypt-1.2.1/lib
    creating build/temp.macosx-10.9-x86_64-2.7/scrypt-1.2.1/lib/crypto
    creating build/temp.macosx-10.9-x86_64-2.7/scrypt-1.2.1/lib/scryptenc
    creating build/temp.macosx-10.9-x86_64-2.7/scrypt-1.2.1/lib/util
    creating build/temp.macosx-10.9-x86_64-2.7/scrypt-1.2.1/libcperciva
    creating build/temp.macosx-10.9-x86_64-2.7/scrypt-1.2.1/libcperciva/alg
    creating build/temp.macosx-10.9-x86_64-2.7/scrypt-1.2.1/libcperciva/crypto
    creating build/temp.macosx-10.9-x86_64-2.7/scrypt-1.2.1/libcperciva/util
    gcc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DHAVE_CONFIG_H -DHAVE_SYSCTL_HW_USERMEM=1 -Iscrypt-1.2.1 -Iscrypt-1.2.1/lib -Iscrypt-1.2.1/lib/scryptenc -Iscrypt-1.2.1/lib/crypto -Iscrypt-1.2.1/lib/util -Iscrypt-1.2.1/libcperciva/cpusupport -Iscrypt-1.2.1/libcperciva/alg -Iscrypt-1.2.1/libcperciva/util -Iscrypt-1.2.1/libcperciva/crypto -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/scrypt.c -o build/temp.macosx-10.9-x86_64-2.7/src/scrypt.o
    gcc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DHAVE_CONFIG_H -DHAVE_SYSCTL_HW_USERMEM=1 -Iscrypt-1.2.1 -Iscrypt-1.2.1/lib -Iscrypt-1.2.1/lib/scryptenc -Iscrypt-1.2.1/lib/crypto -Iscrypt-1.2.1/lib/util -Iscrypt-1.2.1/libcperciva/cpusupport -Iscrypt-1.2.1/libcperciva/alg -Iscrypt-1.2.1/libcperciva/util -Iscrypt-1.2.1/libcperciva/crypto -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c scrypt-1.2.1/lib/crypto/crypto_scrypt_smix_sse2.c -o build/temp.macosx-10.9-x86_64-2.7/scrypt-1.2.1/lib/crypto/crypto_scrypt_smix_sse2.o
    gcc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DHAVE_CONFIG_H -DHAVE_SYSCTL_HW_USERMEM=1 -Iscrypt-1.2.1 -Iscrypt-1.2.1/lib -Iscrypt-1.2.1/lib/scryptenc -Iscrypt-1.2.1/lib/crypto -Iscrypt-1.2.1/lib/util -Iscrypt-1.2.1/libcperciva/cpusupport -Iscrypt-1.2.1/libcperciva/alg -Iscrypt-1.2.1/libcperciva/util -Iscrypt-1.2.1/libcperciva/crypto -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c scrypt-1.2.1/lib/crypto/crypto_scrypt_smix.c -o build/temp.macosx-10.9-x86_64-2.7/scrypt-1.2.1/lib/crypto/crypto_scrypt_smix.o
    gcc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DHAVE_CONFIG_H -DHAVE_SYSCTL_HW_USERMEM=1 -Iscrypt-1.2.1 -Iscrypt-1.2.1/lib -Iscrypt-1.2.1/lib/scryptenc -Iscrypt-1.2.1/lib/crypto -Iscrypt-1.2.1/lib/util -Iscrypt-1.2.1/libcperciva/cpusupport -Iscrypt-1.2.1/libcperciva/alg -Iscrypt-1.2.1/libcperciva/util -Iscrypt-1.2.1/libcperciva/crypto -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c scrypt-1.2.1/lib/crypto/crypto_scrypt.c -o build/temp.macosx-10.9-x86_64-2.7/scrypt-1.2.1/lib/crypto/crypto_scrypt.o
    gcc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DHAVE_CONFIG_H -DHAVE_SYSCTL_HW_USERMEM=1 -Iscrypt-1.2.1 -Iscrypt-1.2.1/lib -Iscrypt-1.2.1/lib/scryptenc -Iscrypt-1.2.1/lib/crypto -Iscrypt-1.2.1/lib/util -Iscrypt-1.2.1/libcperciva/cpusupport -Iscrypt-1.2.1/libcperciva/alg -Iscrypt-1.2.1/libcperciva/util -Iscrypt-1.2.1/libcperciva/crypto -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c scrypt-1.2.1/lib/scryptenc/scryptenc.c -o build/temp.macosx-10.9-x86_64-2.7/scrypt-1.2.1/lib/scryptenc/scryptenc.o
    gcc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DHAVE_CONFIG_H -DHAVE_SYSCTL_HW_USERMEM=1 -Iscrypt-1.2.1 -Iscrypt-1.2.1/lib -Iscrypt-1.2.1/lib/scryptenc -Iscrypt-1.2.1/lib/crypto -Iscrypt-1.2.1/lib/util -Iscrypt-1.2.1/libcperciva/cpusupport -Iscrypt-1.2.1/libcperciva/alg -Iscrypt-1.2.1/libcperciva/util -Iscrypt-1.2.1/libcperciva/crypto -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c scrypt-1.2.1/lib/scryptenc/scryptenc_cpuperf.c -o build/temp.macosx-10.9-x86_64-2.7/scrypt-1.2.1/lib/scryptenc/scryptenc_cpuperf.o
    gcc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DHAVE_CONFIG_H -DHAVE_SYSCTL_HW_USERMEM=1 -Iscrypt-1.2.1 -Iscrypt-1.2.1/lib -Iscrypt-1.2.1/lib/scryptenc -Iscrypt-1.2.1/lib/crypto -Iscrypt-1.2.1/lib/util -Iscrypt-1.2.1/libcperciva/cpusupport -Iscrypt-1.2.1/libcperciva/alg -Iscrypt-1.2.1/libcperciva/util -Iscrypt-1.2.1/libcperciva/crypto -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c scrypt-1.2.1/lib/util/memlimit.c -o build/temp.macosx-10.9-x86_64-2.7/scrypt-1.2.1/lib/util/memlimit.o
    gcc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DHAVE_CONFIG_H -DHAVE_SYSCTL_HW_USERMEM=1 -Iscrypt-1.2.1 -Iscrypt-1.2.1/lib -Iscrypt-1.2.1/lib/scryptenc -Iscrypt-1.2.1/lib/crypto -Iscrypt-1.2.1/lib/util -Iscrypt-1.2.1/libcperciva/cpusupport -Iscrypt-1.2.1/libcperciva/alg -Iscrypt-1.2.1/libcperciva/util -Iscrypt-1.2.1/libcperciva/crypto -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c scrypt-1.2.1/libcperciva/alg/sha256.c -o build/temp.macosx-10.9-x86_64-2.7/scrypt-1.2.1/libcperciva/alg/sha256.o
    gcc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DHAVE_CONFIG_H -DHAVE_SYSCTL_HW_USERMEM=1 -Iscrypt-1.2.1 -Iscrypt-1.2.1/lib -Iscrypt-1.2.1/lib/scryptenc -Iscrypt-1.2.1/lib/crypto -Iscrypt-1.2.1/lib/util -Iscrypt-1.2.1/libcperciva/cpusupport -Iscrypt-1.2.1/libcperciva/alg -Iscrypt-1.2.1/libcperciva/util -Iscrypt-1.2.1/libcperciva/crypto -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c scrypt-1.2.1/libcperciva/crypto/crypto_aes_aesni.c -o build/temp.macosx-10.9-x86_64-2.7/scrypt-1.2.1/libcperciva/crypto/crypto_aes_aesni.o
    gcc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DHAVE_CONFIG_H -DHAVE_SYSCTL_HW_USERMEM=1 -Iscrypt-1.2.1 -Iscrypt-1.2.1/lib -Iscrypt-1.2.1/lib/scryptenc -Iscrypt-1.2.1/lib/crypto -Iscrypt-1.2.1/lib/util -Iscrypt-1.2.1/libcperciva/cpusupport -Iscrypt-1.2.1/libcperciva/alg -Iscrypt-1.2.1/libcperciva/util -Iscrypt-1.2.1/libcperciva/crypto -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c scrypt-1.2.1/libcperciva/crypto/crypto_aes.c -o build/temp.macosx-10.9-x86_64-2.7/scrypt-1.2.1/libcperciva/crypto/crypto_aes.o
    scrypt-1.2.1/libcperciva/crypto/crypto_aes.c:6:10: fatal error: 'openssl/aes.h' file not found
    #include <openssl/aes.h>
             ^~~~~~~~~~~~~~~
    1 error generated.
    error: command 'gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/qm/ty1630ms3zgcn56sg60f8qc80000gn/T/pip-install-l5jxx8/scrypt/setup.py'"'"'; __file__='"'"'/private/var/folders/qm/ty1630ms3zgcn56sg60f8qc80000gn/T/pip-install-l5jxx8/scrypt/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/qm/ty1630ms3zgcn56sg60f8qc80000gn/T/pip-record-b6Ycnk/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.
WARNING: You are using pip version 19.2.3, however version 20.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Jaymins-MacBook-Pro:btc1 jayminr$ pip install --upgrade pip
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting pip
  Downloading https://files.pythonhosted.org/packages/54/2e/df11ea7e23e7e761d484ed3740285a34e38548cf2bad2bed3dd5768ec8b9/pip-20.1-py2.py3-none-any.whl (1.5MB)
     |████████████████████████████████| 1.5MB 1.7MB/s
Installing collected packages: pip
  Found existing installation: pip 19.2.3
    Uninstalling pip-19.2.3:
      Successfully uninstalled pip-19.2.3
Successfully installed pip-20.1
Jaymins-MacBook-Pro:btc1 jayminr$ pip install bitcoinlib
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting bitcoinlib
  Using cached bitcoinlib-0.4.14.tar.gz (418 kB)
Requirement already satisfied: requests>=2.20.0 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from bitcoinlib) (2.23.0)
Requirement already satisfied: pyaes==1.6.1 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from bitcoinlib) (1.6.1)
Collecting scrypt>=0.8.13
  Using cached scrypt-0.8.13.tar.gz (53 kB)
Collecting SQLAlchemy>=1.3.2
  Using cached SQLAlchemy-1.3.16-cp27-cp27m-macosx_10_13_x86_64.whl (1.2 MB)
Collecting six>=1.10
  Using cached six-1.14.0-py2.py3-none-any.whl (10 kB)
Collecting enum34
  Using cached enum34-1.1.10-py2-none-any.whl (11 kB)
Collecting pathlib2
  Using cached pathlib2-2.3.5-py2.py3-none-any.whl (18 kB)
Collecting fastecdsa==1.7.5
  Using cached fastecdsa-1.7.5-cp27-cp27m-macosx_10_13_x86_64.whl (46 kB)
Requirement already satisfied: idna<3,>=2.5 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from requests>=2.20.0->bitcoinlib) (2.9)
Requirement already satisfied: chardet<4,>=3.0.2 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from requests>=2.20.0->bitcoinlib) (3.0.4)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from requests>=2.20.0->bitcoinlib) (1.25.9)
Requirement already satisfied: certifi>=2017.4.17 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from requests>=2.20.0->bitcoinlib) (2020.4.5.1)
Collecting scandir; python_version < "3.5"
  Using cached scandir-1.10.0.tar.gz (33 kB)
Could not build wheels for bitcoinlib, since package 'wheel' is not installed.
Could not build wheels for requests, since package 'wheel' is not installed.
Could not build wheels for pyaes, since package 'wheel' is not installed.
Could not build wheels for scrypt, since package 'wheel' is not installed.
Could not build wheels for idna, since package 'wheel' is not installed.
Could not build wheels for chardet, since package 'wheel' is not installed.
Could not build wheels for urllib3, since package 'wheel' is not installed.
Could not build wheels for certifi, since package 'wheel' is not installed.
Could not build wheels for scandir, since package 'wheel' is not installed.
Installing collected packages: scrypt, SQLAlchemy, six, enum34, scandir, pathlib2, fastecdsa, bitcoinlib
    Running setup.py install for scrypt ... error
    ERROR: Command errored out with exit status 1:
     command: /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/qm/ty1630ms3zgcn56sg60f8qc80000gn/T/pip-install-9SjoG3/scrypt/setup.py'"'"'; __file__='"'"'/private/var/folders/qm/ty1630ms3zgcn56sg60f8qc80000gn/T/pip-install-9SjoG3/scrypt/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/qm/ty1630ms3zgcn56sg60f8qc80000gn/T/pip-record-7mrMdQ/install-record.txt --single-version-externally-managed --compile --install-headers /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/scrypt
         cwd: /private/var/folders/qm/ty1630ms3zgcn56sg60f8qc80000gn/T/pip-install-9SjoG3/scrypt/
    Complete output (36 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.9-x86_64-2.7
    creating build/lib.macosx-10.9-x86_64-2.7/scrypt
    copying scrypt/__init__.py -> build/lib.macosx-10.9-x86_64-2.7/scrypt
    copying scrypt/scrypt.py -> build/lib.macosx-10.9-x86_64-2.7/scrypt
    running build_ext
    building '_scrypt' extension
    creating build/temp.macosx-10.9-x86_64-2.7
    creating build/temp.macosx-10.9-x86_64-2.7/src
    creating build/temp.macosx-10.9-x86_64-2.7/scrypt-1.2.1
    creating build/temp.macosx-10.9-x86_64-2.7/scrypt-1.2.1/lib
    creating build/temp.macosx-10.9-x86_64-2.7/scrypt-1.2.1/lib/crypto
    creating build/temp.macosx-10.9-x86_64-2.7/scrypt-1.2.1/lib/scryptenc
    creating build/temp.macosx-10.9-x86_64-2.7/scrypt-1.2.1/lib/util
    creating build/temp.macosx-10.9-x86_64-2.7/scrypt-1.2.1/libcperciva
    creating build/temp.macosx-10.9-x86_64-2.7/scrypt-1.2.1/libcperciva/alg
    creating build/temp.macosx-10.9-x86_64-2.7/scrypt-1.2.1/libcperciva/crypto
    creating build/temp.macosx-10.9-x86_64-2.7/scrypt-1.2.1/libcperciva/util
    gcc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DHAVE_CONFIG_H -DHAVE_SYSCTL_HW_USERMEM=1 -Iscrypt-1.2.1 -Iscrypt-1.2.1/lib -Iscrypt-1.2.1/lib/scryptenc -Iscrypt-1.2.1/lib/crypto -Iscrypt-1.2.1/lib/util -Iscrypt-1.2.1/libcperciva/cpusupport -Iscrypt-1.2.1/libcperciva/alg -Iscrypt-1.2.1/libcperciva/util -Iscrypt-1.2.1/libcperciva/crypto -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/scrypt.c -o build/temp.macosx-10.9-x86_64-2.7/src/scrypt.o
    gcc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DHAVE_CONFIG_H -DHAVE_SYSCTL_HW_USERMEM=1 -Iscrypt-1.2.1 -Iscrypt-1.2.1/lib -Iscrypt-1.2.1/lib/scryptenc -Iscrypt-1.2.1/lib/crypto -Iscrypt-1.2.1/lib/util -Iscrypt-1.2.1/libcperciva/cpusupport -Iscrypt-1.2.1/libcperciva/alg -Iscrypt-1.2.1/libcperciva/util -Iscrypt-1.2.1/libcperciva/crypto -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c scrypt-1.2.1/lib/crypto/crypto_scrypt_smix_sse2.c -o build/temp.macosx-10.9-x86_64-2.7/scrypt-1.2.1/lib/crypto/crypto_scrypt_smix_sse2.o
    gcc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DHAVE_CONFIG_H -DHAVE_SYSCTL_HW_USERMEM=1 -Iscrypt-1.2.1 -Iscrypt-1.2.1/lib -Iscrypt-1.2.1/lib/scryptenc -Iscrypt-1.2.1/lib/crypto -Iscrypt-1.2.1/lib/util -Iscrypt-1.2.1/libcperciva/cpusupport -Iscrypt-1.2.1/libcperciva/alg -Iscrypt-1.2.1/libcperciva/util -Iscrypt-1.2.1/libcperciva/crypto -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c scrypt-1.2.1/lib/crypto/crypto_scrypt_smix.c -o build/temp.macosx-10.9-x86_64-2.7/scrypt-1.2.1/lib/crypto/crypto_scrypt_smix.o
    gcc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DHAVE_CONFIG_H -DHAVE_SYSCTL_HW_USERMEM=1 -Iscrypt-1.2.1 -Iscrypt-1.2.1/lib -Iscrypt-1.2.1/lib/scryptenc -Iscrypt-1.2.1/lib/crypto -Iscrypt-1.2.1/lib/util -Iscrypt-1.2.1/libcperciva/cpusupport -Iscrypt-1.2.1/libcperciva/alg -Iscrypt-1.2.1/libcperciva/util -Iscrypt-1.2.1/libcperciva/crypto -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c scrypt-1.2.1/lib/crypto/crypto_scrypt.c -o build/temp.macosx-10.9-x86_64-2.7/scrypt-1.2.1/lib/crypto/crypto_scrypt.o
    gcc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DHAVE_CONFIG_H -DHAVE_SYSCTL_HW_USERMEM=1 -Iscrypt-1.2.1 -Iscrypt-1.2.1/lib -Iscrypt-1.2.1/lib/scryptenc -Iscrypt-1.2.1/lib/crypto -Iscrypt-1.2.1/lib/util -Iscrypt-1.2.1/libcperciva/cpusupport -Iscrypt-1.2.1/libcperciva/alg -Iscrypt-1.2.1/libcperciva/util -Iscrypt-1.2.1/libcperciva/crypto -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c scrypt-1.2.1/lib/scryptenc/scryptenc.c -o build/temp.macosx-10.9-x86_64-2.7/scrypt-1.2.1/lib/scryptenc/scryptenc.o
    gcc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DHAVE_CONFIG_H -DHAVE_SYSCTL_HW_USERMEM=1 -Iscrypt-1.2.1 -Iscrypt-1.2.1/lib -Iscrypt-1.2.1/lib/scryptenc -Iscrypt-1.2.1/lib/crypto -Iscrypt-1.2.1/lib/util -Iscrypt-1.2.1/libcperciva/cpusupport -Iscrypt-1.2.1/libcperciva/alg -Iscrypt-1.2.1/libcperciva/util -Iscrypt-1.2.1/libcperciva/crypto -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c scrypt-1.2.1/lib/scryptenc/scryptenc_cpuperf.c -o build/temp.macosx-10.9-x86_64-2.7/scrypt-1.2.1/lib/scryptenc/scryptenc_cpuperf.o
    gcc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DHAVE_CONFIG_H -DHAVE_SYSCTL_HW_USERMEM=1 -Iscrypt-1.2.1 -Iscrypt-1.2.1/lib -Iscrypt-1.2.1/lib/scryptenc -Iscrypt-1.2.1/lib/crypto -Iscrypt-1.2.1/lib/util -Iscrypt-1.2.1/libcperciva/cpusupport -Iscrypt-1.2.1/libcperciva/alg -Iscrypt-1.2.1/libcperciva/util -Iscrypt-1.2.1/libcperciva/crypto -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c scrypt-1.2.1/lib/util/memlimit.c -o build/temp.macosx-10.9-x86_64-2.7/scrypt-1.2.1/lib/util/memlimit.o
    gcc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DHAVE_CONFIG_H -DHAVE_SYSCTL_HW_USERMEM=1 -Iscrypt-1.2.1 -Iscrypt-1.2.1/lib -Iscrypt-1.2.1/lib/scryptenc -Iscrypt-1.2.1/lib/crypto -Iscrypt-1.2.1/lib/util -Iscrypt-1.2.1/libcperciva/cpusupport -Iscrypt-1.2.1/libcperciva/alg -Iscrypt-1.2.1/libcperciva/util -Iscrypt-1.2.1/libcperciva/crypto -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c scrypt-1.2.1/libcperciva/alg/sha256.c -o build/temp.macosx-10.9-x86_64-2.7/scrypt-1.2.1/libcperciva/alg/sha256.o
    gcc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DHAVE_CONFIG_H -DHAVE_SYSCTL_HW_USERMEM=1 -Iscrypt-1.2.1 -Iscrypt-1.2.1/lib -Iscrypt-1.2.1/lib/scryptenc -Iscrypt-1.2.1/lib/crypto -Iscrypt-1.2.1/lib/util -Iscrypt-1.2.1/libcperciva/cpusupport -Iscrypt-1.2.1/libcperciva/alg -Iscrypt-1.2.1/libcperciva/util -Iscrypt-1.2.1/libcperciva/crypto -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c scrypt-1.2.1/libcperciva/crypto/crypto_aes_aesni.c -o build/temp.macosx-10.9-x86_64-2.7/scrypt-1.2.1/libcperciva/crypto/crypto_aes_aesni.o
    gcc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DHAVE_CONFIG_H -DHAVE_SYSCTL_HW_USERMEM=1 -Iscrypt-1.2.1 -Iscrypt-1.2.1/lib -Iscrypt-1.2.1/lib/scryptenc -Iscrypt-1.2.1/lib/crypto -Iscrypt-1.2.1/lib/util -Iscrypt-1.2.1/libcperciva/cpusupport -Iscrypt-1.2.1/libcperciva/alg -Iscrypt-1.2.1/libcperciva/util -Iscrypt-1.2.1/libcperciva/crypto -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c scrypt-1.2.1/libcperciva/crypto/crypto_aes.c -o build/temp.macosx-10.9-x86_64-2.7/scrypt-1.2.1/libcperciva/crypto/crypto_aes.o
    scrypt-1.2.1/libcperciva/crypto/crypto_aes.c:6:10: fatal error: 'openssl/aes.h' file not found
    #include <openssl/aes.h>
             ^~~~~~~~~~~~~~~
    1 error generated.
    error: command 'gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/qm/ty1630ms3zgcn56sg60f8qc80000gn/T/pip-install-9SjoG3/scrypt/setup.py'"'"'; __file__='"'"'/private/var/folders/qm/ty1630ms3zgcn56sg60f8qc80000gn/T/pip-install-9SjoG3/scrypt/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/qm/ty1630ms3zgcn56sg60f8qc80000gn/T/pip-record-7mrMdQ/install-record.txt --single-version-externally-managed --compile --install-headers /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/scrypt Check the logs for full command output.
Jaymins-MacBook-Pro:btc1 jayminr$ pip install openssl
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
ERROR: Could not find a version that satisfies the requirement openssl (from versions: none)
ERROR: No matching distribution found for openssl
Jaymins-MacBook-Pro:btc1 jayminr$ pip install base58
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting base58
  Downloading base58-1.0.3-py2-none-any.whl (3.1 kB)
Installing collected packages: base58
Successfully installed base58-1.0.3
Jaymins-MacBook-Pro:btc1 jayminr$ python corrupt_wif.py
/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python: can't open file 'corrupt_wif.py': [Errno 2] No such file or directory
Jaymins-MacBook-Pro:btc1 jayminr$ pip currupt_wif.py
ERROR: unknown command "currupt_wif.py"
Jaymins-MacBook-Pro:btc1 jayminr$ python corrupt_wif.py
/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python: can't open file 'corrupt_wif.py': [Errno 2] No such file or directory
Jaymins-MacBook-Pro:btc1 jayminr$



Title: Re: Private Key lost one character
Post by: HCP on May 04, 2020, 05:03:52 AM
failed please help - can't open file 'corrupt_wif.py': [Errno 2] No such file or directory cannot open file
Did you actually copy/paste the code from the earlier post (https://bitcointalk.org/index.php?topic=1409361.msg16406973#msg16406973) into a file and did you name that file corrupt_wif.py? ???

If so, where is that file?


Title: Re: Private Key lost one character
Post by: JBRai on May 04, 2020, 09:51:27 AM
under corrupted_wif put my private with the missing character and left "should be" empty like ' '
the file is on my desktop under folder called BTC1
This is what i had copied

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:  ''

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


failed please help - can't open file 'corrupt_wif.py': [Errno 2] No such file or directory cannot open file
Did you actually copy/paste the code from the earlier post (https://bitcointalk.org/index.php?topic=1409361.msg16406973#msg16406973) into a file and did you name that file corrupt_wif.py? ???

If so, where is that file?


Title: Re: Private Key lost one character
Post by: HCP on May 04, 2020, 08:47:25 PM
under corrupted_wif put my private with the missing character and left "should be" empty like ' '
the file is on my desktop under folder called BTC1
Ok... then your "terminal" needs to be in the 'BTC1' directory, when you run the python command, otherwise it won't be able to find the script ;)

On MacOSX, the path to your desktop folder BTC should be something like:
Code:
/Users/YOURUSERNAME/Desktop/BTC1

so if you use the command:
Code:
cd /Users/YOURUSERNAME/Desktop/BTC1

You should see the command prompt change and show you the BTC1 folder... then if you try to run the script again with:
Code:
python corrupt_wif.py

It should work.


Title: Re: Private Key lost one character
Post by: seoincorporation on May 13, 2020, 03:48:30 PM
Hi All

I was wanting to know if anyone could provide me a search command as i am missing 4 characters from my private key base 58.  From the search command how would you know if the private key is valid or not?

My private key starts with K i have 48/49 characters i just require a search command so my friend can complete this for me?

please let me know thanks

You should get the private key with crunch...

Code:
crunch 52 52 123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz -t L4rK1yDtCWekvXuE6oXD9jCYfFNV2cWRpVuPLBcCU2z8Tris@@@@ -o bf.txt

But there are two things to consider...

1.-If you have 48 chars or 49... then you add 4 or 3 @ at the end of the command.

2.-If the 4 missing characters are at the end of the string or whats the position of the missing chars because if they are random the chance to recover it is really small.


Title: Re: Private Key lost one character
Post by: JBRai on May 19, 2020, 10:18:35 PM
under corrupted_wif put my private with the missing character and left "should be" empty like ' '
the file is on my desktop under folder called BTC1
Ok... then your "terminal" needs to be in the 'BTC1' directory, when you run the python command, otherwise it won't be able to find the script ;)

On MacOSX, the path to your desktop folder BTC should be something like:
Code:
/Users/YOURUSERNAME/Desktop/BTC1

so if you use the command:
Code:
cd /Users/YOURUSERNAME/Desktop/BTC1

You should see the command prompt change and show you the BTC1 folder... then if you try to run the script again with:
Code:
python corrupt_wif.py

For this code as i have left #should be ' ' blank should i addin my corrupt key with a random letter at the end to add it up to 52 characters?
# Provide a WIF private key with a single missing character.
# Wrong Char             
corrupted_wif = 'KykLRngWxXA8RkznbcQ5UzJbD2QfABiR9E6yVGvigHo2WrwBeGm'
#  Should be:   ''
#  Missing Char                           
for candidate_wif in candidate_wifs(corrupted_wif):
    print(candidate_wif)

It should work.


Title: Re: Private Key lost one character
Post by: JBRai on May 19, 2020, 10:20:45 PM
Hi All

I was wanting to know if anyone could provide me a search command as i am missing 4 characters from my private key base 58.  From the search command how would you know if the private key is valid or not?

My private key starts with K i have 48/49 characters i just require a search command so my friend can complete this for me?

please let me know thanks

You should get the private key with crunch...

Code:
crunch 52 52 123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz -t L4rK1yDtCWekvXuE6oXD9jCYfFNV2cWRpVuPLBcCU2z8Tris@@@@ -o bf.txt

But there are two things to consider...

1.-If you have 48 chars or 49... then you add 4 or 3 @ at the end of the command.

2.-If the 4 missing characters are at the end of the string or whats the position of the missing chars because if they are random the chance to recover it is really small.

how do i use Crunch do i have copy the code in txt file and run it in terminal on mac ? i am using a mac book pro



Title: Re: Private Key lost one character
Post by: JBRai on May 21, 2020, 10:09:06 AM
Hi All

I was wanting to know if anyone could provide me a search command as i am missing 4 characters from my private key base 58.  From the search command how would you know if the private key is valid or not?

My private key starts with K i have 48/49 characters i just require a search command so my friend can complete this for me?

please let me know thanks

You should get the private key with crunch...

Code:
crunch 52 52 123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz -t L4rK1yDtCWekvXuE6oXD9jCYfFNV2cWRpVuPLBcCU2z8Tris@@@@ -o bf.txt

But there are two things to consider...

1.-If you have 48 chars or 49... then you add 4 or 3 @ at the end of the command.

2.-If the 4 missing characters are at the end of the string or whats the position of the missing chars because if they are random the chance to recover it is really small.

Thanks it has worked, but the address is not getting accepted into blockchain it say invalid address Private key address? please help


Title: Re: Private Key lost one character
Post by: HCP on May 22, 2020, 12:41:28 AM
For this code as i have left #should be ' ' blank should i addin my corrupt key with a random letter at the end to add it up to 52 characters?
# Provide a WIF private key with a single missing character.
# Wrong Char              
corrupted_wif = 'KykLRngWxXA8RkznbcQ5UzJbD2QfABiR9E6yVGvigHo2WrwBeGm'
#  Should be:   ''
#  Missing Char                           
for candidate_wif in candidate_wifs(corrupted_wif):
    print(candidate_wif)

You only need to put your "corrupted WIF" in on the line that says: corrupted_wif = '.................'

The "#should be" line is just a comment in the code, it will not be executed so can be left blank. As long as you have the line:

Code:
corrupted_wif = '<WIF_MISSING_ONE_CHAR_GOES_HERE>'

Filled out correctly, then it should work OK!


Title: Re: Private Key lost one character
Post by: math09183 on May 22, 2020, 08:20:24 AM

I was wanting to know if anyone could provide me a search command as i am missing 4 characters from my private key base 58.  From the search command how would you know if the private key is valid or not?

My private key starts with K i have 48/49 characters i just require a search command so my friend can complete this for me?

please let me know thanks

Thanks it has worked, but the address is not getting accepted into blockchain it say invalid address Private key address? please help

Do you know finally what is the exact situation?
If you are sure that you miss characters at the end and even you know the expected BTC address, it is very easy to find.


Title: Re: Private Key lost one character
Post by: pooya87 on May 22, 2020, 09:36:38 AM
I have created a simple application to restore WIF if lost characters are at the end:
https://github.com/Mathematician09183/WifFinder

if i understood your Java code correctly you are looping through all chars and that's a lot of unnecessary code. if the missing character is at the end then that character is the checksum which is recoverable in a couple of very simple steps:
- replace the missing char with anything from the charset (like 1)
- decode the result using Base58 encoding (not Base58check which is usually the method used to check and remove checksum)
- remove the last 4 bytes
- now encode this result with Base58check
you have the key!

this works for 1 to 4 or probably up to 6 missing characters at the end.

ps. i don't think @JBRai problem is with 1 char or even that char being at the end.


Title: Re: Private Key lost one character
Post by: math09183 on May 22, 2020, 09:40:47 AM
I have created a simple application to restore WIF if lost characters are at the end:
https://github.com/Mathematician09183/WifFinder

if i understood your Java code correctly you are looping through all chars and that's a lot of unnecessary code. if the missing character is at the end then that character is the checksum which is recoverable in a couple of very simple steps:
- replace the missing char with anything from the charset (like 1)
- decode the result using Base58 encoding (not Base58check which is usually the method used to check and remove checksum)
- remove the last 4 bytes
- now encode this result with Base58check
you have the key!

this works for 1 to 4 or probably up to 6 missing characters at the end.

ps. i don't think @JBRai problem is with 1 char or even that char being at the end.

Yes, of course. In fact it was the fastest to do, just in few minutes. I rely on bitcoinj code to verify signature and load/reject key.
If character is lost in the middle, then of course it becomes much more interesting, but for 1-2 characters still doable in the reasonable time.


Title: Re: Private Key lost one character
Post by: JBRai on May 22, 2020, 10:12:05 PM

I was wanting to know if anyone could provide me a search command as i am missing 4 characters from my private key base 58.  From the search command how would you know if the private key is valid or not?

My private key starts with K i have 48/49 characters i just require a search command so my friend can complete this for me?

please let me know thanks

Thanks it has worked, but the address is not getting accepted into blockchain it say invalid address Private key address? please help

Do you know finally what is the exact situation?
If you are sure that you miss characters at the end and even you know the expected BTC address, it is very easy to find.


I do not even know the btc address for both private keys this is how long ago it is.  Also i have another address which 54 characters long i need a script which will fix it.


Title: Re: Private Key lost one character
Post by: math09183 on May 22, 2020, 10:16:35 PM

I do not even know the btc address for both private keys this is how long ago it is.  Also i have another address which 54 characters long i need a script which will fix it.


If it is 54, I would remove characters from the end and try to restore correct WIF.
For other WIFs - it is difficult because you do not know what you look for. It is not a problem to generate WIF - the point it to find your address.


Title: Re: Private Key lost one character
Post by: JBRai on May 22, 2020, 10:56:41 PM

I do not even know the btc address for both private keys this is how long ago it is.  Also i have another address which 54 characters long i need a script which will fix it.


If it is 54, I would remove characters from the end and try to restore correct WIF.
For other WIFs - it is difficult because you do not know what you look for. It is not a problem to generate WIF - the point it to find your address.

How would you restore correct WIF with 54 characters?   how would i sort out the original privkey?