Bitcoin Forum
November 03, 2024, 07:47:39 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: converting 52bit private keys to Base58 format  (Read 5287 times)
italianMiner72 (OP)
Hero Member
*****
Offline Offline

Activity: 910
Merit: 511


View Profile
October 31, 2015, 08:12:04 PM
 #1

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!

██▬▬▬

██▬

██▬

██▬▬▬



████           ▄▄█████████▄▄            ▄▄█████████▄▄        ████         █████      ██████████████████   ████████████       ████    ████████████    
████         ▄███████████████▄        ▄███████████████▄      ████       █████      ████████████████████  █████████████      ████    █████████████   
████        █████▀       ▀█████▄     █████▀       ▀█████     ████     █████         █       ████       █  ████     █████             ████     █████  
████       ████▀           ▀████▄   ████▀           ▀████    ████   █████                   ████          ████      ████     ████    ████      ████  
████      ████▀              ▀████ ▀███▀                     ████ █████                     ████          ████     █████     ████    ████     █████  
████      ████                 ████▄ ▀                       ████████                       ████          █████████████      ████    █████████████   
████      ████                  ▀████                        ████████                       ████          ████████████       ████    ████████████    
████      ████▄             ▄██▄ ▀████▄                      ████ █████                     ████          ████    ████       ████    ████            
████       ████▄           ▄████   ▀████▄           ▄████    ████   █████                   ████          ████    ▀████      ████    ████            
████        █████▄       ▄█████      █████▄       ▄█████     ████     █████                 ████          ████      ████     ████    ████            
████████████ ▀███████████████▀        ▀███████████████▀      ████       █████               ████          ████       ████    ████    ████            
█████████████  ▀▀█████████▀▀            ▀▀█████████▀▀        ████         █████             ████          ████        █████  ████    ████            

 
 
 
▬▬▬██

▬██

▬██

▬▬▬██
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3542
Merit: 6885


Just writing some code


View Profile WWW
October 31, 2015, 08:15:43 PM
Merited by ABCbits (1)
 #2

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.

shorena
Copper Member
Legendary
*
Offline Offline

Activity: 1498
Merit: 1540


No I dont escrow anymore.


View Profile
October 31, 2015, 08:17:30 PM
 #3

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


Im not really here, its just your imagination.
italianMiner72 (OP)
Hero Member
*****
Offline Offline

Activity: 910
Merit: 511


View Profile
October 31, 2015, 08:41:16 PM
 #4

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

██▬▬▬

██▬

██▬

██▬▬▬



████           ▄▄█████████▄▄            ▄▄█████████▄▄        ████         █████      ██████████████████   ████████████       ████    ████████████    
████         ▄███████████████▄        ▄███████████████▄      ████       █████      ████████████████████  █████████████      ████    █████████████   
████        █████▀       ▀█████▄     █████▀       ▀█████     ████     █████         █       ████       █  ████     █████             ████     █████  
████       ████▀           ▀████▄   ████▀           ▀████    ████   █████                   ████          ████      ████     ████    ████      ████  
████      ████▀              ▀████ ▀███▀                     ████ █████                     ████          ████     █████     ████    ████     █████  
████      ████                 ████▄ ▀                       ████████                       ████          █████████████      ████    █████████████   
████      ████                  ▀████                        ████████                       ████          ████████████       ████    ████████████    
████      ████▄             ▄██▄ ▀████▄                      ████ █████                     ████          ████    ████       ████    ████            
████       ████▄           ▄████   ▀████▄           ▄████    ████   █████                   ████          ████    ▀████      ████    ████            
████        █████▄       ▄█████      █████▄       ▄█████     ████     █████                 ████          ████      ████     ████    ████            
████████████ ▀███████████████▀        ▀███████████████▀      ████       █████               ████          ████       ████    ████    ████            
█████████████  ▀▀█████████▀▀            ▀▀█████████▀▀        ████         █████             ████          ████        █████  ████    ████            

 
 
 
▬▬▬██

▬██

▬██

▬▬▬██
dserrano5
Legendary
*
Offline Offline

Activity: 1974
Merit: 1029



View Profile
October 31, 2015, 08:46:47 PM
 #5

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?
italianMiner72 (OP)
Hero Member
*****
Offline Offline

Activity: 910
Merit: 511


