From 5a3d56bc862d809f63669cb2f0de585805521630 Mon Sep 17 00:00:00 2001 From: Manuel Araoz Date: Thu, 22 Jan 2015 15:54:05 -0300 Subject: [PATCH] improve hd keys docs --- docs/hierarchical.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/hierarchical.md b/docs/hierarchical.md index 9c0ebd8..a45f86c 100644 --- a/docs/hierarchical.md +++ b/docs/hierarchical.md @@ -18,12 +18,16 @@ Sample usage: var hdPrivateKey = new HDPrivateKey(); var retrieved = new HDPrivateKey('xpriv...'); var derived = privateKey.derive("m/0'"); -var derivedByNumber = privateKey.derive(1).derive(2, true); -var derivedByArgument = privateKey.derive("m/1/2'"); +var derivedByNumber = hdPrivateKey.derive(1).derive(2, true); +var derivedByArgument = hdPrivateKey.derive("m/1/2'"); assert(derivedByNumber.xprivkey === derivedByArgument.xprivkey); var address = new Address(privateKey.publicKey, Networks.livenet); var redeem = new Transaction().from(output).to(target, 10000).sign(derived.privateKey); + +// obtain HDPublicKey +var hdPublicKey = hdPrivateKey.hdPublicKey; + ``` ## HDPublicKey