Skip to main content

TX Engine

Python interface for building Bitcoin SV scripts and transactions. The native core is the Rust chain-gang library.

Requires Python 3.11+. Install from PyPI:

pip install tx-engine

Documentation

Topic Link
Documentation index docs/README.md
Python class reference docs/Python-API.md
HD wallets (mnemonic, BIP-44) docs/BIP-32-Python.md
Chronicle (Python examples) docs/Chronicle-Python.md
Chronicle (full spec) docs/Chronicle.md
Local development python/README.md

Quick example

from tx_engine import Tx

src_tx = (
    "0100000001c7151ebaf14dbfe922bd90700a7580f6db7d5a1b898ce79cb9ce459e17f1290900000000"
    "6b4830450221008b001e8d8110804ac66e467cd2452f468cba4a2a1d90d59679fe5075d24e5f530220"
    "6eb04e79214c09913fad1e3c0c2498be7f457ed63323ac6f2d9a38d53586a58d41210395deb00349c0ae7"
    "3412a55bec70a7793fc6860a193d29dd61d73c6271ffcbd4cffffffff0103000000000000001976a914"
    "96795fb99fd6c0f214f7a0e96019f642225f52d288ac00000000"
)

tx = Tx.parse_hexstr(src_tx)
print(tx)

Chronicle upgrade

Bitcoin SV Chronicle is supported in both the Rust library and Python bindings. Guide: docs/Chronicle-Python.md.

Chronicle script rules apply when tx.version > 1. Use version: 2 (or higher) on spending transactions to opt in.

Check Python API
Version-only (offline / mempool-style) Tx.validate(utxos)
Consensus at a known block height Tx.validate_at_height(utxos, block_height, network)network is BSV_Mainnet, BSV_Testnet, or BSV_STN
Script debugger / partial eval Context(tx_version=2, lock_script=...)

See docs/Chronicle.md for sighash routing, opcodes, two-phase evaluation, malleability rules, and script number limits.

HD wallets

BIP-32 / BIP-39 / BIP-44 support via HdWallet and watch-only HdWatchWallet. Guide: docs/BIP-32-Python.md.

from tx_engine import HdWallet, bsv_coin_type

hd = HdWallet.from_mnemonic("BSV_Mainnet", "abandon abandon ... about")
print(hd.address_at_bip44(bsv_coin_type(), 0, True, 0))

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tx_engine-0.10.1.tar.gz (484.4 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

tx_engine-0.10.1-cp311-abi3-win_amd64.whl (983.9 kB view details)

Uploaded CPython 3.11+Windows x86-64

tx_engine-0.10.1-cp311-abi3-win32.whl (886.2 kB view details)

Uploaded CPython 3.11+Windows x86

tx_engine-0.10.1-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.11+manylinux: glibc 2.17+ x86-64

tx_engine-0.10.1-cp311-abi3-macosx_11_0_arm64.whl (1.0 MB view details)

Uploaded CPython 3.11+macOS 11.0+ ARM64

tx_engine-0.10.1-cp311-abi3-macosx_10_12_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.11+macOS 10.12+ x86-64

File details

Details for the file tx_engine-0.10.1.tar.gz.

File metadata

  • Download URL: tx_engine-0.10.1.tar.gz
  • Upload date:
  • Size: 484.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.14.1

File hashes

Hashes for tx_engine-0.10.1.tar.gz
Algorithm Hash digest
SHA256 059b5b22aa2a72cb016387854b77787ea1fa1e02d12b03a276d13f749b4a77fd
MD5 624b9335b8325fafce4d09e2c3a820e8
BLAKE2b-256 6ced850b1bbf0ac7916e887e94ca6fd82a75e8f02cdef01033121c79b5581487

See more details on using hashes here.

File details

Details for the file tx_engine-0.10.1-cp311-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for tx_engine-0.10.1-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 b75c67c61ea5cc8ea462af2e5956d1edfff9eefc2afb9e1222b0f47b49de77f2
MD5 773eb7652a354197631aeee9f168a562
BLAKE2b-256 6aa3985017b22cc923a1864cac3b8c5840f0aefda48cee5252cfb85d9a167a7c

See more details on using hashes here.

File details

Details for the file tx_engine-0.10.1-cp311-abi3-win32.whl.

File metadata

  • Download URL: tx_engine-0.10.1-cp311-abi3-win32.whl
  • Upload date:
  • Size: 886.2 kB
  • Tags: CPython 3.11+, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.14.1

File hashes

Hashes for tx_engine-0.10.1-cp311-abi3-win32.whl
Algorithm Hash digest
SHA256 6e14595fce2ffdf0142da89a3d76893f2180eb3b9ab9169effc8c06b242ce1cb
MD5 43bfa26893652abda149863817cd7bf0
BLAKE2b-256 9c940fb9e44128f0f48b1be608082cf25bf42d1b812861388ef6505ccd7583e1

See more details on using hashes here.

File details

Details for the file tx_engine-0.10.1-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for tx_engine-0.10.1-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e63cb77afe655e29d5cd2251080d43b8d7160f4d182423acb6ad614ee7644281
MD5 d30a872a337bd6816a5eabfb7ca1a3a9
BLAKE2b-256 c84bbe9b96505c3d37faa0f01512103e50a7cb355d2ffcc7e8c1992f0d5b84ea

See more details on using hashes here.

File details

Details for the file tx_engine-0.10.1-cp311-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for tx_engine-0.10.1-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6830a632c511bc96e9fd0a29a896e4ad903e5dfcf76e14e4bc5d3cac997ca00f
MD5 12fba9225aeaa65d598fc558050e36e2
BLAKE2b-256 c3c7b03757767efa85755524d367eb7e3e4739e9e942e505c4f9db14d6b926c2

See more details on using hashes here.

File details

Details for the file tx_engine-0.10.1-cp311-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for tx_engine-0.10.1-cp311-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 d09557f4ecbb87d355316d453aabc995a2b4240a6cebef1e8b1349620954a3e2
MD5 b25adcdcbb53de14850c0be4b1e95b9a
BLAKE2b-256 9e7dd484e5632af1675b1d0adf5b4b8dc2b0e9aa6392978390c2e78f9201858f

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.10.1 This release

6 files

0.10.0

6 files

0.9.1

6 files

0.9.0

22 files

0.8.0

19 files

0.7.6

19 files

0.7.5

19 files

0.7.4

19 files

0.7.3

17 files

0.7.2

17 files

0.7.1

16 files

0.7.0

16 files

0.6.15

14 files

0.6.8

63 files

0.6.7

65 files

0.6.6

65 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page