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.0.tar.gz (479.8 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.0-cp311-abi3-win_amd64.whl (977.7 kB view details)

Uploaded CPython 3.11+Windows x86-64

tx_engine-0.10.0-cp311-abi3-win32.whl (882.7 kB view details)

Uploaded CPython 3.11+Windows x86

tx_engine-0.10.0-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.0-cp311-abi3-macosx_11_0_arm64.whl (1.0 MB view details)

Uploaded CPython 3.11+macOS 11.0+ ARM64

tx_engine-0.10.0-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.0.tar.gz.

File metadata

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

File hashes

Hashes for tx_engine-0.10.0.tar.gz
Algorithm Hash digest
SHA256 d2ba99c225079c2703b2435740d3f4c4da484e2723fd920ab0ceda88aa3ee3d2
MD5 0159214dc0da65658912e8cac1ca0341
BLAKE2b-256 1137ed29aff97a49b1e92ec216d10dc713c26d37f05ddb1048b26c8fc1d8d4a1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tx_engine-0.10.0-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 ca0deff76d0015f393c7a50ea256e50bec6ed553e0e4d15752819ef5ab878865
MD5 64a1619cc08348295d7b290bdbfa3081
BLAKE2b-256 cea4af5e903fd862d9a66c7374e8d54171d65c6311f327a72df9feca3e18fd6d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tx_engine-0.10.0-cp311-abi3-win32.whl
  • Upload date:
  • Size: 882.7 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.0-cp311-abi3-win32.whl
Algorithm Hash digest
SHA256 e543a86de2f8fd255cd137a4c1e156fe20853970514636fee1ab6ca3da9aa6c7
MD5 1c3446d2d1f79bb482bfc855ca94644c
BLAKE2b-256 bfeceacf67a6ce498ef5fb8736b79b0ec16b9ea7f0897284a62057297c5b19fb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tx_engine-0.10.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 47669389dc5a1592d59e467fc3d560654ac1420ad2d9301530582e9448ab391b
MD5 e80f47692f077cbf10698bb93b3dea8c
BLAKE2b-256 2a9c35e7bbc4d00bc1ed17499555509872a1831420b1b4924954ff2c377ac1c1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tx_engine-0.10.0-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2f0497a7a6fd44671399b70ba82602112bd813c3d256b6d981f2a6010381a6c8
MD5 f76419e727cc0bdc843345315ac1466c
BLAKE2b-256 31d552d5adba4ad4a5a8418674f62bfba5ed48c69046c39703b84150f3440c4b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tx_engine-0.10.0-cp311-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 6e2b5a84fc5f2da9d2acc4ae3ea1e4a323fbd2cce18fa8607d8de139267196ac
MD5 ef93fad25c72c786f016990366c5d4b6
BLAKE2b-256 4a6f07f5a41fe11f7ed8d37d4e47a828a05607e7d14d42e45c0da76118f212fe

See more details on using hashes here.

Release history Release notifications | RSS feed

0.10.1

6 files

This release

0.10.0 This release

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