Author

Topic: converting 52bit private keys to Base58 format (Read 5290 times)

full member
Activity: 154
Merit: 100
December 13, 2017, 06:35:06 AM
#12
Note: they're not '52bit'. They're all 256-bit.

Maybe you're talking about the length of the WIF - 52 characters - but since base58 encodes more data per character, that's why it's not a 32 byte (== 256bit) binary string.

As you know, the same private key can be encoded differently to indicate that it's public key should be compressed when generating the address.

You just base58_decode(), and add or remove the \x01 byte after the private key, and re-encode to get the WIF for other address.


sr. member
Activity: 412
Merit: 287
Note: they're not '52bit'. They're all 256-bit.

Maybe you're talking about the length of the WIF - 52 characters - but since base58 encodes more data per character, that's why it's not a 32 byte (== 256bit) binary string.

As you know, the same private key can be encoded differently to indicate that it's public key should be compressed when generating the address.

You just base58_decode(), and add or remove the \x01 byte after the private key, and re-encode to get the WIF for other address.

full member
Activity: 217
Merit: 259
I'm not sure why anyone want to convert compressed into uncompressed keys, but there are several tools as others pointed out.  Even brainwallet.org had the possibility before it was shut down.

https://rawgit.com/brainwallet/brainwallet.github.io/f7679dd03f39a04edced641960a7c3df1116fea9/

Note that the public key is (slightly) different, so if your other wallet only support uncompressed keys, you can't spend money send to the compressed address.
hero member
Activity: 910
Merit: 511
A couple of months ago, I wanted to find ways to convert a uncompressed private key to compressed private for my address (here). I came across this utility "Bitcoin Address Utility" by Casascius. I am not sure it can convert the keys by the click of a button. It could be of help if you want to convert it semi-manually.

https://en.bitcoin.it/wiki/Bitcoin_Address_Utility

great utility medusa!!!
i find this who do similar things
https://github.com/pointbiz/bitaddress.org
here the site
https://www.bitaddress.org/

thankyou for the help!
legendary
Activity: 952
Merit: 1005
--Signature Designs-- http://bit.ly/1Pjbx77
A couple of months ago, I wanted to find ways to convert a uncompressed private key to compressed private for my address (here). I came across this utility "Bitcoin Address Utility" by Casascius. I am not sure it can convert the keys by the click of a button. It could be of help if you want to convert it semi-manually.

https://en.bitcoin.it/wiki/Bitcoin_Address_Utility
staff
Activity: 3458
Merit: 6793
Just writing some code
ok!
if i understand well, i can not convert compressed 52bit format to 51bit directly...
but if so...
i have my bitcoin address...
i imagine 2 command
1) extract_compressed_52bit bitcoin_address
2) extract_uncompressed_51bit bitcoin_address

command 1) is:
dumpprivkey bitcoi_address

but what about command 2)Huh?

confused....  Huh Huh Huh Huh Huh
There is no such command which distinguishes between compressed and uncompressed private keys. dumpprivkey will dump whatever type of private key is in the bitcoin core wallet, which, in new versions, happens to be the compressed type. To convert the type, you will need to get the private key in hex from the WIF format, and then reencode that back to WIF but with the compressed prefix. The instructions are in the link I posted above.
hero member
Activity: 910
Merit: 511
i try to explain better...
i purchased some museCoin on IPO.
now MuseCoin wallet was released... and i need 51bit private key to redeem my muse.
i tryed with 52bit private key but doesn't work..
i need to try with 51bit.
It seems who with 51bit all work fine!
that's all!!!
legendary
Activity: 1974
Merit: 1029
if i understand well, i can not convert compressed 52bit format to 51bit directly...
but if so...
i have my bitcoin address...
i imagine 2 command
1) extract_compressed_52bit bitcoin_address
2) extract_uncompressed_51bit bitcoin_address

command 1) is:
dumpprivkey bitcoi_address

but what about command 2)Huh?

confused....  Huh Huh Huh Huh Huh

There's usually no reason to want to do that. I suspect you want to achieve something and think this is the means, however I think you're probably mistaken. Why do you want to do this?
hero member
Activity: 910
Merit: 511
Hi.
i need to convert my bitcoin private key from 51bit standard to 52bit Base58 standard.
from mi qt-wallet i get 52bit private key format with command "dumpprivkey bitcoinaddress"
this 52bit PK start with L or K
and now.. how to convert it to 51 bit Base58 format, who start with 5?

for example this is a 51 bit PK:
Lerwgnsfdlkgh45h745lhgshvelakmr6l4j5l74j5lyelsdnfgeD
this is a base58 PK
5werkòljhyewnbasdARTGSvgsLFgjAERgjaSRGjeRk134t5yawg

this are fake PK.. of course!

many thanx!

bit is not the same as symbols. The keys you export from bitcoin core with the above command are in WIF and as such in Base58[1]. A private key starting with L or K is indicating a compressed pubkey while an uncompressed pubkey has a privkey starting with a 5. If you convert from uncompressed to compressed (or the other way around) you will end up with a different address. Is that what you want?

[1] https://en.bitcoin.it/wiki/Base58Check_encoding



ok!
if i understand well, i can not convert compressed 52bit format to 51bit directly...
but if so...
i have my bitcoin address...
i imagine 2 command
1) extract_compressed_52bit bitcoin_address
2) extract_uncompressed_51bit bitcoin_address

command 1) is:
dumpprivkey bitcoi_address

but what about command 2)Huh?

confused....  Huh Huh Huh Huh Huh
copper member
Activity: 1498
Merit: 1528
No I dont escrow anymore.
Hi.
i need to convert my bitcoin private key from 51bit standard to 52bit Base58 standard.
from mi qt-wallet i get 52bit private key format with command "dumpprivkey bitcoinaddress"
this 52bit PK start with L or K
and now.. how to convert it to 51 bit Base58 format, who start with 5?

for example this is a 51 bit PK:
Lerwgnsfdlkgh45h745lhgshvelakmr6l4j5l74j5lyelsdnfgeD
this is a base58 PK
5werkòljhyewnbasdARTGSvgsLFgjAERgjaSRGjeRk134t5yawg

this are fake PK.. of course!

many thanx!

bit is not the same as symbols. The keys you export from bitcoin core with the above command are in WIF and as such in Base58[1]. A private key starting with L or K is indicating a compressed pubkey while an uncompressed pubkey has a privkey starting with a 5. If you convert from uncompressed to compressed (or the other way around) you will end up with a different address. Is that what you want?

[1] https://en.bitcoin.it/wiki/Base58Check_encoding

staff
Activity: 3458
Merit: 6793
Just writing some code
This page will help: https://en.bitcoin.it/wiki/Wallet_import_format. The L or K prefixes are because they refer to compressed public keys, so when you convert, you will not get the same bitcoin address.
hero member
Activity: 910
Merit: 511
Hi.
i need to convert my bitcoin private key from 51bit standard to 52bit Base58 standard.
from mi qt-wallet i get 52bit private key format with command "dumpprivkey bitcoinaddress"
this 52bit PK start with L or K
and now.. how to convert it to 51 bit Base58 format, who start with 5?

for example this is a 51 bit PK:
Lerwgnsfdlkgh45h745lhgshvelakmr6l4j5l74j5lyelsdnfgeD
this is a base58 PK
5werkòljhyewnbasdARTGSvgsLFgjAERgjaSRGjeRk134t5yawg

this are fake PK.. of course!

many thanx!
Jump to: