HD Public Keys (Bip32)

Hierarchical Deterministic Keys(HD Keys) form a key component of how one manages Public keys within a Bitcoin Wallet. If you are not familiar with HD Keys, be sure to read more about them in the Developer Guide Appendix

Obtain extended Public Key

//masterSeed is BIP39 mnemonic seed value
var masterSeed = '000102030405060708090a0b0c0d0e0f';
var seededPrivateKey = HDPrivateKey.fromSeed(masterSeed, NetworkType.TEST);

//derive a child key
var derivedKey = seededKey.deriveChildKey("m/0'/1");

//obtain the extended public key from the xpriv
HDPublicKey xPub = derivedKey.hdPublicKey

//obtain a regular ECC public key
SVPublicKey pubKey = xPub.publicKey
On this page