パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v3.1.3

dartsv

Bitcoinネットワークとやり取りするためのDartライブラリ。このライブラリは、Flutterアプリケーションの開発に特に適しています。

AndroidiOSmacOSWindowsLinux
30日間ダウンロード
1150
いいね数
11
Pub ポイント
120

パッケージをインストール

flutter pub add dartsv

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

DartSVは、ビットコインネットワークとのやり取りを目的としたDartライブラリであり、開発者がビットコイン対応アプリケーションを構築できるツールを提供します。Flutterプロジェクトでの使用に最適化されており、Android、iOS、macOS、Windows、Linuxプラットフォームへのシームレスな統合を可能にしています。アドレス生成、取引作成、暗号化機能などの基本的なビットコイン操作をサポートしており、ブロックチェーンベースのアプリに最適です。軽量な設計とクロスプラットフォーム互換性への注力により、ネイティブコードを必要とせずにビットコイン統合を簡素化します。オープンソースの性質により、コミュニティの貢献と透明性が促進されます。

用途

  • ビットコインウォレットの構築
  • ブロックチェーンエクスプローラーの作成
  • ビットコイン決済の統合
  • 分散型アプリの開発
  • ビットコイン取引の処理

主な機能

  • ビットコインアドレスの生成
  • トランザクションの署名とシリアライズ
  • 暗号化ユーティリティ
  • クロスプラットフォーム対応
  • オープンソースで、積極的にメンテナンスされています

適している対象

  • Flutter開発者
  • Web3アプリケーション作成者
  • 暗号資産に焦点を当てたモバイルアプリ
  • ブロックチェーン初心者
  • ビットコインプロトコルの愛好家

注意事項

  • ビットコインの基本を理解する必要があります
  • ビットコイン固有の機能に限定
  • 完全な機能を実現するには、外部のビットコインノードに依存します
  • 高頻度取引には適していません
  • セキュアなキー管理の実践と併用するのが最適です

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

Introduction

Dart CI

Overview

TwoStack WalletSDK is a Bitcoin library for the Dart Language ( dartlang.org ), loosely based on the Moneybutton/BSV Javascript library. This library has been built in line with the ideals espoused by BitcoinSV, i.e. massive on-chain scaling, protocol stability and original-bitcoin-protocol implementation. It is intended for use in building multi-platform applications using the Flutter framework, or server-side bitcoin applications using frameworks like Serverpod

A note about Version 2.x (August 2023)

Version 2.x of the library is a major refactor and breaks backwards compatibility with several previous library APIs.

  • A new TransactionBuilder class for composing Transactions
  • Removal of the old Builder interface which was directly attached to the Transaction class
  • A complete re-implementation of the Script Interpreter
  • The Sighash class now exposes the SigHash Pre-Image; useful when creating OP_PUSH_TX spending scripts.
  • A new ScriptBuilder class to make it easy to create custom locking/unlocking scripts.
  • Merged contributed code to have better Flutter Web support.

Generally Supported features are :

  • Custom-Script Builder Interface to support novel locking/spending conditions within Script
  • Pre-built library code to support "standard" locking/unlocking scripts
    • P2PKH Transactions
    • P2SH Transactions
    • P2MS Transactions (naked multisig)
    • P2PK Transactions
    • Data-only Transactions (locked with OP_FALSE OP_RETURN)
    • Spendable data-carrier Transactions (locked with PUSH_DATA [your_data] OP_DROP [P2PKH locking code])
  • HD Key Derivation (BIP32)
  • Original Bitcoin Address format
  • Bitcoin Signed Messages
  • Mnemonic Seed Support (BIP39)
  • A built-in Bitcoin Script Interpreter
  • ECIES Encryption / Decryption (Supports Electrum ECIES / BIE1 )
Sample of the Transaction API:
    var utxo = txWithUTXO.outputs[0]; 
    var outpoint = TransactionOutpoint(txWithUTXO.id, 0, utxo.satoshis, utxo.script);
    var signer = TransactionSigner(SighashType.SIGHASH_FORKID.value | SighashType.SIGHASH_ALL.value, privateKey);

    var unlocker = P2PKHUnlockBuilder(privateKey.publicKey);
    
    var transaction = TransactionBuilder()
        .spendFromOutpointWithSigner(signer, outpoint, TransactionInput.MAX_SEQ_NUMBER, unlocker)
        .spendToPKH(recipientAddress, BigInt.from(50000000)) //spend half of a bitcoin 
        .sendChangeToPKH(changeAddress) // spend change to a different address
        .withFeePerKb(50) //set a fee of 50 satoshis per kilobyte
        .build(false); //build the transaction, disabling checks

    //at this point you have a fully signed transaction ready to be broadcast

    try {
      transaction.verify(); //perform a pre-broadcast sanity check on the transaction
    } on VerificationException catch (ex){
      print("Transaction failed verification - ${ex.cause}");  
    }

Installation

This library was built using version 3.0.7 of the Dart SDK( https://dart.dev/tools/sdk ).
As of Version 1.0.0 this library supports Dart Null Safety. Current minimum Dart SDK version required is version 2.17.0.

Navigate to the root folder of this project, and pull the required supported Dart libraries using the pub package manager.

> pub get
Running the Tests

In the root folder of this project, run the command:

> pub run test

Acknowledgement

A debt of gratitude is owed to the developers acknowledged in the LICENSE file. Without the hard work of individuals working on earlier library and node implementations like Bitcoin Core, Bitcoin Cash, MoneyButton/BSV, BitcoinJ and many more, this library would likely not have come to fruition. Thank you.

Contact

You can reach the author at :

  • @twostack_org on Twitter
  • beardpappa@handcash.io (PayMail to buy me a beer)
  • stephan@twostack.org (drop me an email. GPG supported. )

カテゴリー

依存関係

依存関係一覧 8 件

ソースリポジトリ

このパッケージを使用しているプロジェクト

データはまだありません。