GithubHelp home page GithubHelp logo

geigerzaehler242 / bitcoindevkit-scripts Goto Github PK

View Code? Open in Web Editor NEW

This project forked from thunderbiscuit/bitcoindevkit-scripts

0.0 0.0 0.0 292 KB

A whole lot of scripts that use the Bitcoin Development Kit in different languages

License: Apache License 2.0

Python 6.82% Rust 35.28% Kotlin 26.69% Swift 31.20%

bitcoindevkit-scripts's Introduction

Readme

This repo hosts a collection of scripts that make use of the Bitcoin Development Kit and some of its language bindings.

Total number of scripts: 34

Rust Scripts

To run Rust scripts, you'll the need the rust-script tool installed. From there, simply use

rust-script 1.balance.rs

Kotlin Scripts

You can call Kotlin scripts directly like so:

kotlin 1.balance.main.kts

To use a dependency that only exists in your local Maven repository, add the path to your local Maven at the top of the file like so:

@file:Repository("file:///~/.m2/repository/")
@file:DependsOn("org.bitcoindevkit:bdk-jvm:0.27.0-SNAPSHOT")

import org.bitcoindevkit.*

// ...

Python Scripts

Python is easy! Just make sure you have the correct version of the library installed. The check_bdk_version() utility function will throw a warning if your version of the library is not the one defined in the script.

pip3 install bdkpython
python 1.balance.py

Swift Scripts

The Swift scripts in this repository use the swift sh tool, which allows to integrate 3rd-party dependencies in scripts easily. You can install the tool using brew:

brew install swift-sh

From there, simply run the scripts using the following pattern on your command line:

swift sh 1.balance.swift



File Task
1.balance.rs Query an Electrum server for the balance of a wallet.
2.descriptor-templates.rs Create public descriptors using the descriptor templates.
3.balance-from-rpc.rs Query a full node through RPC for the balance of a descriptor.
4.bdk-policy.rs Print the BDK policy for a non-trivial descriptor.
5.miniscript-compilation.rs Build a BDK wallet starting from a miniscript policy.
6.fee-estimation.rs Estimate the fee rate required to confirm a transaction in a given target of blocks.
7.miniscript-policy-parser.rs Take a list of pubkeys and a miniscript policy in a json file and spit out another json file with tons of useful information.



File Task
1.balance.main.kts Query an Electrum server for the balance of a wallet.
2.blockinfo.main.kts Query an Electrum server for the testnet blockchain height and latest block hash.
3.getaddress.main.kts Get an unused address from a wallet.
4.opreturn.main.kts Create a transaction with an OP_RETURN output.
5.listunspentutxo.main.kts List the unspent outputs this wallet controls.
6.descriptor-from-mnemonic.main.kts Create a BIP84 descriptor starting from a 12-word mnemonic.
7.public-descriptor-template.main.kts Create a public descriptor using descriptor templates.
8.transaction-details.main.kts Print transaction details for each transaction the wallet has completed.
9.private-descriptor-template.main.kts Create private and public descriptors using descriptor templates.
10.create-tx-from-raw-bytes.main.kts Create a Transaction object from raw bytes.
11.derive-custom-path.main.kts Create extended keys using custom derivation paths.
12.basic-transaction.main.kts Create a basic transaction that pays to 1 recipient.



File Task
1.balance.swift Query an Electrum server for the balance of a wallet.
2.blockinfo.swift Query an Electrum server for the testnet blockchain height and latest block hash.
3.getaddress.swift Get an unused address from a wallet.
4.opreturn.swift Create a transaction with an OP_RETURN output.
5.listunspentutxo.swift List the unspent outputs this wallet controls.
6.descriptor-from-mnemonic.swift Create a BIP84 descriptor starting from a 12-word mnemonic.
7.public-descriptor-template.swift Create a public descriptor using descriptor templates.
8.transaction-details.swift Print transaction details for each transaction the wallet has completed.
9.private-descriptor-template.swift Create private and public descriptors using descriptor templates.
10.create-tx-from-raw-bytes.swift Create a Transaction object from raw bytes.
11.derive-custom-path.swift Create extended keys using custom derivation paths.
12.basic-transaction.swift Create a basic transaction that pays to 1 recipient.



File Task
1.balance.py Query an Electrum server for the balance of a wallet.
2.blockinfo.py Query an Electrum server for the testnet blockchain height and latest block hash.
3.getaddress.py Get new addresses from a wallet.

bitcoindevkit-scripts's People

Contributors

thunderbiscuit avatar geigerzaehler242 avatar vnprc avatar reez avatar wilfredallyn avatar romanz 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.