Hello,
I'm trying to use HD wallet, with the purpose of derivating child keys from
xpubkey in order to setup some sort of merchant processor that generate a
child pubkey for each user using this code.
char[] mnemonicArray = Mnemonic.create(Strength.HIGH, WordList.ENGLISH);
String seedCode = new String(mnemonicArray);
System.out.println("Mnemonic seed : " + seedCode);
ECKey btcKey = HdWalletUtils.generateBitcoinKey(seedCode);
System.out.println("Bitcoin pubkey: " + btcKey);
byte[] chain = new byte[32];
// Generate extended pubKey
DeterministicKey xpubKey =
createMasterPubKeyFromBytes(btcKey.getPubKey(),chain);
System.out.println("Extended pub key " + xpubKey);
//Generate a list of child keys
List<DeterministicKey> childAddress=
HdWalletUtils.generateBitcoinChildKey(xpubKey);
System.out.println("Child : " + childAddress);
My problem is the following :
I'm creating a key pair called `btcKey`, then I'm trying to use the
`createMasterPubKeyFromBytes` in order to generate a master public key. But
when I display both keys, I have the same pubkey for both.
I assume that my mistake is to think that xpubkey = masterpubkey, but perhaps
these two concept are different and I'm doing it the wrong way.
If someone has some ideas to help me, I would be glad !
--
You received this message because you are subscribed to the Google Groups
"bitcoinj" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.