How to generate xPub Key from public key in java

0

I am working on a Bitcoin Wallet, i have public key but can't figure out how can i genrate xPub key from this.

Zombie

Posted 2017-12-06T09:27:13.593

Reputation: 528

You can't. Perhaps you can ask a more specific question after reading more about BIP32?Pieter Wuille 2017-12-07T03:54:55.277

I also recommend to have a look into Andreas' book "Mastering Bitcoin" (2nd edition), where he explains in chapter 5, how HD wallets and BIP32 work. The book is somewhere online readable (I think it was even on Amazon, but there is the pre-release only, and has chapter 4 with wallets).pebwindkraft 2017-12-07T12:51:19.280

Answers

2

The extended public key, xPub, consists of both a chaincode and the public key itself. These are effectively distinct from each other, you cannot generate the chain code from the public key or vice-versa. Normally they are both generated at the same time from a seed, but without the seed you cannot generate the same chain code.

MeshCollider

Posted 2017-12-06T09:27:13.593

Reputation: 8 735

@TygaChristed please accept the answer if it satisfied your question, because otherwise it remains "unanswered" on the site :)MeshCollider 2017-12-13T12:14:07.693