Giter Club home page Giter Club logo

Comments (3)

bgok avatar bgok commented on August 28, 2024

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?

from slips.

prusnak avatar prusnak commented on August 28, 2024

Added in c8b32fc

from slips.

chrisforrester avatar chrisforrester commented on August 28, 2024

@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/

from slips.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.