Giter Club home page Giter Club logo

nexm_bitcoin_flutter's Introduction

pub version

bitcoin_flutter

A dart Bitcoin library for Flutter.

Released under the terms of the MIT LICENSE.

Inspired by bitcoinjs

Otherwise, pull requests are appreciated.

Installing

Flutter Packages

Examples

import 'package:bitcoin_flutter/bitcoin_flutter.dart';
import 'package:bip39/bip39.dart' as bip39;

main() {
  var seed = bip39.mnemonicToSeed("praise you muffin lion enable neck grocery crumble super myself license ghost");
  var hdWallet = new HDWallet.fromSeed(seed);
  print(hdWallet.address);
  // => 12eUJoaWBENQ3tNZE52ZQaHqr3v4tTX4os
  print(hdWallet.pubKey);
  // => 0360729fb3c4733e43bf91e5208b0d240f8d8de239cff3f2ebd616b94faa0007f4
  print(hdWallet.privKey);
  // => 01304181d699cd89db7de6337d597adf5f78dc1f0784c400e41a3bd829a5a226
  print(hdWallet.wif);
  // => KwG2BU1ERd3ndbFUrdpR7ymLZbsd7xZpPKxsgJzUf76A4q9CkBpY
  
  var wallet = Wallet.fromWIF("Kxr9tQED9H44gCmp6HAdmemAzU3n84H3dGkuWTKvE23JgHMW8gct");
  print(wallet.address);
  // => 19AAjaTUbRjQCMuVczepkoPswiZRhjtg31
  print(wallet.pubKey);
  // => 03aea0dfd576151cb399347aa6732f8fdf027b9ea3ea2e65fb754803f776e0a509
  print(wallet.privKey);
  // => 3095cb26affefcaaa835ff968d60437c7c764da40cdd1a1b497406c7902a8ac9
  print(wallet.wif);
  // => Kxr9tQED9H44gCmp6HAdmemAzU3n84H3dGkuWTKvE23JgHMW8gct
}

The below examples are implemented as integration tests:

TODO

  • Generate a SegWit P2SH address
  • Generate a SegWit multisig address
  • Create a Transaction with a P2SH(multisig) input
  • Build a Transaction w/ psbt format
  • Add Tapscript / Taproot feature

Running the test suite

pub run test

Complementing Libraries

  • BIP39 - Mnemonic generation for deterministic keys
  • BIP32 - BIP32
  • Base58 Check - Base58 check encoding/decoding

LICENSE MIT

nexm_bitcoin_flutter's People

Contributors

andoanwkm avatar sfzxc avatar longhoangwkm avatar tpscrpt avatar anicdh avatar rohankapurdev avatar lorenz10 avatar mctrivia avatar p3root avatar ivaneidel avatar quoctran1 avatar dunxen avatar salemalem avatar thearchitect108 avatar dao-wkm 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.