0

I want to read the balance on my Edge wallet programatically. I have thus taken the wallet's Master Private Key, which I had expected to be a BIP39 seed phrase but is instead a hex value, and am attempting to create a BIP32 root. this fails:

var bip32 = require('bip32');
var root = bip32.fromSeed(Buffer.from('<my-private-key>'));

/Users/ekkis/dev/node_modules/bip32/src/bip32.js:283 throw new TypeError('Seed should be at most 512 bits'); ^

TypeError: Seed should be at most 512 bits at Object.fromSeed (/Users/ekkis/dev/node_modules/bip32/src/bip32.js:283:15) at Object. (/Users/ekkis/dev/bip39.js:12:18) at Module._compile (internal/modules/cjs/loader.js:721:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:732:10) at Module.load (internal/modules/cjs/loader.js:620:32) at tryModuleLoad (internal/modules/cjs/loader.js:560:12) at Function.Module._load (internal/modules/cjs/loader.js:552:3) at Function.Module.runMain (internal/modules/cjs/loader.js:774:12) at executeUserCode (internal/bootstrap/node.js:342:17) at startExecution (internal/bootstrap/node.js:276:5)

with BIP39 I would ordinarily do:

var seed = bip39.mnemonicToSeedSync('my-seed-phrase');
var root = bip32.fromSeed(seed);

but I notice the seed it produces is 128 hex characters whereas the key I got from Edge is 65 hex chars

How do I get from what I have to what I need?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.