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

getNewWalletFromSeed(): Entropy source not available #85

Open
sollerias opened this issue Jul 7, 2020 · 4 comments
Open

getNewWalletFromSeed(): Entropy source not available #85

sollerias opened this issue Jul 7, 2020 · 4 comments

Comments

@sollerias
Copy link

Hello, guys! Could you, please, help me with this problem:
I couldn't process getNewWalletFromSeed() method, just get error: Entropy source not available.

OS: macOS Sierra 10.12.6
Node.js: 12.8.1

What does it mean? How to resolve this issue?

I enclose my code below:

const {
  getNewWalletFromSeed,
} = require('@lunie/cosmos-keys');

const createWallet = async () => {
  const mnemonic = "gentle mutual speak consider mandate kingdom cash explain soul exile cabin squeeze";

  try {
    const {
      cosmosAddress,
      privateKey,
      publicKey
    } = getNewWalletFromSeed(mnemonic);

  } catch (error) {
    console.log(error);
  }
};

Thanks a lot in advance!

@webmaster128
Copy link

webmaster128 commented Jul 8, 2020

I can reproduce this. It happens even without calling createWallet from the example. Here is the stacktrace:

Error: Entropy source not available.
    at h (/projects/lunie-test/node_modules/@lunie/cosmos-keys/lib/cosmos-keys.js:1186:208)
    at u (/projects/lunie-test/node_modules/@lunie/cosmos-keys/lib/cosmos-keys.js:1186:701)
    at Object.t.randomBytes (/projects/lunie-test/node_modules/@lunie/cosmos-keys/lib/cosmos-keys.js:1186:782)
    at Function.randomBits (/projects/lunie-test/node_modules/@lunie/cosmos-keys/lib/cosmos-keys.js:1140:38253)
    at Function.random (/projects/lunie-test/node_modules/@lunie/cosmos-keys/lib/cosmos-keys.js:1140:38861)
    at SECP256K1.randomScalar (/projects/lunie-test/node_modules/@lunie/cosmos-keys/lib/cosmos-keys.js:372:10093)
    at l._getBlinding (/projects/lunie-test/node_modules/@lunie/cosmos-keys/lib/cosmos-keys.js:372:14282)
    at l.precompute (/projects/lunie-test/node_modules/@lunie/cosmos-keys/lib/cosmos-keys.js:372:15393)
    at SECP256K1.precompute (/projects/lunie-test/node_modules/@lunie/cosmos-keys/lib/cosmos-keys.js:372:7986)
    at e.exports.get curve [as curve] (/projects/lunie-test/node_modules/@lunie/cosmos-keys/lib/cosmos-keys.js:133:316)

I can offer to integrate the secp256k1 implementation from @cosmjs/crypto here, which is well tested in browser and node. It does not require randomness for signing. Please let me know if this is desired.

@gelinger777
Copy link
Contributor

@sollerias have you solved it?

@faboweb
Copy link
Contributor

faboweb commented Dec 20, 2020

The library works in the browser only. Checkout @cosmjs/launchpad for a more versatile library.

@YakovL
Copy link

YakovL commented Feb 14, 2022

@faboweb could you add this to readme, so that it's obvious at the first glance on repo?

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

5 participants