Skip to main content

A Bitcoin Testnet transaction toolkit supporting Legacy, SegWit, and Taproot

Project description

btcaaronbtcaaron mark

A pragmatic Bitcoin toolkit with a clear path toward full Taproot engineering.

Designed for reproducible testnet experiments, educational workflows, and script-path development.

Current Status

v0.1.2 — Stable foundation release.
Core utilities actively used in my Taproot engineering work and on-chain experiments.

v0.2.0 — Core Taproot spend-path prototype implemented and testnet-verified.
All 5 spend paths working with real transactions. Next: hardening, PSBT support, and comprehensive documentation. See DESIGN.md for roadmap.

Features

Available Now (v0.1.x)

Production-tested on testnet with real transactions:

  • Generate Legacy / SegWit / Taproot addresses from WIF
  • UTXO scanning and balance lookup via public APIs
  • Build and sign standard transactions
  • Broadcast to Blockstream / Mempool endpoints
  • Developer helpers (WIFKey, quick_transfer)

Available Now (v0.2.0 - Prototype)

Testnet-verified with real transactions (23 tests, all passing):

  • Declarative Taproot tree builder (.hashlock(), .multisig(), .timelock(), .checksig())
  • Script-path and key-path spend constructors
  • Automatic witness construction and signature ordering
  • All 5 spend paths verified: hashlock, multisig, checksig, CSV timelock, keypath
  • Real transaction TXID reproduction tests

Future (v0.3.x+)

  • PSBT v2 support (Taproot-aware)
  • Custom script templates
  • Multi-input/output transactions

Requirements

  • Python >= 3.7
  • Dependencies: requests>=2.25.0, bitcoin-utils>=0.7.1

Installation

pip install btcaaron

Or from source:

git clone https://github.com/aaron-recompile/btcaaron.git
cd btcaaron
pip install .

Quick Start

from btcaaron import WIFKey, quick_transfer

wif = "your_testnet_wif"

key = WIFKey(wif)
print("Taproot:", key.get_taproot().address)

balance = key.get_taproot().get_balance()
print("Balance:", balance, "sats")

if balance > 1000:
    txid = quick_transfer(wif, "taproot", "tb1q...", amount=500, fee=300)
    print("Broadcasted:", txid)

v0.2.0 API Example

Taproot-native API — core features available now.

from btcaaron import Key, TapTree

alice = Key.from_wif("cRxebG...")
bob = Key.from_wif("cSNdLF...")

program = (TapTree(internal_key=alice)
    .hashlock("secret", label="hash")
    .multisig(2, [alice, bob], label="2of2")
    .timelock(blocks=144, then=bob, label="csv")
    .checksig(bob, label="backup")
).build()

print(program.address)  # tb1p...

tx = (program.spend("hash")
    .from_utxo("abc123...", 0, sats=1200)
    .to("tb1p...", 666)
    .unlock(preimage="secret")
    .build())

tx.broadcast()

Full specification in DESIGN.md.

Testing

Run the test suite:

python -m pytest tests/

Run specific test suites:

# v0.2.0 comprehensive tests (pytest)
python -m pytest tests/test_btcaaron_v0.2.py -v

# v0.1.x example-based tests
python tests/test_btcaaron_v0.1.py

Project Structure

btcaaron/
├── btcaaron/         # Core library
├── tests/            # Test suite
├── DESIGN.md         # Architecture & roadmap
├── README.md
├── setup.py
└── LICENSE

Development

See DESIGN.md for architecture details and development roadmap.

Notes

  • Testnet Only: This toolkit is designed for testnet use. Mainnet support may be added in future versions.
  • v0.2.0 Status: Core Taproot spend-path flows are implemented and testnet-verified; ongoing work focuses on hardening, PSBT, and documentation.

Author

Aaron Zhang
Reproducible Taproot experiments · Script engineering · Educational tooling
https://x.com/aaron_recompile

License

MIT License

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

btcaaron-0.2.1.tar.gz (33.2 kB view details)

Uploaded Source

Built Distribution

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

btcaaron-0.2.1-py3-none-any.whl (31.6 kB view details)

Uploaded Python 3

File details

Details for the file btcaaron-0.2.1.tar.gz.

File metadata

  • Download URL: btcaaron-0.2.1.tar.gz
  • Upload date:
  • Size: 33.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for btcaaron-0.2.1.tar.gz
Algorithm Hash digest
SHA256 06b3e09f92d0a8d8a4da109318f55224ed44b5a6a6c330a1bc258a4b45831da0
MD5 e63c0a740531cbd906455a5add694f73
BLAKE2b-256 c02af705db011025b01b8d5bafbb2c2f0043f691892340a575a9d186c70d88c6

See more details on using hashes here.

File details

Details for the file btcaaron-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: btcaaron-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 31.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for btcaaron-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b1ab9c98a7e10b77f111b25904235fec293c64b02a0a0fb9b083d32900fc23f8
MD5 7cd72b54024ab5916e5cf9fc76cd9ce6
BLAKE2b-256 31f37e5e288cfe50ecf8407e893f03d694238b47da99cd269049b836491ace78

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