Author

Topic: EHT and BTC Private and public keys (Read 148 times)

HCP
legendary
Activity: 2086
Merit: 4361
December 31, 2017, 06:08:31 PM
#5
So if I understand correctly you can use the same seed to generate different public and private keys for each coin.
Well... you can see from my previous post that the same seed actually generated the same private keys and the same public keys... it is just the addresses derived from the public keys that are different... as they use different formats/hash functions/algorithms etc for converting from a public key to an address.

remember: PrivKey -> PubKey -> Address.

Also, by using different "derivation paths" you can generate different private keys from the same seed... this is why each coin tends to use a unique derivation path, so you can have different keys for each coin. That is how popular hardware wallets like the Trezor and Ledger wallets work... one seed -> different derivation paths for each coin -> different private keys -> different addresses... it is also why they hardware wallet devs have been able to create the "fork coin split" tools... by creating a forkcoin wallet (ie. BitcoinCash) with the same derivation path as the original coin (ie. Bitcoin), you can easily access your BitcoinCash as it generates the same private keys etc.



Can we generate the same private key for both coins with the different public address, is this option is doable?
Obviously, because that is exactly what I did...

At the end of the day... a "private key" is just a (very) large number... so you should be able to put that same number into any given cryptocurrency that uses "numerical" private keys and it should then be able to be converted into a public key and from that public key, it should be able to derive an address.
member
Activity: 154
Merit: 10
Open and Transparent Science Powered By Blockchain
December 31, 2017, 10:22:47 AM
#4
I don't quite understand what you mean, but the address format of ETH and BTC is completely different, so how can you use the same address?
newbie
Activity: 5
Merit: 0
December 31, 2017, 09:57:00 AM
#3
Thanks for your quick reply.

So if I understand correctly you can use the same seed to generate different public and private keys for each coin.

Can we generate the same private key for both coins with the different public address, is this option is doable?

Happy Holidays,
HCP
legendary
Activity: 2086
Merit: 4361
December 29, 2017, 12:09:47 AM
#2
I know you can use the same "seed"... and the private keys/public keys can be the same (they're just large numbers, and displayed slightly differently with the 0x notation in ETH)... However, you obviously can't use the same addresses though, because the format of BTC and ETH addresses are different, even though they are generated from the same public key.

Tested on: https://iancoleman.io/bip39/
Test Seed: penalty simple sell act keen usual cherry prefer fun head daring cluster torch collect bless outdoor cross alley theory federal snake crater pink swarm
(NOTE: you need to use BIP32 and a custom path so you can test BTC with same path as ETH)
Used bitaddress.org to convert from BTC private key from WIF to HEX

BTC:
Path: m/44'/60'/0'/0/0   
Address: 17X2rzNDQb8FCANCLr8rxpsBdirZr6nyyH   
Public Key: 02b314668a9b881f3ede3cd5b623475082b601c3d81d719d5fb10a05140103d01f   
Private Key (WIF): L1Aqmjc4BRxMuzCJS7nqvhTqtK8PnEYFikWFbrMTi9R6Hmjj2Sxj
Private Key (Hex): 75DFA25F0E539C0E2A6BF367112FC26C15ED1E780537D320718A213309A7C63D

ETH:
Path: m/44'/60'/0'/0/0   
Address: 0xCFFc5F0b895a6E5511c16bC8E6389716488e127B   
Public Key: 0x02b314668a9b881f3ede3cd5b623475082b601c3d81d719d5fb10a05140103d01f   
Private Key: 0x75dfa25f0e539c0e2a6bf367112fc26c15ed1e780537d320718a213309a7c63d

newbie
Activity: 5
Merit: 0
December 28, 2017, 08:29:31 AM
#1
Hello guys,

Is it possible to use the same addresses private & public for BTC and ETH?
If so, how can I generate those keys?

Please advise.
Jump to: