GithubHelp home page GithubHelp logo

blockchain_sdk's Introduction

Blockchain SDK

Build Status codecov version compatibility license

  Summary: A dart package used for blockchain related project
  Author: Jean-Baptiste Dominguez (twitter/github: @jbdtky)

BIP39

Mnemonic, Seed

The mnemonic generation is the beginning for a blockchain application. It will create a user-friendly deterministic seed that your user could store easily anywhere. This seed could be used to generate a deterministic key pair in order to sign anything that your would like.

Example

  final mnemonic = Mnemonic.generate();
  print(mnemonic.words) // [bind, assume, arrange, apology, around, admit, barrel, alpha, bird, basket, baby, apology]

  final mnemonic = Mnemonic.generate({words: 24}); // Max entropy = 256
  print(mnemonic.words) // [busy, abuse, among, afraid, bronze, business, adult, awkward, advance, advance, aisle, bench, build, adapt, black, brand, all, bottom, badge, already, ball, burden, alarm, bag]

  final words = ['bind', 'assume', 'arrange', 'apology', 'around', 'admit', 'barrel', 'alpha', 'bird', 'basket', 'baby', 'apology'];
  final mnemonic = Mnemonic(words);

  // Generate the seed from the mnemonic using PBKDF2 with HMAC-SHA512 + 2048 iteration + 64 derivation key length in byte
  final seed = mnemonic.toSeed();
  final seedWithPassphrase = mnemonic.toSeed(passphrase: 'passphrase');
  print(hex.encode(seed)); // bcd46f78ee88e56a30fe102095ce3999d48631afbf32df302af39b98e7047d77174541eb3d44a717dd2824fdda1218d12f86e5d8ab1d54a131db206bbb64d959
  print(hex.encode(seedWithPassphrase)); // 886010b4aa1f7c70001f23a586ab0ab7db189dce6748f0b57d7d08059052e9ffa336c834002b3934cc03fdfac1143fa931b01531980a93a27a181d72e60577eb

Reference

https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki

blockchain_sdk's People

Contributors

jbdtky avatar

Watchers

James Cloos avatar  avatar

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.