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))
Metadata
Release files for tx-engine 0.11.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| tx_engine-0.11.1.tar.gz | 504.5 kB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| tx_engine-0.11.1-cp311-abi3-win_amd64.whl | CPython 3.11 | abi3 | Windows x86-64 | Details |
| tx_engine-0.11.1-cp311-abi3-win32.whl | CPython 3.11 | abi3 | Windows x86-32 | Details |
| tx_engine-0.11.1-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.11 | abi3 | Linux glibc 2.17+ x86-64 | Details |
| tx_engine-0.11.1-cp311-abi3-macosx_11_0_arm64.whl | CPython 3.11 | abi3 | macOS 11.0+ ARM64 | Details |
| tx_engine-0.11.1-cp311-abi3-macosx_10_12_x86_64.whl | CPython 3.11 | abi3 | macOS 10.12+ x86-64 | Details |
Total release size: 5.6 MB
Release files / tx_engine-0.11.1.tar.gz
| Download URL | tx_engine-0.11.1.tar.gz |
|---|---|
| Size | 504.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
73e0b370e92209b042ec3ac2db51ea80736d7ccbfc127646aeda6ffb495d49a0
|
|
BLAKE2b-256 checksum How to use checksums |
c1bbb4571178cefcbe737c3f8704214d27434dd01509b478ac50e25d452c861f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / tx_engine-0.11.1-cp311-abi3-win_amd64.whl
| Download URL | tx_engine-0.11.1-cp311-abi3-win_amd64.whl |
|---|---|
| Size | 983.2 kB |
| Tags | CPython 3.11 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
87573215b86b25bc8f529b7425b31bc127beb0fb5e4632071dcbffdc51ef49b5
|
|
BLAKE2b-256 checksum How to use checksums |
7688b7ca653051791b3070fe8d328563f69643a416247aa179d64fe5668c313e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / tx_engine-0.11.1-cp311-abi3-win32.whl
| Download URL | tx_engine-0.11.1-cp311-abi3-win32.whl |
|---|---|
| Size | 889.8 kB |
| Tags | CPython 3.11 Windows x86-32 abi3 |
|
SHA-256 checksum How to use checksums |
425d8af965a175b3d31bbaad6b7fd90ed3b343f8f9d6cfc792bb65bca42c2f66
|
|
BLAKE2b-256 checksum How to use checksums |
a9084bc33cd908f1a85b2195120a173027b0bef3e0a5ce211c99c5caecb0af5b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / tx_engine-0.11.1-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | tx_engine-0.11.1-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
3b31ce2a3d4582685c8595ea08fae6a90ab1457d1aeb5631bd14312db9653739
|
|
BLAKE2b-256 checksum How to use checksums |
f58e2676eda0fe697dce5a723bb471e743c61984566c943cd7116315141e3143
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / tx_engine-0.11.1-cp311-abi3-macosx_11_0_arm64.whl
| Download URL | tx_engine-0.11.1-cp311-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 1.0 MB |
| Tags | CPython 3.11 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
9ed6c67156f2623f4c30f339167dcec85fdd9684c7bded19e81a3ff0f7df34be
|
|
BLAKE2b-256 checksum How to use checksums |
e2ddf9b9b26c8a88a87108923dbd84013db6986893f50b3bd1c401d4cb5883dc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / tx_engine-0.11.1-cp311-abi3-macosx_10_12_x86_64.whl
| Download URL | tx_engine-0.11.1-cp311-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.11 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
ba3a5c455bd5b9d6f6a7895c78fd553bbf1e262f1ecd5bfeba81c9b2eaddaf49
|
|
BLAKE2b-256 checksum How to use checksums |
d30968d6be67adf51a56f2b71c480ed2bf5fa6af062d44513521aee3bc4271ce
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|