All Projects → karask → python-bitcoin-utils

karask / python-bitcoin-utils

Licence: MIT license
Library to interact with the Bitcoin network. Ideal for low-level learning and experimenting.

Programming Languages

python
139335 projects - #7 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to python-bitcoin-utils

Nt wrapper
A wrapper library around native windows sytem APIs
Stars: ✭ 287 (+85.16%)
Mutual labels:  low-level
Lowlevelprogramming University
How to be low-level programmer
Stars: ✭ 7,224 (+4560.65%)
Mutual labels:  low-level
Terminal Canvas
Manipulate the cursor in your terminal via high-performant, low-level, canvas-like API
Stars: ✭ 125 (-19.35%)
Mutual labels:  low-level
Z Engine
⚡️ PHP Engine Direct API
Stars: ✭ 362 (+133.55%)
Mutual labels:  low-level
System Bus Radio
Transmits AM radio on computers without radio transmitting hardware.
Stars: ✭ 5,831 (+3661.94%)
Mutual labels:  low-level
Tensorflow Sentiment Analysis On Amazon Reviews Data
Implementing different RNN models (LSTM,GRU) & Convolution models (Conv1D, Conv2D) on a subset of Amazon Reviews data with TensorFlow on Python 3. A sentiment analysis project.
Stars: ✭ 34 (-78.06%)
Mutual labels:  low-level
CSpydr
A static typed low-level compiled programming language inspired by Rust and C
Stars: ✭ 17 (-89.03%)
Mutual labels:  low-level
Graphics32
Graphics32 is a graphics library for Delphi and Lazarus. Optimized for 32-bit pixel formats, it provides fast operations with pixels and graphic primitives. In most cases Graphics32 considerably outperforms the standard TBitmap/TCanvas methods.
Stars: ✭ 238 (+53.55%)
Mutual labels:  low-level
Librg
🚀 Making multi-player gamedev simpler since 2017
Stars: ✭ 813 (+424.52%)
Mutual labels:  low-level
Phenomenon
⚡️ A fast 2kB low-level WebGL API.
Stars: ✭ 1,551 (+900.65%)
Mutual labels:  low-level
Flingos
An educational operating system written in C#. A great stepping stone from high to low level development.
Stars: ✭ 451 (+190.97%)
Mutual labels:  low-level
Gainput
Cross-platform C++ input library supporting gamepads, keyboard, mouse, touch
Stars: ✭ 636 (+310.32%)
Mutual labels:  low-level
Skr
Low level key re-programming
Stars: ✭ 47 (-69.68%)
Mutual labels:  low-level
Jemalloc.net
A native memory manager for .NET
Stars: ✭ 308 (+98.71%)
Mutual labels:  low-level
Asm
Assembly Tutorial for DOS
Stars: ✭ 125 (-19.35%)
Mutual labels:  low-level
LudOS
A toy monolithic kernel written in C++
Stars: ✭ 38 (-75.48%)
Mutual labels:  low-level
St Cgan
Dataset and Code for our CVPR'18 paper ST-CGAN: "Stacked Conditional Generative Adversarial Networks for Jointly Learning Shadow Detection and Shadow Removal"
Stars: ✭ 13 (-91.61%)
Mutual labels:  low-level
Libheatmap
High performance C heatmap generation library. Supposed to be wrapped by higher-level languages.
Stars: ✭ 241 (+55.48%)
Mutual labels:  low-level
Distormx
The ultimate hooking library
Stars: ✭ 146 (-5.81%)
Mutual labels:  low-level
Deko3d
Homebrew low level graphics API for Nintendo Switch (Nvidia Tegra X1)
Stars: ✭ 103 (-33.55%)
Mutual labels:  low-level

python-bitcoin-utils

This is a bitcoin library that provides tools/utilities to interact with the Bitcoin network. One of the primary goals of the library is to explain the low-level details of Bitcoin. The code is easy to read and properly documented explaining in detail all the thorny aspects of the implementation. It is a low-level library which assumes some high-level understanding of how Bitcoin works. In the future this might change.

