Skip to content

Astronomical issue with private keys to sign tx. #60

@chrisforrester

Description

@chrisforrester

secret seed is "erupt consider beyond twist bike enroll you salute weasel emerge divert hundred"

with keystore password "password"
with hdPath = "m/44'/60'/0'"

the private key that is returned is a 62 character hex value.

example code:
(using lightwallet.keystore.deriveKeyFromPassword(password, function(err, pwDerivedKey))

var keystore = new lightwallet.keystore(secretSeed, pwDerivedKey);
var hdPath = "m/44'/60'/0'"; //as defined in SLIP44

keystore.addHdDerivationPath(hdPath, pwDerivedKey, {curve: 'secp256k1', purpose: 'sign'});
keystore.generateNewAddress(pwDerivedKey, 1, hdPath); //Generate a new address

var incompleteAddress = keystore.getAddresses(hdPath)[0];
keystore.setDefaultHdDerivationPath(hdPath);
var hexSeedETH = keystore.exportPrivateKey(incompleteAddress, pwDerivedKey);

..

hexSeedETH.length = 62.

something like a:

function pad(num, size) {
var s = num+"";
while (s.length < size) {
s = "0" + s;
}
return s;
}

with a:

hexSeedETH = pad(hexSeedETH, 64);

returns valid private keys that can sign for this address for the ethereumjs-tx module, and this library's signtx function.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions