blockchain_sdk 0.1.0

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

[0.0.1] - 02/11/2020.

  • Generate a mnemonic [12, 15, 18, 21, 24] words

[0.1.0] - 03/11/2020.

  • Generate a deterministic seed from the mnemonic

example/README.md

BIP39 #

Mnemonic, Seed #

  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

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  blockchain_sdk: ^0.1.0

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:blockchain_sdk/blockchain_sdk.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
50
Learn more about scoring.

We analyzed this package on Feb 12, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.5

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.6.0 <3.0.0
convert ^2.1.1 2.1.1
crypto ^2.1.3 2.1.4
Transitive dependencies
charcode 1.1.3
collection 1.14.12
typed_data 1.1.6
Dev dependencies
flutter_test