This is an early version of the library (v0.5.9) and currently, it supports private/public keys, all type of addresses and creation of any transaction (incl. segwit) with all SIGHASH types. All script op codes are included. Timelock and non-standard transactions are supported. Currently, a simple node proxy exists to enable easy calls to a Bitcoin core node. Extra functionality will be added continuously and the documentation will be improved as the work progresses.

The API documentation can be build with Sphinx but is also available as a PDF for convenience. One can currently use the library for experimenting and learning the inner workings of Bitcoin. It is not meant for production yet and parts of the API might be updated with new versions.

Complementary to this library is a CC BY-SA 4.0 licensed Bitcoin programming book.

Installation

Python version 3 is required. Then just install with:

$ pip install bitcoin-utils

Examples

Keys and Addresses
https://github.com/karask/python-bitcoin-utils/blob/master/examples/keys_addresses.py - creates a private key which we use to derive a public key and in turn an address. We also use the private key to sign a message and then verify it using the public key.
Segwit Addresses
https://github.com/karask/python-bitcoin-utils/blob/master/examples/keys_segwit_addresses.py - creates P2WPKH, P2SH-P2WPKH, P2WSH and P2SH-P2WSH addresses.
Transaction with P2PKH input and outputs
https://github.com/karask/python-bitcoin-utils/blob/master/examples/p2pkh_transaction.py - creates a simple transaction with one input and two outputs.
Create a P2PKH Transaction with different SIGHASHes
https://github.com/karask/python-bitcoin-utils/blob/master/examples/multi_input_sighash_transaction.py - creates a 2-input 2-output transaction with different signature types.
Create a P2SH Address
https://github.com/karask/python-bitcoin-utils/blob/master/examples/send_to_p2sh_transaction.py - creates a P2SH address that corresponds to a P2PK redeem script and sends some funds to it.
Create (spent) a P2SH Transaction
https://github.com/karask/python-bitcoin-utils/blob/master/examples/spend_p2sh_transaction.py - creates a transaction that spends a P2SH output.
Create a non-standard tx
https://github.com/karask/python-bitcoin-utils/blob/master/examples/create_non_std_tx.py - sends funds to an address with a non-standard tx (script: OP_ADD OP_5 OP_EQUAL)
Spend a non-standard tx
https://github.com/karask/python-bitcoin-utils/blob/master/examples/spend_non_std_tx.py - spends funds from script OP_ADD OP_5 OP_EQUAL
Transaction to pay to a P2WPKH
http://github.com/karask/python-bitcoin-utils/blob/master/examples/send_to_p2wpkh_transaction.py - send coins from two P2PKH UTXOs to a native segwit address (P2WPKH)
Spend from a P2SH(P2WPKH) nested segwit address
http://github.com/karask/python-bitcoin-utils/blob/master/examples/spend_p2sh_p2wpkh_address.py - spend a P2WPKH that is nested into a P2SH for old client compatibility
Create a P2SH address with a relative timelock
https://github.com/karask/python-bitcoin-utils/blob/master/examples/create_p2sh_csv_p2pkh_address.py - creates a P2SH address that locks funds (sent to it) with a private key (P2PKH) and a relative locktime of 200 blocks in the future.
Spend from a timelocked address
https://github.com/karask/python-bitcoin-utils/blob/master/examples/spend_p2sh_csv_p2pkh.py - spends from a P2SH(CSV+P2PKH) address as created from above.
Use NodeProxy to make calls to a Bitcoin node
https://github.com/karask/python-bitcoin-utils/blob/master/examples/node_proxy.py - make Bitcoin command-line interface calls programmatically (NodeProxy wraps jsonrpc-requests library)

Please explore the codebase or the API documentation (BitcoinUtilities.pdf) for supported functionality and other options.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].