GithubHelp home page GithubHelp logo

bitcore-mnemonic's Introduction

bitcore-mnemonic's People

Contributors

braydonf avatar dabura667 avatar dooglus avatar eordano avatar firescar96 avatar isocolsky avatar junderw avatar lacksfish avatar maraoz avatar matiu avatar mi-ro avatar rubensayshi avatar yemel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bitcore-mnemonic's Issues

deprecation warning

(node:23765) [DEP0079] DeprecationWarning: Custom inspection function on Objects via .inspect() is deprecated

Erro npm module

$ node address.js
/home/dragon/projects/bitcore/node_modules/bitcore-mnemonic/node_modules/bitcore-lib/index.js:12
throw new Error(message);
^
Error: More than one instance of bitcore-lib found. Please make sure to require bitcore-lib and check that submodules do not also include their own bitcore-lib dependency.
at Object.bitcore.versionGuard (/home/dragon/projects/bitcore/node_modules/bitcore-mnemonic/node_modules/bitcore-lib/index.js:12:11)
at Object. (/home/dragon/projects/bitcore/node_modules/bitcore-mnemonic/node_modules/bitcore-lib/index.js:15:9)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object. (/home/dragon/projects/bitcore/node_modules/bitcore-mnemonic/lib/mnemonic.js:3:15)
at Module._compile (module.js:460:26)

Add web build to /dist and bower.json

Generate a web build that does not include bitcore. Users must include bitcore as a dependency as follows.

<script src="lib/bitcore.js">
<script src="lib/bitcore-poetry.js">

Client Side: Cannot find module 'bitcore-lib' at a (bitcore-mnemonic.min.js:1)

I installed the library with bower install bitcore-mnemonic --save but I get the following error:

Uncaught Error: Cannot find module 'bitcore-lib'
    at a (bitcore-mnemonic.min.js:1)
    at o (web3.min.js:1)
    at a (bitcore-mnemonic.min.js:1)
    at bitcore-mnemonic.min.js:1
    at Object.<anonymous> (bitcore-mnemonic.min.js:1)
    at Object.require.2../errors (bitcore-mnemonic.min.js:1)
    at a (bitcore-mnemonic.min.js:1)
    at bitcore-mnemonic.min.js:1
    at Object.require.bitcore-mnemonic../lib/mnemonic (bitcore-mnemonic.min.js:19)
    at a (bitcore-mnemonic.min.js:1)

If I install and include bitcore-lib with bower I get this error:

bitcore-lib.js:54088 Uncaught Error: More than one instance of bitcore-lib found. Please make sure to require bitcore-lib and check that submodules do not also include their own bitcore-lib dependency.
    at Object.bitcore.versionGuard (bitcore-lib.js:54088)
    at Object.<anonymous> (bitcore-lib.js:54091)
    at Object.require.bitcore-lib../lib/address (bitcore-lib.js:54147)
    at s (bitcore-lib.js:1)
    at o (web3.min.js:1)
    at o (web3.min.js:1)
    at (index):68
    <script src="../bower_components/bitcore-mnemonic/bitcore-mnemonic.min.js"></script>
    <script src="../bower_components/bitcore-lib/bitcore-lib.js"></script>

      <script type="text/javascript">
        var bitcore = require('bitcore-lib');
        console.log("bitcore",bitcore)
        var Mnemonic = require('bitcore-mnemonic');
        console.log("Mnemonic",Mnemonic)
        window.Mnemonic = Mnemonic
      </script>

Brazilian portuguese wordlist

Hi all,

I developed a brazilian portuguese wordlist for our projects and it could be interesting to put on main branch.

I tried to make a pull request from my working branch (feature-ptbr-wordlist), but it is not accepting under releases or master. I figured the steps from https://github.com/bitpay/bitcore/blob/master/CONTRIBUTING.md but stills not sending.

Then I am attaching just the .js for your reviewing and if possible, telling me the steps to send the pull request with all working.

Best regards,

brazilian_portuguese.js.zip

From seed to mnemonic not possible ?

Hello,

I have so master seed that I want to translate into a mnemonic so I can enter it in a device. I tried to generate a new Mnemonic from a seed but the result is different. I am doing it wrong or it is just simply not possible ?

> var code = new Mnemonic()
undefined
> code
<Mnemonic: echo visual paddle amount craft art ticket receive guard slender promote edge >
> code.toSeed()
<Buffer 55 f9 2e 68 c3 32 01 14 6f 8e ab e2 2d 1c  ... >
> new Mnemonic(code.toSeed())
<Mnemonic: field siren olive major cactus mechanic sail ... >

