Bitcoin Forum
May 04, 2024, 05:28:22 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Does Ledger Give Different Extended Public Keys for Both Segwit and Legacy Addr  (Read 147 times)
Rickorick (OP)
Jr. Member
*
Offline Offline

Activity: 107
Merit: 8


View Profile
March 13, 2018, 12:09:33 AM
Merited by vapourminer (1)
 #1

I want to know if Ledger Gives Different Extended Public Keys for Both Segwit and Legacy Addresses, because i tried exporting my extended public key to recover BCH i mistakenly sent to a segwit address using https://bch.btc.com/docs/help/bch_segwit_recovery, but they said they xpub key is not associated with the address, but when i log in to ledger on chrome, i see the address there.
1714843702
Hero Member
*
Offline Offline

Posts: 1714843702

View Profile Personal Message (Offline)

Ignore
1714843702
Reply with quote  #2

1714843702
Report to moderator
The Bitcoin network protocol was designed to be extremely flexible. It can be used to create timed transactions, escrow transactions, multi-signature transactions, etc. The current features of the client only hint at what will be possible in the future.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714843702
Hero Member
*
Offline Offline

Posts: 1714843702

View Profile Personal Message (Offline)

Ignore
1714843702
Reply with quote  #2

1714843702
Report to moderator
1714843702
Hero Member
*
Offline Offline

Posts: 1714843702

View Profile Personal Message (Offline)

Ignore
1714843702
Reply with quote  #2

1714843702
Report to moderator
HCP
Legendary
*
Offline Offline

Activity: 2086
Merit: 4316

<insert witty quote here>


View Profile
March 13, 2018, 04:48:43 AM
Merited by vapourminer (1), mocacinno (1), Xynerise (1)
 #2

Yes...

SegWit uses m/49'/0'/0' derivation path
Legacy uses m/44'/0'/0' derivation path

if you look at: https://iancoleman.io/bip39/

Generate a random 24 word seed... (DO NOT put your Ledger seed in here!) click the BIP44 Tab and look at the "Account Extended Public Key". Then click the "BIP32" tab... set the "client" to "Custom"... and set the derivation path to: m/44'/0'/0' You'll notice that the "BIP32 Extended Public Key" is the same as the "Account Extended Public Key" form the BIP44 tab... this will be the same as the xpub generated by the "Legacy" wallet in Ledger (using the same seed mnemonic)

If you now change the derivation path to: m/49'/0'/0' you'll note that the "BIP32 Extended Public Key" changes... this should be the same as the xpub for a "SegWit" wallet in Ledger (using the same seed mnemonic)

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
Rickorick (OP)
Jr. Member
*
Offline Offline

Activity: 107
Merit: 8


View Profile
March 13, 2018, 09:42:07 AM
 #3

Thanks man.
merclyn
Jr. Member
*
Offline Offline

Activity: 34
Merit: 8


View Profile
January 16, 2019, 12:13:46 PM
 #4

I found a website that will convert the extended public key from xpub to ypub, or zpub. (actually can convert from any to any)

https://jlopp.github.io/xpub-converter/

the git project is at: https://github.com/jlopp/xpub-converter

I converted the core conversion logic to python for another project im working on.  I can post if anyone needs
jackg
Copper Member
Legendary
*
Offline Offline

Activity: 2856
Merit: 3071


https://bit.ly/387FXHi lightning theory


View Profile
January 16, 2019, 12:21:22 PM
 #5

@merclyn, that one wont work in this case because it's different derivation paths so it's different public keys from the seed.
merclyn
Jr. Member
*
Offline Offline

Activity: 34
Merit: 8


View Profile
January 16, 2019, 01:15:23 PM
Merited by jackg (1)
 #6

@merclyn, that one wont work in this case because it's different derivation paths so it's different public keys from the seed.


Your right, I should have understood the OP's main issue before I posted.

What I thought I was responding to was this scenario:
A Ledger Nano S was setup new with segwit addresses, but it provides a xpub in the log.

According to SLIP-0132 (https://github.com/satoshilabs/slips/blob/master/slip-0132.md) there should be different version byte (or different prefix on that key)
The ledger I tested should have produced a key that started with ypub (P2WPKH in P2SH), but it produced an xpub key.
The Trezor I tested displays the correct extended public key for the address scheme used..

The site I posted earlier would change the Bytes and return a ypub (or zpub if needed).

Thanks for the correction.
jackg
Copper Member
Legendary
*
Offline Offline

Activity: 2856
Merit: 3071


https://bit.ly/387FXHi lightning theory


View Profile
January 16, 2019, 02:13:44 PM
 #7

Yeah it's a really useful tool if it was the right derivation path, it's a bit of a shame it isn't imo.
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!