View Profile
October 31, 2015, 08:54:45 PM
 #6

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!!!

██▬▬▬

██▬

██▬

██▬▬▬



████           ▄▄█████████▄▄            ▄▄█████████▄▄        ████         █████      ██████████████████   ████████████       ████    ████████████    
████         ▄███████████████▄        ▄███████████████▄      ████       █████      ████████████████████  █████████████      ████    █████████████   
████        █████▀       ▀█████▄     █████▀       ▀█████     ████     █████         █       ████       █  ████     █████             ████     █████  
████       ████▀           ▀████▄   ████▀           ▀████    ████   █████                   ████          ████      ████     ████    ████      ████  
████      ████▀              ▀████ ▀███▀                     ████ █████                     ████          ████     █████     ████    ████     █████  
████      ████                 ████▄ ▀                       ████████                       ████          █████████████      ████    █████████████   
████      ████                  ▀████                        ████████                       ████          ████████████       ████    ████████████    
████      ████▄             ▄██▄ ▀████▄                      ████ █████                     ████          ████    ████       ████    ████            
████       ████▄           ▄████   ▀████▄           ▄████    ████   █████                   ████          ████    ▀████      ████    ████            
████        █████▄       ▄█████      █████▄       ▄█████     ████     █████                 ████          ████      ████     ████    ████            
████████████ ▀███████████████▀        ▀███████████████▀      ████       █████               ████          ████       ████    ████    ████            
█████████████  ▀▀█████████▀▀            ▀▀█████████▀▀        ████         █████             ████          ████        █████  ████    ████            

 
 
 
▬▬▬██

▬██

▬██

▬▬▬██
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3542
Merit: 6885


Just writing some code


View Profile WWW
October 31, 2015, 09:01:34 PM
 #7

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.

medUSA
Legendary
*
Offline Offline

Activity: 952
Merit: 1005


--Signature Designs-- http://bit.ly/1Pjbx77


View Profile WWW
October 31, 2015, 10:32:23 PM
 #8

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
italianMiner72 (OP)
Hero Member
*****
Offline Offline

Activity: 910
Merit: 511


View Profile
November 01, 2015, 04:46:53 PM
 #9

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!

██▬▬▬

██▬

██▬

██▬▬▬



████           ▄▄█████████▄▄            ▄▄█████████▄▄        ████         █████      ██████████████████   ████████████       ████    ████████████    
████         ▄███████████████▄        ▄███████████████▄      ████       █████      ████████████████████  █████████████      ████    █████████████   
████        █████▀       ▀█████▄     █████▀       ▀█████     ████     █████         █       ████       █  ████     █████             ████     █████  
████       ████▀           ▀████▄   ████▀           ▀████    ████   █████                   ████          ████      ████     ████    ████      ████  
████      ████▀              ▀████ ▀███▀                     ████ █████                     ████          ████     █████     ████    ████     █████  
████      ████                 ████▄ ▀                       ████████                       ████          █████████████      ████    █████████████   
████      ████                  ▀████                        ████████                       ████          ████████████       ████    ████████████    
████      ████▄             ▄██▄ ▀████▄                      ████ █████                     ████          ████    ████       ████    ████            
████       ████▄           ▄████   ▀████▄           ▄████    ████   █████                   ████          ████    ▀████      ████    ████            
████        █████▄       ▄█████      █████▄       ▄█████     ████     █████                 ████          ████      ████     ████    ████            
████████████ ▀███████████████▀        ▀███████████████▀      ████       █████               ████          ████       ████    ████    ████            
█████████████  ▀▀█████████▀▀            ▀▀█████████▀▀        ████         █████             ████          ████        █████  ████    ████            

 
 
 
▬▬▬██

▬██

▬██

▬▬▬██
johoe
Full Member
***
Offline Offline

Activity: 217
Merit: 259


View Profile
November 02, 2015, 09:47:44 AM
 #10

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.

Donations to 1CF62UFWXiKqFUmgQMUby9DpEW5LXjypU3
fbueller
Sr. Member
****
Offline Offline

Activity: 412
Merit: 287


View Profile
November 05, 2015, 03:41:25 PM
 #11

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.


Bitwasp Developer.
elmeijera
Full Member
***
Offline Offline

Activity: 154
Merit: 100



View Profile
December 13, 2017, 11: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.



Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!