aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoriancoleman <1281387+iancoleman@users.noreply.github.com>2019-12-20 15:58:26 +1100
committerGitHub <noreply@github.com>2019-12-20 15:58:26 +1100
commit181b5d61e308bc6b6371e753f8ac5817755c01be (patch)
tree36f40be3a5886de01fdf57a9751de46d89ceddb4 /src
parentaa793f572f26ad20740f28040de13431c973dfb8 (diff)
parent4dfc681f71bc6d1181d24a3bd0d462bbd6b60beb (diff)
downloadBIP39-181b5d61e308bc6b6371e753f8ac5817755c01be.tar.gz
BIP39-181b5d61e308bc6b6371e753f8ac5817755c01be.tar.zst
BIP39-181b5d61e308bc6b6371e753f8ac5817755c01be.zip
Merge pull request #390 from matthewleon/bugfix/eth-xpub-derivation
Bugfix/eth xpub derivation
Diffstat (limited to 'src')
-rw-r--r--src/js/index.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/js/index.js b/src/js/index.js
index d843ee1..92772f6 100644
--- a/src/js/index.js
+++ b/src/js/index.js
@@ -1128,9 +1128,9 @@
1128 } 1128 }
1129 // Ethereum values are different 1129 // Ethereum values are different
1130 if (networkIsEthereum()) { 1130 if (networkIsEthereum()) {
1131 var privKeyBuffer = keyPair.d.toBuffer(32); 1131 var pubkeyBuffer = keyPair.getPublicKeyBuffer();
1132 privkey = privKeyBuffer.toString('hex'); 1132 var ethPubkey = libs.ethUtil.importPublic(pubkeyBuffer);
1133 var addressBuffer = libs.ethUtil.privateToAddress(privKeyBuffer); 1133 var addressBuffer = libs.ethUtil.publicToAddress(ethPubkey);
1134 var hexAddress = addressBuffer.toString('hex'); 1134 var hexAddress = addressBuffer.toString('hex');
1135 var checksumAddress = libs.ethUtil.toChecksumAddress(hexAddress); 1135 var checksumAddress = libs.ethUtil.toChecksumAddress(hexAddress);
1136 address = libs.ethUtil.addHexPrefix(checksumAddress); 1136 address = libs.ethUtil.addHexPrefix(checksumAddress);