GithubHelp home page GithubHelp logo

Comments (4)

44203 avatar 44203 commented on August 15, 2024

... and i accidentally deleted my comment, while trying to edit it. Go me.

I think this would be great, but it might make more sense to implement the mnemonic generation in bitcore and pass through an options object from bitauth like:

bitauth.generateSin({ mnemonic: true });

I'd like to hear @ryanxcharles thoughts on this.

As far as the proposed methods for decodeSinMnemonic() and getPublicKeyFromPrivateKeyMnemonic(), I'm all for it. Maybe @pnagurny wants to chime in?

from bitauth.

pnagurny avatar pnagurny commented on August 15, 2024

Yeah I agree it should probably be in bitcore first, and then we can pass it through.

from bitauth.

ryanxcharles avatar ryanxcharles commented on August 15, 2024

Thanks to @devrandom, bitcore supports BIP39. This is a way of converting secure random entropy into a mnemonic seed. Note that you must derive your private keys this way from the start, since the private key is the hash of the mnemonic. You can't convert an existing private key into a mnemonic using BIP39. Here's an example session where I generate a new random mnemonic and use that to make a Key:

> var m = bitcore.BIP39.mnemonic(bitcore.BIP39WordlistEn, 256);
undefined
> m;
'crew spider exit material night hurdle fetch wealth situate put risk entire shy range uniform season distance creek mercy castle unusual oak pilot need'
> var key = new bitcore.Key();
undefined
> key.private = bitcore.BIP39.mnemonic2seed(m).slice(0, 32);
<Buffer f7 c9 8c 10 6c b5 c1 d1 5a 80 8f 6c 0e 29 01 df a4 66 c1 78 b1 34 58 89 b2 70 af 65 0a 79 74 18>
> key.regenerateSync();
undefined
> key;
{ compressed: true,
  public: <SlowBuffer 02 1e aa 0b 37 1d 8d 2b 13 17 c7 1b d2 1e 18 09 f3 34 a1 50 58 ee 95 c4 89 aa 41 87 5b c3 95 2b e0>,
  private: <SlowBuffer f7 c9 8c 10 6c b5 c1 d1 5a 80 8f 6c 0e 29 01 df a4 66 c1 78 b1 34 58 89 b2 70 af 65 0a 79 74 18> }

from bitauth.

devrandom avatar devrandom commented on August 15, 2024

Nice use of BIP39!

BTW, I wonder if it would be appropriate for SINKeys to be generated using BIP32. You'd have just one secret for convenient backups while allowing the creation of any number of unlinkable credentials for different apps.

from bitauth.

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.