Skip to content
This repository has been archived by the owner on Sep 16, 2021. It is now read-only.

HDPrivateKey derivation: version argument is not a buffer #5

Open
Burtonium opened this issue Jul 6, 2017 · 6 comments
Open

HDPrivateKey derivation: version argument is not a buffer #5

Burtonium opened this issue Jul 6, 2017 · 6 comments

Comments

@Burtonium
Copy link

The following code fails:

const HDPrivateKey = require('litecore-lib').HDPrivateKey;
const privKey = 'xprv...';

var parent = new HDPrivateKey(privKey);
var child_0_1_2h = parent.derive(0).derive(1).derive(2, true);
var copy_of_child_0_1_2h = parent.derive("m/0/1/2'");
assert(child_0_1_2h.xprivkey === copy_of_child_0_1_2h);

Giving me this error:

AssertionError: version argument is not a buffer at checkBuffer (/home/burton/depositor/node_modules/litecore-lib/lib/hdprivatekey.js:523:5) at Function.HDPrivateKey._validateBufferArguments (/home/burton/depositor/node_modules/litecore-lib/lib/hdprivatekey.js:529:3) at HDPrivateKey._buildFromBuffers (/home/burton/depositor/node_modules/litecore-lib/lib/hdprivatekey.js:461:16) at HDPrivateKey._buildFromObject (/home/burton/depositor/node_modules/litecore-lib/lib/hdprivatekey.js:376:15) at new HDPrivateKey (/home/burton/depositor/node_modules/litecore-lib/lib/hdprivatekey.js:61:10) at Object.<anonymous> (/home/burton/depositor/index.js:5:14) at Module._compile (module.js:570:32) at Object.Module._extensions..js (module.js:579:10) at Module.load (module.js:487:32) at tryModuleLoad (module.js:446:12)

Any work arounds for this?

@manhnc-dev
Copy link

Did you solve this issue?

@ultragtx
Copy link

ultragtx commented Dec 4, 2017

The master and segwit branch are using old base58 prefixes, you can use branch v5.0 https://github.com/litecoin-project/litecore-lib/tree/v5.0 (not published to npm yet)

Or modify xpubkey xprivkey in lib/networks.js back to 0x0488b21e and 0x0488ade4.

@visionsofparadise
Copy link

i published the branch to npm as 'litecore-lib-v5' since this repo seems dead

@mastashake08
Copy link

litecore-lib-v5

Yo you are a life save literally!

@red-name
Copy link

litecore-lib-v5

You saved me! xpub and xprv works great!

@losh11
Copy link

losh11 commented May 20, 2021 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants