Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lisk path #45

Closed
psionic81 opened this issue Oct 12, 2016 · 3 comments
Closed

Lisk path #45

psionic81 opened this issue Oct 12, 2016 · 3 comments

Comments

@psionic81
Copy link

Jaxx is going to use 134.

Im not necessarily implementing it with full hd style like our ethereum implementation, this is purely for using the entropy at this node point to be able to generate an address

@bgok
Copy link

bgok commented Oct 13, 2016

Have you written docs on your ethereum implementation? I am implementing it now for KK and had to make some assumptions since ethereum doesn't fit neatly into bip44. When you say 'full hd style' what do you mean?

@prusnak
Copy link
Member

prusnak commented Oct 13, 2016

Added in c8b32fc

@prusnak prusnak closed this as completed Oct 13, 2016
@chrisforrester
Copy link

@prusnak thanks :)

@bgok I used only the receive addresses (index zero) to generate ethereum addresses. Given that ethereum is not a utxo based crypto, I simply sort accounts by highest balance and send out like that, combining the sends if I need to.

For lisk, I'm only going to use index 0, 0 (first child node/address from the receive node as the base) so there will only be one address shown (doesn't change on account having received any balance) with a qr code and such. so I'm going to use some bytes from that node, using it as a source of entropy to generate the lisk address (something sane like the first n bytes from that node). That part is still a WIP. ethereum was "easy".

ours uses bitcoinlib-js, which has been super stable (we tried using lightwallet back in april but that caused major issues with certain versions of android webviews). The derivation code looks like so:

HDWalletPouchEthereum.getCoinAddress = function(node) {
// console.log("[ethereum] node :: " + node);
var ethKeyPair = node.keyPair;
// console.log("[ethereum] keyPair :: " + ethKeyPair.d + " :: " + ethKeyPair.__Q);

var prevCompressed = ethKeyPair.compressed;
ethKeyPair.compressed = false;

var ethKeyPairPublicKey = ethKeyPair.getPublicKeyBuffer();

var pubKeyHexEth = ethKeyPairPublicKey.toString('hex').slice(2);

var pubKeyWordArrayEth = thirdparty.CryptoJS.enc.Hex.parse(pubKeyHexEth);

var hashEth = thirdparty.CryptoJS.SHA3(pubKeyWordArrayEth, { outputLength: 256 });

var addressEth = hashEth.toString(thirdparty.CryptoJS.enc.Hex).slice(24);

ethKeyPair.compressed = prevCompressed;

//        console.log("[ethereum] address :: " + addressEth);
return "0x" + addressEth;

}

using the bitcoinlib-js node structures. You can see this on jaxx.io with our backend code, it's the hdwallet_pouch_impl_ethereum.js one.

https://jaxx.io/sourceCode/

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

No branches or pull requests

4 participants