Comments (4)
... 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.
Yeah I agree it should probably be in bitcore first, and then we can pass it through.
from bitauth.
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.
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)
- Implementation Specification Paper HOT 1
- Browser build on Post-Install
- Node 0.12.0 has 'bad decrypt' error HOT 2
- Add encryption HOT 1
- signed responses? HOT 1
- Recover Public Key From Signed Message HOT 1
- Support for Web Cryptography API HOT 3
- make-dist.sh doesn't check command path or success of bundle creation and minification
- 𝒰nicode 𝔖upport? HOT 2
- Provide Browserified & Minified Code In Releases HOT 3
- Make A Tagged Release For 0.3.1 HOT 2
- BIP43 "purpose" number for bitauth key generation from a BIP32 seed HOT 2
- Broken Browserify HOT 1
- Version 0.3.1 Breaks Google Closure Compiler Support HOT 1
- Installation error HOT 1
- How is this different from a signed JWT?
- I failed to build android
- Please release a new version HOT 4
- Invalid character in header content ["x-signature"] HOT 2
- [email protected]
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bitauth.