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.5
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.5.tar.gz | 525.0 kB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| tx_engine-0.11.5-cp311-abi3-win_amd64.whl | CPython 3.11 | abi3 | Windows x86-64 | Details |
| tx_engine-0.11.5-cp311-abi3-win32.whl | CPython 3.11 | abi3 | Windows x86-32 | Details |
| tx_engine-0.11.5-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.5-cp311-abi3-macosx_11_0_arm64.whl | CPython 3.11 | abi3 | macOS 11.0+ ARM64 | Details |
| tx_engine-0.11.5-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.5.tar.gz
| Download URL | tx_engine-0.11.5.tar.gz |
|---|---|
| Size | 525.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f0d6438c6a159881ce9179b14c0e70e643d82ee71a90684067e8e2283fd5f979
|
|
BLAKE2b-256 checksum How to use checksums |
9ac6b04d3907bf8c63a578b4a5bb14986207ea90b161dc3dd0c7025e5b557267
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / tx_engine-0.11.5-cp311-abi3-win_amd64.whl
| Download URL | tx_engine-0.11.5-cp311-abi3-win_amd64.whl |
|---|---|
| Size | 986.3 kB |
| Tags | CPython 3.11 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
6ca664619c46097e87dfa39c75cd23828e00bd0b04c81a28d125dc90ae3b21bb
|
|
BLAKE2b-256 checksum How to use checksums |
a471058fbe2600280b14188ef1a33cc51caed990bacd6175896aec608444c7f6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / tx_engine-0.11.5-cp311-abi3-win32.whl
| Download URL | tx_engine-0.11.5-cp311-abi3-win32.whl |
|---|---|
| Size | 893.1 kB |
| Tags | CPython 3.11 Windows x86-32 abi3 |
|
SHA-256 checksum How to use checksums |
b8c76726068cee5559a2d3bea204483ee34e56b99d1c182f235c6f773a74e94b
|
|
BLAKE2b-256 checksum How to use checksums |
db8d1b7dfe30b842c56973ac829fe7d0cda6a908a5cab5d11e365f487e517f76
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / tx_engine-0.11.5-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | tx_engine-0.11.5-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 |
7acea394097571325af60e159450b4f4f0b40645c1ce86d6bbc1483b38b928ed
|
|
BLAKE2b-256 checksum How to use checksums |
e9b4b83ceb9eba277a4dd8ad20687e91f5592e65c84b835c972a7e17ff68701b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / tx_engine-0.11.5-cp311-abi3-macosx_11_0_arm64.whl
| Download URL | tx_engine-0.11.5-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 |
a810db036fa767cc4ed509524290b04645016702214f04f8843f7615cbe0abde
|
|
BLAKE2b-256 checksum How to use checksums |
36c159bb256e15a1117e4e78858dcf79a1f86c22aed34c1aca916fbc915c93fa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / tx_engine-0.11.5-cp311-abi3-macosx_10_12_x86_64.whl
| Download URL | tx_engine-0.11.5-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 |
4e448bc56bdd39cc1ef200f8e87aa79bd748a0cac43e5c164b302d89915c531c
|
|
BLAKE2b-256 checksum How to use checksums |
cdfbc3b761bda62d03bdf57e702dc4fe54712c8ffb5a3cf1debac7f03cf63db3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|