Skip to main content

This library provides a Python interface for building BitcoinSV scripts and transactions.

Project description

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))

Project details


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.9.0.tar.gz (477.3 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.9.0-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded PyPymanylinux: glibc 2.17+ x86-64

tx_engine-0.9.0-cp315-cp315t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.15tmanylinux: glibc 2.17+ x86-64

tx_engine-0.9.0-cp315-cp315-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.15manylinux: glibc 2.17+ x86-64

tx_engine-0.9.0-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.17+ x86-64

tx_engine-0.9.0-cp314-cp314-win_amd64.whl (957.0 kB view details)

Uploaded CPython 3.14Windows x86-64

tx_engine-0.9.0-cp314-cp314-win32.whl (871.2 kB view details)

Uploaded CPython 3.14Windows x86

tx_engine-0.9.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.17+ x86-64

tx_engine-0.9.0-cp314-cp314-macosx_11_0_arm64.whl (1.0 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

tx_engine-0.9.0-cp314-cp314-macosx_10_12_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.14macOS 10.12+ x86-64

tx_engine-0.9.0-cp313-cp313-win_amd64.whl (957.1 kB view details)

Uploaded CPython 3.13Windows x86-64

tx_engine-0.9.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

tx_engine-0.9.0-cp313-cp313-macosx_11_0_arm64.whl (1.0 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

tx_engine-0.9.0-cp313-cp313-macosx_10_12_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.13macOS 10.12+ x86-64

tx_engine-0.9.0-cp312-cp312-win_amd64.whl (957.1 kB view details)

Uploaded CPython 3.12Windows x86-64

tx_engine-0.9.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

tx_engine-0.9.0-cp312-cp312-macosx_11_0_arm64.whl (1.0 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

tx_engine-0.9.0-cp312-cp312-macosx_10_12_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

tx_engine-0.9.0-cp311-cp311-win_amd64.whl (959.0 kB view details)

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

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

Uploaded CPython 3.11macOS 11.0+ ARM64

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

Uploaded CPython 3.11macOS 10.12+ x86-64

File details

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

File metadata

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

File hashes

Hashes for tx_engine-0.9.0.tar.gz
Algorithm Hash digest
SHA256 e4b5d87a439285cf662eff963f7437799d2c05a1ad01aa9600343f7ff872260a
MD5 b6536b32cb852aa382ca4f8aaf4844a8
BLAKE2b-256 360efbcb5f346bc3c04140560a4c0db6814025d34a44cad843116908353ec6e2

See more details on using hashes here.

File details

Details for the file tx_engine-0.9.0-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for tx_engine-0.9.0-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 94df06866d0eeb7741e7431d19c3d066410a4ff0064bc2d5ff95563b2c4dca23
MD5 b8a7be99b82803b7415cbfe049ef3021
BLAKE2b-256 65ec05f41bf5784bf125fc96af797d4d1bc453ad3b8429871e6aa5b04c0b8009

See more details on using hashes here.

File details

Details for the file tx_engine-0.9.0-cp315-cp315t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for tx_engine-0.9.0-cp315-cp315t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f9ab52095877d3f0923117eb3eed3a7174ead750c71037896b33ada52368245d
MD5 9289017e7abb14934f146096d0042ea4
BLAKE2b-256 cd37828d2af27db85dff650977383acfe2ed200104e2c2b87855d9e182558c7c

See more details on using hashes here.

File details

Details for the file tx_engine-0.9.0-cp315-cp315-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for tx_engine-0.9.0-cp315-cp315-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 469a82394bc281de701ca85cfd839b4e71db6bed318d8273484a0c863dab29cd
MD5 822a090e72a70dfa8491ef5922129b72
BLAKE2b-256 87028def0665516335b713f70f597dbac4ccdeae12c1e1c63b59763f50d45e95

See more details on using hashes here.

File details

Details for the file tx_engine-0.9.0-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for tx_engine-0.9.0-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 be338a57b5984ac133f0e8a2ff02002a9e420d9dbc8b89c7ea6caca026090d08
MD5 05f58d0f8fca1cba83e6da3e3d092088
BLAKE2b-256 1de1419d07f6c170e16441ec44a76be46295c7643e16b798362f49cddf4519de

See more details on using hashes here.

File details

Details for the file tx_engine-0.9.0-cp314-cp314-win_amd64.whl.

File metadata

File hashes

Hashes for tx_engine-0.9.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 e2bf8e1343bf43958ba9648f416aeb6dcabfa9c327bb7d848add36e173b1415e
MD5 b92611de0aec6692061eb3739a99cd51
BLAKE2b-256 e44e9b41f8b269e78c942bd92c55fa2c16a683b2d62ba9c4f4531f0631215d41

See more details on using hashes here.

File details

Details for the file tx_engine-0.9.0-cp314-cp314-win32.whl.

File metadata

  • Download URL: tx_engine-0.9.0-cp314-cp314-win32.whl
  • Upload date:
  • Size: 871.2 kB
  • Tags: CPython 3.14, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.14.1

File hashes

Hashes for tx_engine-0.9.0-cp314-cp314-win32.whl
Algorithm Hash digest
SHA256 6d72e9eeedc8dfa042952181e7f9168d8545c891c5b30e28dfdcf05f84a86939
MD5 03c33a27d6e863ef376c81f97c207cde
BLAKE2b-256 17c222a7780d4425329a0fa77886423053cf672bac234e3f43b239d4d9f65169

See more details on using hashes here.

File details

Details for the file tx_engine-0.9.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for tx_engine-0.9.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9356c63f003aca64d5c6eb32abc93b3d29044285787d2591676da3161051024b
MD5 da7175f1eee10a363d57ed51c18ff9fc
BLAKE2b-256 5f12323330564490a0b9577698307c3fbf59b85560182244326177296721339a

See more details on using hashes here.

File details

Details for the file tx_engine-0.9.0-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for tx_engine-0.9.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 346dfdbc244228aaa2956129c526fd82645ff5e76f90c6f1da88f7cb043d06d6
MD5 95109a1683403c7be3bee811217e0711
BLAKE2b-256 e22def7767b7ee5ab5984e8a20db643437c9a80a801b6b5b88058c27b92320f8

See more details on using hashes here.

File details

Details for the file tx_engine-0.9.0-cp314-cp314-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for tx_engine-0.9.0-cp314-cp314-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 037c7a3e366e20beb6158d88dd0c976b4f9019889dca33ac2072641185bae3af
MD5 eb910cdf015802405be422589ee92684
BLAKE2b-256 248ba3b47cfc74939b1784fae07afade3fe857eb5b0165736f99e72a6a2491a5

See more details on using hashes here.

File details

Details for the file tx_engine-0.9.0-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for tx_engine-0.9.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 a3f3ed07b04f15f89c1355eca4cde2b6db6fede1aaf48b9d3e5fc4c3778b0aea
MD5 3bb6d7b91c24933e6bb614f45a5a6134
BLAKE2b-256 7abd850bcaa978e8a9bbb477aa6b8b905df6cf91f278090e60bb70cc7b2e94d2

See more details on using hashes here.

File details

Details for the file tx_engine-0.9.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for tx_engine-0.9.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 21fec5885d314f525048e1d37c7ebdbbaa6c4aa156e4b755508de329e801937c
MD5 d4e4b2de70a540d118ae7ca297a7e987
BLAKE2b-256 cabd73c1437f674cb5b0a905a3bd3d498365482e1311c63bb0bab5946bfcf60a

See more details on using hashes here.

File details

Details for the file tx_engine-0.9.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for tx_engine-0.9.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 976f9f48dbbd60456a56c026bf82d8aced2380b97b710f7b259f8184942fa187
MD5 d2ae28b97a11c74ab606e00a44b0fa66
BLAKE2b-256 e48dbe871445023867d86219121c8215d2b8c81becf6a3d18763d438048d9e62

See more details on using hashes here.

File details

Details for the file tx_engine-0.9.0-cp313-cp313-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for tx_engine-0.9.0-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 af357d55eed12a259d2a6da523d8cd35909c5630f75d5de7481abd77222982b4
MD5 0fac4289419318035b828a6cdf58c005
BLAKE2b-256 cc883a666a3e4fd6a6bbf67f339af79f349a0147a1ecda6d77bda69af03d3e52

See more details on using hashes here.

File details

Details for the file tx_engine-0.9.0-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for tx_engine-0.9.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 0b29a3e9bbe8369b2e2ceb43eda3922f6c83331535cd493efc135fa01d1aecb9
MD5 f0f405d98313529a821d5de6fb4d7caa
BLAKE2b-256 7776abb43322a5d3cafeaa25067b11167d8c7d838ef9cd885e2edf0db06dbca5

See more details on using hashes here.

File details

Details for the file tx_engine-0.9.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for tx_engine-0.9.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e6cee53f3af1753aa7a903ce6adf670e4b9b62874174d7ad7005aa44c994a5d9
MD5 d2edd766f46d7de6deca839ecb5565da
BLAKE2b-256 ec9583882f538794addcac93aeb32d317c586ea2e2dee09f04871d85c2f9e479

See more details on using hashes here.

File details

Details for the file tx_engine-0.9.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for tx_engine-0.9.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 618284f180fa4c165337d3cb4ccecd5a61fcb3b714f911a424b024aa61babe87
MD5 eb00a05bfb8a8e1bad44d31d05c2b98e
BLAKE2b-256 4694a616228e083d9f9016ba31336b4b706504084f46bab01ab56530b87f89d6

See more details on using hashes here.

File details

Details for the file tx_engine-0.9.0-cp312-cp312-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for tx_engine-0.9.0-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 46a76d7d7e672225ad3fcef9579d45c532563f188bc2c3b34dbadfb620251c55
MD5 4878653fd02fbf9fa05ef0040449b165
BLAKE2b-256 e46b421bf5925b321ae6d7df752d4f15ac71822cbf38d7cd4fff91ad77db993d

See more details on using hashes here.

File details

Details for the file tx_engine-0.9.0-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for tx_engine-0.9.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 53d35d8903dee9fb193d72b7a40083153a5ed87e7a0b8cc9b5397373eecce64d
MD5 a1b29d475d577f577b8c02c7217e5c2f
BLAKE2b-256 a786a681b96e8a67f85a6dcdaff83f9bf197939c81740477f77fa3a6174fb335

See more details on using hashes here.

File details

Details for the file tx_engine-0.9.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for tx_engine-0.9.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8e4d56d5c9deedc19708cf49a5be3f4616b8bfb378bbee3b487c828e1eb99b0c
MD5 eeae95ecd291883309b13e6371cd9c6f
BLAKE2b-256 4aeeceb6d62ab451bc6af8b364bb0b155b3376cfacda92d0eaa084ac01af996f

See more details on using hashes here.

File details

Details for the file tx_engine-0.9.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for tx_engine-0.9.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9997b336c3cda3da6e98ca68d323ac73ee1a31d9caa372c1a19c0c4e2d83a59e
MD5 f4242d0cda83084110a76d7e429147ed
BLAKE2b-256 e0fbeb3ad23cb9223b9264fee0ffa20ba34025d143458773e4a91304ee3d2a87

See more details on using hashes here.

File details

Details for the file tx_engine-0.9.0-cp311-cp311-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for tx_engine-0.9.0-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 1da4cb4ae68a352adaff10d33b505edee08c128cd7819d49c148631dcd242114
MD5 94a18cef747f70db2bc36f3697627124
BLAKE2b-256 053acdd1352f067d6e0597f311899cc22109b5ac91400fac3996d405997bda3b

See more details on using hashes here.

Supported by

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