Bitcoin Forum
May 25, 2019, 06:32:27 PM *
News: Latest Bitcoin Core release: 0.18.0 [Torrent] (New!)
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: any way of deriving legacy private key from a segwit address for forked coins?  (Read 145 times)
RealMachasm
Member
**
Offline Offline

Activity: 187
Merit: 24


View Profile
February 07, 2018, 05:17:29 PM
 #1

Hi Guys,
I have recently (a couple of months ago) moved my BTC stash to a segwit address using Electrum wallet.
As you may be aware many of the forked coins do not support segwit addresses.
Its my understanding that the segwit addresses are derived from legacy addresses? Or have I got that completely wrong?
If they are derived from legacy addresses can I find out which legacy address and its corresponding private key from my segwit address?
Obviously the aim is to be able to import the derived legacy address into the forked coin wallet and receive my forked coins.
Or have I got this completely wrong and there is no way to get any legacy private key from a segwit address?
Thanks.

3LrRBnTe6CDtMXkvpsXj5fVZyfjFVJf2ZW
PLAY OVER 3000 GAMES
LIGHTNING FAST WITHDRAWALS
PLAY NOW
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1558809147
Hero Member
*
Offline Offline

Posts: 1558809147

View Profile Personal Message (Offline)

Ignore
1558809147
Reply with quote  #2

1558809147
Report to moderator
1558809147
Hero Member
*
Offline Offline

Posts: 1558809147

View Profile Personal Message (Offline)

Ignore
1558809147
Reply with quote  #2

1558809147
Report to moderator
1558809147
Hero Member
*
Offline Offline

Posts: 1558809147

View Profile Personal Message (Offline)

Ignore
1558809147
Reply with quote  #2

1558809147
Report to moderator
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 1778
Merit: 2399


bc1qshxkrpe4arppq89fpzm6c0tpdvx5cfkve2c8kl


View Profile WWW
February 07, 2018, 07:08:27 PM
Merited by HeRetiK (1)
 #2

Segwit addresses are not derived from legacy addresses. However a legacy address can be derived from a private key for a segwit address, and vice versa. Private keys are just numbers and are not locked to a specific type of address that they should be used to create.

Note that Electrum uses a special format for private keys in order to indicate what type of address they should be used for. You will need to export those private keys and convert them into a format that your forked coin's wallet can understand.

RealMachasm
Member
**
Offline Offline

Activity: 187
Merit: 24


View Profile
February 07, 2018, 09:24:20 PM
 #3

Segwit addresses are not derived from legacy addresses. However a legacy address can be derived from a private key for a segwit address, and vice versa. Private keys are just numbers and are not locked to a specific type of address that they should be used to create.

Note that Electrum uses a special format for private keys in order to indicate what type of address they should be used for. You will need to export those private keys and convert them into a format that your forked coin's wallet can understand.
Thank you appreciate your insight.
So the question is, do you know how to convert the exported Electrum key?

3LrRBnTe6CDtMXkvpsXj5fVZyfjFVJf2ZW
nullius
Copper Member
Full Member
***
Offline Offline

Activity: 168
Merit: 776


Help! I’ve got the Pleurodelinaemia! @nym.zone


View Profile WWW
February 08, 2018, 03:48:30 AM
Merited by HeRetiK (1)
 #4

Segwit addresses are not derived from legacy addresses. However a legacy address can be derived from a private key for a segwit address, and vice versa. Private keys are just numbers and are not locked to a specific type of address that they should be used to create.

Note that Electrum uses a special format for private keys in order to indicate what type of address they should be used for. You will need to export those private keys and convert them into a format that your forked coin's wallet can understand.
Thank you appreciate your insight.
So the question is, do you know how to convert the exported Electrum key?

Base58check-decode the WIF private key, change the version byte from 0x81 (for Bech32 P2WPKH) or 0x82 (for P2WPKH nested in P2SH) to 0x80 (or whatever your fork coin uses), then base58check-encode the result.  Note that I am only describing the conversion of the WIF.  I make no statement whatsoever about what may or may not work for attempts to claim forked coins.

Here is the full set of values Electrum uses, copied from the source of some unreleased software of mine:

Code:
/*
 * From Electrum 3.0 Release Notes
 * https://github.com/spesmilo/electrum/blob/2774126db6c258807d95921936eb13af07047d97/RELEASE-NOTES
 */

#define WIF_P2PKH 0x80
#define WIF_P2WPKH 0x81
#define WIF_P2WPKH_P2SH 0x82
#define WIF_P2SH 0x85
#define WIF_P2WSH 0x86
#define WIF_P2WSH_P2SH 0x87

Do you know any programming, or do you need a tool for this?

RealMachasm
Member
**
Offline Offline

Activity: 187
Merit: 24


View Profile
February 08, 2018, 07:27:15 AM
 #5

Do you know any programming, or do you need a tool for this?

I am not a programmer and would very much appreciate a tool for this job, preferably one that runs on Windows or through a browser. I can use Linux if required however.
Very much appreciate your help here too.
Thanks.

3LrRBnTe6CDtMXkvpsXj5fVZyfjFVJf2ZW
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!