Code Monkey home page Code Monkey logo

bip39's People

Contributors

anicdh avatar longhoangwkm avatar ookami-kb avatar sfzxc avatar vdeurzen avatar willyfromtheblock 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

Watchers

 avatar  avatar  avatar  avatar  avatar

bip39's Issues

about null-safety

Hi.
I am wondering when the null-safety will be updated.

plz, update

pointycastle: ^2.0.0
hex: ^0.1.2

Thanks.

Project maintenance!

Hey!

Project maintenance would be nice. People appreciate your work and are willing to spend some time with your project. But you need to update the pub.dev package as well!

Derrived address different then expected

Hey, I am using this library to derive accounts from the deprivation path of m/44'/60'/0'/0/0 which works fine, but when I derive path with m/44'/60'/0'/0/1 it is inconsistent with what we get from metamask or other applications.

I am using this mnemonic company loud estate century olive gun tribe pulse bread play addict amount

0th address if fine which is 0x2Ee331840018465bD7Fe74aA4E442b9EA407fBBE
from 1st address it gives different account then expected, it should give 0x97F5aE30eEdd5C3c531C97E41386618b1831Cb7b but its giving 0xeeed912ce027042b94ea6288001c27541d2cc59b
You can check accounts with this site https://iancoleman.io/bip39/

I am using this snippet to derive account

    final root = bip32.BIP32.fromSeed(HEX.decode(seed));
    final child1 = root.derivePath("m/44'/60'/0'/0/1");
    final privateKey = HEX.encode(child1.privateKey);
    final private = EthPrivateKey.fromHex(privateKey);
    final address = await private.extractAddress();```

`_randomBytes` generates non-uniform random values

bip39.generateMnemonic uses the Random.secure() CSPRNG from the dart:math library to generate entropy for the mnemonic in _randomBytes.

Uint8List _randomBytes(int size) {
final rng = Random.secure();
final bytes = Uint8List(size);
for (var i = 0; i < size; i++) {
bytes[i] = rng.nextInt(_SIZE_BYTE);
}
return bytes;
}

Here _SIZE_BYTE is defined as 255 (on line 10). Since the nextInt method generates integers in the half-open interval [0, max) for a given upper bound max, the value 255 will never be generated. This means that the generated entropy will not be uniformly random. This is an issue if the library is used to generate private keys (e.g. using BIP32).

Chinese mnemonic

I am currently facing an issue converting Chinese mnemonics to hex. The returned string does not match the intended result. Everything works fine when attempting on English. Thanks in advance.

String plainText = "成 山 何 阀 臣 愈 梅 握 厂 坑 磷 正 熊 紧 簧";
String seedHex = bip39.mnemonicToSeedHex(plainText);
// result: f9efae87296519949ddecfb4fecf59beec3a1bb71ecfd3452aa653c5d9d9af9cfe017916a000151527b22ee79a86b0a24836b024696534fa2a8c0ca403540533

// intended result:
41656441c5621160d8d67aa48a99818e1bb0ef9668d20f22b6129662e14a7ad8b8ed2125c66516bbb3bc96ce109cd919a69c60c7263c6eafb1fb9032d6749556

ethereum

How check its unvalid for which substring?

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.