bitcoinforktech
Jr. Member
Offline
Activity: 32
Merit: 4
|
|
January 05, 2021, 05:22:24 AM |
|
https://ibb.co/xfV3BBRAre you sure you can/cannot convert the key to WIF or somesuch and import it?
Maybe I can, I'm just not very technical. I also have Parallels, so maybe I can also try installing on Windows or Ubuntu. It looks like the key as you have described can't easily be exported as a WIF. I would try Ubuntu rather than Windows for this, if you need to use Parallels. Windows is a huge pain. We should be able to do this on Mac with brew. Fingers crossed those compile issues will get fixed.
|
|
|
|
|
|
|
TalkImg was created especially for hosting images on bitcointalk.org: try it next time you want to post an image
|
|
|
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
|
|
NotATether
Legendary
Offline
Activity: 1596
Merit: 6740
bitcoincleanup.com / bitmixlist.org
|
|
January 05, 2021, 09:11:58 AM Last edit: January 05, 2021, 09:43:47 AM by NotATether |
|
It looks to me like you need the openssl libraries. Normally I would 'sudo apt install libssl-dev' and you should be able to do a similar thing with brew. brew install openssl or brew install openssl@1.1.
Try this:
brew install openssl@1.1 cp /usr/local/opt/openssl@1.1/lib/pkgconfig/*.pc /usr/local/lib/pkgconfig/
Hopefully that will help move things along.
bitcoinforktech is correct, you are missing the OpenSSL library on Mac which is why the pip installation fails with "cannot find <openssl/aes.h>" (last image). You need to use brew to install it. If you don't currently have brew, you can install it using: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" Are you sure you can/cannot convert the key to WIF or somesuch and import it?
He said his private key is 66 characters long and begins with ef, while bitcoin private keys are supposed to be 64 hex characters long. It is already out of range of a valid private key: 0x1 to 0xFFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFE BAAE DCE6 AF48 A03B BFD2 5E8C D036 4140 The blockstack JSON he posted suggests that this could be a master private key, but those are also 64 hex characters long and begin with xprv, but this hex number doesn't have either of these properties. You are getting permission denied because you aren't running brew as Administrator, try running the brew install command with sudo.
@21XO, I think I asked you in your other thread what kind of address is this private key for, but I never got an answer AFAIK. Are you trying to recover a legacy address, or a segwit address?
|
. .BLACKJACK ♠ FUN. | | | ███▄██████ ██████████████▀ ████████████ █████████████████ ████████████████▄▄ ░█████████████▀░▀▀ ██████████████████ ░██████████████ █████████████████▄ ░██████████████▀ ████████████ ███████████████░██ ██████████ | | CRYPTO CASINO & SPORTS BETTING | | │ | | │ | ▄▄███████▄▄ ▄███████████████▄ ███████████████████ █████████████████████ ███████████████████████ █████████████████████████ █████████████████████████ █████████████████████████ ███████████████████████ █████████████████████ ███████████████████ ▀███████████████▀ ███████████████████ | | .
|
|
|
|
PawGo
Legendary
Offline
Activity: 952
Merit: 1367
|
|
January 05, 2021, 09:16:54 AM Last edit: January 05, 2021, 02:22:32 PM by PawGo |
|
It was already discussed before. He has 66 characters because the last ones are 01 indicating compressed address. He may convert his private key to WIF and import into any wallet like Electrum using for example this page https://learnmeabitcoin.com/technical/wif (and keeping some safety measures, like being offline etc). The question is if he has his REAL key or encrypted. If it is real, the migration is easy and could be done in 1 minute. If it is encrypted he needs the program which is able to decrypt it - in this case the old version of blockstack.
|
|
|
|
NotATether
Legendary
Offline
Activity: 1596
Merit: 6740
bitcoincleanup.com / bitmixlist.org
|
|
January 05, 2021, 09:30:52 AM Last edit: January 05, 2021, 09:49:01 AM by NotATether |
|
It was already discussed before. He has 66 characters because the last ones are 01 indicating compressed address. He may convert his private key to WIF and import into any wallet like Electrum using for example this page https://learnmeabitcoin.com/technical/wif (and keeping some safety measures, like being offline etc). The question is if he has his REAL key or encrypted. If it is real, the migration is easy and could be done in 1 minute. If is encrypted he need the program which is able to decrypt it - in this case the old version of blockstack. So to be clear, according to that link you posted, the "ef" at the beginning is also bytes in the private key, since it's got to be 256-bit (and "01" is not part of the key)? They also have an example where they have a private key beginning with "ef" but has a prefix of "80" indicating mainnet that's put before the private key. I just want to make sure we're not dealing with a testnet private key since "ef" is also the prefix of testnet. My bad, testnet prefix is actually fe and somehow I thought it was ef.
|
. .BLACKJACK ♠ FUN. | | | ███▄██████ ██████████████▀ ████████████ █████████████████ ████████████████▄▄ ░█████████████▀░▀▀ ██████████████████ ░██████████████ █████████████████▄ ░██████████████▀ ████████████ ███████████████░██ ██████████ | | CRYPTO CASINO & SPORTS BETTING | | │ | | │ | ▄▄███████▄▄ ▄███████████████▄ ███████████████████ █████████████████████ ███████████████████████ █████████████████████████ █████████████████████████ █████████████████████████ ███████████████████████ █████████████████████ ███████████████████ ▀███████████████▀ ███████████████████ | | .
|
|
|
|
PawGo
Legendary
Offline
Activity: 952
Merit: 1367
|
|
January 05, 2021, 09:35:10 AM |
|
It was already discussed before. He has 66 characters because the last ones are 01 indicating compressed address. He may convert his private key to WIF and import into any wallet like Electrum using for example this page https://learnmeabitcoin.com/technical/wif (and keeping some safety measures, like being offline etc). The question is if he has his REAL key or encrypted. If it is real, the migration is easy and could be done in 1 minute. If is encrypted he need the program which is able to decrypt it - in this case the old version of blockstack. So to be clear, according to that link you posted, the "ef" at the beginning is also bytes in the private key, since it's got to be 256-bit (and "01" is not part of the key)? They also have an example where they have a private key beginning with "ef" but has a prefix of "80" indicating mainnet that's put before the private key. I just want to make sure we're not dealing with a testnet private key since "ef" is also the prefix of testnet. Take a look at comment https://bitcointalk.org/index.php?topic=5306458.msg56017277#msg56017277If key for testnet starts not with "ef" and used on learnmeabitcoin page generates this same WIF for testnet like in comment I would like to believe that it is just a coincidence and (I hope) OP has a key for real network.
|
|
|
|
21XO (OP)
Jr. Member
Offline
Activity: 57
Merit: 29
|
|
January 06, 2021, 02:22:53 AM |
|
Please try
sudo cp /usr/local/opt/openssl@1.1/lib/pkgconfig/*.pc /usr/local/lib/pkgconfig/
https://ibb.co/WVmPsq1
|
|
|
|
21XO (OP)
Jr. Member
Offline
Activity: 57
Merit: 29
|
|
January 06, 2021, 02:32:43 AM Last edit: January 06, 2021, 02:58:10 AM by 21XO |
|
You are getting permission denied because you aren't running brew as Administrator, try running the brew install command with sudo.
https://ibb.co/ky31Y7H@21XO, I think I asked you in your other thread what kind of address is this private key for, but I never got an answer AFAIK. Are you trying to recover a legacy address, or a segwit address? legacy address
|
|
|
|
21XO (OP)
Jr. Member
Offline
Activity: 57
Merit: 29
|
|
January 06, 2021, 02:54:48 AM |
|
Fortunately https://learnmeabitcoin.com/technical/wif shows example code how to generate WIF key from HEX private key, i combine required code for convenience. require 'digest'
# Checksums use hash256 (where data is hashed twice through sha256) def hash256(hex) binary = [hex].pack("H*") hash1 = Digest::SHA256.digest(binary) hash2 = Digest::SHA256.digest(hash1) result = hash2.unpack("H*")[0] return result end
# Checksums are used when creating addresses def checksum(hex) hash = hash256(hex) # Hash the data through SHA256 twice return hash[0...8] # Return the first 4 bytes (8 characters) end
def base58_encode(hex) @chars = %w[ 1 2 3 4 5 6 7 8 9 A B C D E F G H J K L M N P Q R S T U V W X Y Z a b c d e f g h i j k m n o p q r s t u v w x y z ] @base = @chars.length
i = hex.to_i(16) buffer = String.new
while i > 0 remainder = i % @base i = i / @base buffer = @chars[remainder] + buffer end
#! Is it just the 00, or does 05 get converted to 3, etc. # add '1's to the start based on number of leading bytes of zeros leading_zero_bytes = (hex.match(/^([0]+)/) ? $1 : '').size / 2
("1"*leading_zero_bytes) + buffer end
privatekey = "0351764dc07ee1ad038ff49c0e020799f0a350dd0769017ea09460e150a64019" # "ef" for tesnet # "80" for mainnet extended = "ef" + privatekey + "01" # you can remove 01 to make your wallet generate uncompressed public key extendedchecksum = extended + checksum(extended) wif = base58_encode(extendedchecksum)
puts wif
You need to install ruby, save the code on a file and run it with this command I've tried it quickly, compare the result with bitaddress and check whether the generated WIF can be imported to Electrum (both testnet and mainnet). Okay I just installed Ruby but can someone confirm exactly what code I should save in the "ruby your_file_name.rb" document if my private key is: ef242kfjj24ekf3223jesdkhefsfhk324wuefhw38fhrypofhtr34d342132d34jsd01 ? And also do I just paste the code into Text edit or Microsoft Word? and then just save the file as ".rb"?
|
|
|
|
NotATether
Legendary
Offline
Activity: 1596
Merit: 6740
bitcoincleanup.com / bitmixlist.org
|
|
January 06, 2021, 04:31:21 AM |
|
Okay I just installed Ruby but can someone confirm exactly what code I should save in the "ruby your_file_name.rb" document if my private key is: ef242kfjj24ekf3223jesdkhefsfhk324wuefhw38fhrypofhtr34d342132d34jsd01 ?
And also do I just paste the code into Text edit or Microsoft Word? and then just save the file as ".rb"?
Paste it inside a text editor like Notepad because Microsoft Word and other word processors will mess up the code by adding formatting to it. All you have to do is change the private key on this line: privatekey = "0351764dc07ee1ad038ff49c0e020799f0a350dd0769017ea09460e150a64019" To: privatekey = "ef242kfjj24ekf3223jesdkhefsfhk324wuefhw38fhrypofhtr34d342132d34jsd" Save it as "your_file_name.rb"
|
. .BLACKJACK ♠ FUN. | | | ███▄██████ ██████████████▀ ████████████ █████████████████ ████████████████▄▄ ░█████████████▀░▀▀ ██████████████████ ░██████████████ █████████████████▄ ░██████████████▀ ████████████ ███████████████░██ ██████████ | | CRYPTO CASINO & SPORTS BETTING | | │ | | │ | ▄▄███████▄▄ ▄███████████████▄ ███████████████████ █████████████████████ ███████████████████████ █████████████████████████ █████████████████████████ █████████████████████████ ███████████████████████ █████████████████████ ███████████████████ ▀███████████████▀ ███████████████████ | | .
|
|
|
|
pooya87
Legendary
Offline
Activity: 3444
Merit: 10558
|
|
January 06, 2021, 04:41:25 AM |
|
The blockstack JSON he posted suggests that this could be a master private key, but those are also 64 hex characters long and begin with xprv, but this hex number doesn't have either of these properties.
If the string starts with xprv then it is no longer encoded using hexadecimal characters. They use base58 instead. But 32 bytes can also be the seed that were used in BIP32 or BIP39. For example from BIP39 test vectors: 68a79eaca2324873eacc50cb9c6eca8cc68ea5d936f98787c60c7ebc74e6ce7c
There is also a "passphrase" in BIP39 that can extend the mnemonic generated from the above seed to get entirely different set of child keys.
|
. .BLACKJACK ♠ FUN. | | | ███▄██████ ██████████████▀ ████████████ █████████████████ ████████████████▄▄ ░█████████████▀░▀▀ ██████████████████ ░██████████████ █████████████████▄ ░██████████████▀ ████████████ ███████████████░██ ██████████ | | CRYPTO CASINO & SPORTS BETTING | | │ | | │ | ▄▄███████▄▄ ▄███████████████▄ ███████████████████ █████████████████████ ███████████████████████ █████████████████████████ █████████████████████████ █████████████████████████ ███████████████████████ █████████████████████ ███████████████████ ▀███████████████▀ ███████████████████ | | .
|
|
|
|
21XO (OP)
Jr. Member
Offline
Activity: 57
Merit: 29
|
|
January 06, 2021, 05:14:06 AM |
|
You need to install ruby, save the code on a file and run it with this command https://ibb.co/09S189V
|
|
|
|
ABCbits
Legendary
Offline
Activity: 2870
Merit: 7496
Crypto Swap Exchange
|
Okay I just installed Ruby but can someone confirm exactly what code I should save in the "ruby your_file_name.rb" document if my private key is: ef242kfjj24ekf3223jesdkhefsfhk324wuefhw38fhrypofhtr34d342132d34jsd01 ?
If your private key length is 66 and end with 01, then you need to change these line privatekey = "0351764dc07ee1ad038ff49c0e020799f0a350dd0769017ea09460e150a64019" extended = "ef" + privatekey + "01" # you can remove 01 to make your wallet generate uncompressed public key
into privatekey = "ef242kfjj24ekf3223jesdkhefsfhk324wuefhw38fhrypofhtr34d342132d34jsd01" extended = "80" + privatekey
Are you sure notepadwif.rb file is located on ~ ?
|
|
|
|
PawGo
Legendary
Offline
Activity: 952
Merit: 1367
|
|
January 06, 2021, 11:14:59 AM |
|
I am lost... Finally - does he have his DECODED private key, or ENCODED? If it is ENCODED and he has password, he must use blockstack to decode it.
What he posted is not a private key HEX form (ef242kfjj24ekf3223...) and cannot be easily converted into WIF.
21XO: were you able to launch blockstack and retrieve your private key?
|
|
|
|
bob123
Legendary
Offline
Activity: 1624
Merit: 2481
|
|
January 06, 2021, 11:42:41 AM |
|
Getting blockstack to run should be the easiest way.
If i were you, i'd try to use the software used to generate that key to retrieve the coins. A few dependency problems shouldn't be holding you back, this can be fixed quite easily.
|
|
|
|
NotATether
Legendary
Offline
Activity: 1596
Merit: 6740
bitcoincleanup.com / bitmixlist.org
|
|
January 06, 2021, 11:39:51 PM |
|
I am lost... Finally - does he have his DECODED private key, or ENCODED? If it is ENCODED and he has password, he must use blockstack to decode it.
What he posted is not a private key HEX form (ef242kfjj24ekf3223...) and cannot be easily converted into WIF.
21XO: were you able to launch blockstack and retrieve your private key?
Maybe it's a base36 string. Converting it into hex using javascript gives this: parseInt("ef242kfjj24ekf3223jesdkhefsfhk324wuefhw38fhrypofhtr34d342132d34", 36).toString(16) "14e5771b8ad8e800000000000000000000000000000000000000000000000000000000000000000000" Not sure how to make sense of this number though. It's 82 characters long, to many to be a private key.
|
. .BLACKJACK ♠ FUN. | | | ███▄██████ ██████████████▀ ████████████ █████████████████ ████████████████▄▄ ░█████████████▀░▀▀ ██████████████████ ░██████████████ █████████████████▄ ░██████████████▀ ████████████ ███████████████░██ ██████████ | | CRYPTO CASINO & SPORTS BETTING | | │ | | │ | ▄▄███████▄▄ ▄███████████████▄ ███████████████████ █████████████████████ ███████████████████████ █████████████████████████ █████████████████████████ █████████████████████████ ███████████████████████ █████████████████████ ███████████████████ ▀███████████████▀ ███████████████████ | | .
|
|
|
|
PawGo
Legendary
Offline
Activity: 952
Merit: 1367
|
|
January 07, 2021, 11:47:33 AM |
|
I have same question, using blockstack should be far easier (since you've used it on past) than mess with the key when we don't know even how blockstack store user's key.
def aes_decrypt_legacy(payload, secret): """ Legacy AES decryption (FROM INSECURE ENCRYPTION)! Return decrypted secret on success Return None on error """ print "Falling back to legacy decryption" # DO NOT USE TO ENCRYPT # legacy hold-over for migrating to stronger encryption def ensure_length(secret): if len(secret) > 32: secret = secret[:32]
elif len(secret) < 24: length = 24 - (len(secret) % 24) secret += chr(length)*length elif len(secret) > 24 and len(secret) < 32: length = 32 - (len(secret) % 32) secret += chr(length)*length
return hexlify(secret)
try: PADDING = '{'
secret = ensure_length(secret) cipher = Cipher(algorithms.AES(unhexlify(secret)), modes.ECB(), backend = default_backend()) decryptor = cipher.decryptor() res = decryptor.update(base64.b64decode(payload)) + decryptor.finalize() res = res.rstrip(PADDING) return res except: return None
def aes_decrypt(payload, secret): """ Decrypt a base64-encoded payload with a hex-encoded secret. Returns the plaintext on success Returns None on error """ try: res = scrypt.decrypt(base64.b64decode(payload), unhexlify(secret)) return res except scrypt.error: res = aes_decrypt_legacy(payload, secret) return res
|
|
|
|
TheBeardedBaby
Legendary
Offline
Activity: 2184
Merit: 3134
₿uy / $ell
|
|
January 08, 2021, 12:14:44 AM |
|
Focus on installing the cli wallet. Using a virtual machine gives you the conformity to start all over again very quickly if something goes wrong. Make a backup of the clean installation. Post here your steps, there are enough people around who would like to help in the process. Just a note, Windows 10 comes with0 Ubuntu too, only the console versjon but it will be enough for you. Good luck
|
|
|
|
21XO (OP)
Jr. Member
Offline
Activity: 57
Merit: 29
|
|
January 08, 2021, 12:36:52 AM |
|
I managed to install it using cygwin, so on your linux machine it should work... Or on Windows... Remember that you will probably need packages libssl-devel (for cryptography/wheels) and python-devel.
Okay so I can install it on Windows, Debian, or Ubuntu....anyways so far I downloaded libssl-devel on Ubuntu using these instructions ( https://zoomadmin.com/HowToInstall/UbuntuPackage/libssl-dev) but I'm not sure how to download python-devel?
|
|
|
|
21XO (OP)
Jr. Member
Offline
Activity: 57
Merit: 29
|
|
January 08, 2021, 12:38:09 AM |
|
Okay I just installed Ruby but can someone confirm exactly what code I should save in the "ruby your_file_name.rb" document if my private key is: ef242kfjj24ekf3223jesdkhefsfhk324wuefhw38fhrypofhtr34d342132d34jsd01 ?
If your private key length is 66 and end with 01, then you need to change these line privatekey = "0351764dc07ee1ad038ff49c0e020799f0a350dd0769017ea09460e150a64019" extended = "ef" + privatekey + "01" # you can remove 01 to make your wallet generate uncompressed public key
into privatekey = "ef242kfjj24ekf3223jesdkhefsfhk324wuefhw38fhrypofhtr34d342132d34jsd01" extended = "80" + privatekey
Are you sure notepadwif.rb file is located on ~ ? I saved it on my desktop...not sure what you mean by "~"?
|
|
|
|
|