Error: More than one instance of bitcore-lib found. Please make sure to require bitcore-lib and check that submodules do not also include their own bitcore-lib dependency.

When I am trying to use this lib in my nodejs script.
const Mnemonic = require('bitcore-mnemonic');

It says:

/Users/gkucmierz/learn/my-app/node_modules/bitcore-lib/index.js:12
    throw new Error(message);
    ^

Error: More than one instance of bitcore-lib found. Please make sure to require bitcore-lib and check that submodules do not also include their own bitcore-lib dependency.
    at Object.bitcore.versionGuard (/Users/gkucmierz/learn/my-app/node_modules/bitcore-lib/index.js:12:11)
    at Object.<anonymous> (/Users/gkucmierz/learn/my-app/node_modules/bitcore-lib/index.js:15:9)
    at Module._compile (module.js:573:30)
    at Object.Module._extensions..js (module.js:584:10)
    at Module.load (module.js:507:32)
    at tryModuleLoad (module.js:470:12)
    at Function.Module._load (module.js:462:3)
    at Module.require (module.js:517:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/Users/gkucmierz/learn/my-app/src/public/mix-coins.js:2:17)
    at Module._compile (module.js:573:30)
    at Object.Module._extensions..js (module.js:584:10)
    at Module.load (module.js:507:32)
    at tryModuleLoad (module.js:470:12)
    at Function.Module._load (module.js:462:3)
    at Module.require (module.js:517:17)

Should there be a "Mnemonic.fromHDPrivateKey()"

If you've already generated a bitcore.HDPrivateKey(), should there be a way to pass it into Mnemonic to get the mnemonic phrase for it. It doesn't seem like you can do that currently, you have to generate the HDPrivateKey with Mnemonic.

Smaller Package Wordlist

I would suggest having a smaller package that implements only English version or an initializer
this will make the bundle size smaller.

No need to require the whole package.

Mnemonic._entropyChecksum sometimes returning wrong result in IE and Edge

The result of toString on a number can be different across browsers for large numbers. In particular, it's possible for IE to use exponential notation, which breaks Mnemonic._entropyChecksum.

This can be reproduced using this seed: patrol wise idea oyster inquiry crash dignity chronic scatter time admit pet, which is valid on Chrome and Firefox, but invalid on IE11 and Edge.

I tried a quick fix (#29), but I'm not super familiar with BIP39, and calculating the checksum seems more complicated than what I initially thought.

Can't instantiate Mnemonic in a web worker

Mnemonic.prototype.toHDPrivateKey() takes 20s on my Anroid and thus I'd like to create it "in the background".

Putting it in a new Worker() yields Uncaught Error: Uncaught ReferenceError: window is not defined. Apparently this stems from bitcore:

if ((inBrowser && window._bitcore) || (!inBrowser && global._bitcore)) {.

I browserified Mnemonic and try to include it like this:

importScripts(e.data.url + '/lib/bundle2.browser.js') // in this line above error is thrown

(I would prefer to have bitcore to offer a promise-based way to do expensive stuff like this ;) )

Expand browser tests

Include more browsers in testing, or provide a convenient to do so manually with an index.html file in the tests directory.

Mnemonic from <-> to

Hi, I have a question.
I create Mnemonic from some String. I then call toSeed() method and I get a Buffer. Afterwards, I create a new Mnemonic using the same Buffer generated by toSeed method. I call toHDPrivateKey().privateKey.toWIF() on both Mnemonics and I get two different results. Why is this? It seems if I pass String or Buffer to Mnemonic constructor the result should be the same, yet it's not.

Remove SJCL

pbkdf2_sha512 is the only required function from SJCL. Implement it on bitcore and remove the dependency.

Create mnemonic from xpriv

It seems the Mnemonic class only can generate new from thin air, but from an already existing xpriv.

I have an xpriv that has been generated, from that xpriv, I want to generate the word list. For instance:

var mn = new Mnemonic.from_xpriv("xprv9uHSnwRJmrVpyLoQcroxzcVpbX8t2mBXr5mjEgmz5FwybjxW5QWqTMgeEtfMwWbggEm9uji839Y4B5hwYrc2z5t9E1SbiDvfwyJTvJZyhue")
console.log(mn.phrase)

Is this possible?

FR generated invalid words

  1. Credentials Should verify roundtrip create/from with fr/passphrase:
    Mnemonic string is invalid:
caution opprimer époque belote devenir ficeler filleul caneton apologie nectar frapper fouiller

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.