diff --git a/lib/bip32.js b/lib/bip32.js index cb754a7..73abfa4 100644 --- a/lib/bip32.js +++ b/lib/bip32.js @@ -44,8 +44,8 @@ BIP32.prototype.fromRandom = function(networkstr) { this.keypair = (new Keypair()).fromRandom(); this.hasPrivateKey = true; this.pubKeyHash = Hash.sha256ripemd160(this.keypair.pubkey.toBuffer()); - this.buildExtendedPublicKey(); - this.buildExtendedPrivateKey(); + this.buildxpubkey(); + this.buildxprivkey(); }; BIP32.prototype.fromString = function(str) { @@ -77,8 +77,8 @@ BIP32.prototype.fromSeed = function(bytes, networkstr) { this.hasPrivateKey = true; this.pubKeyHash = Hash.sha256ripemd160(this.keypair.pubkey.toBuffer()); - this.buildExtendedPublicKey(); - this.buildExtendedPrivateKey(); + this.buildxpubkey(); + this.buildxprivkey(); return this; }; @@ -119,11 +119,11 @@ BIP32.prototype.initFromBytes = function(bytes) { throw new Error('Invalid key'); } - this.buildExtendedPublicKey(); - this.buildExtendedPrivateKey(); + this.buildxpubkey(); + this.buildxprivkey(); } -BIP32.prototype.buildExtendedPublicKey = function() { +BIP32.prototype.buildxpubkey = function() { this.xpubkey = new Buffer([]); var v = null; @@ -167,7 +167,7 @@ BIP32.prototype.xpubkeyString = function(format) { } } -BIP32.prototype.buildExtendedPrivateKey = function() { +BIP32.prototype.buildxprivkey = function() { if (!this.hasPrivateKey) return; this.xprivkey = new Buffer([]); @@ -306,8 +306,8 @@ BIP32.prototype.deriveChild = function(i) { ret.pubKeyHash = Hash.sha256ripemd160(ret.keypair.pubkey.toBuffer()); - ret.buildExtendedPublicKey(); - ret.buildExtendedPrivateKey(); + ret.buildxpubkey(); + ret.buildxprivkey(); return ret; }