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.0.tar.gz (18.1 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.0-py3-none-any.whl (13.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: btcaaron-0.2.0.tar.gz
  • Upload date:
  • Size: 18.1 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.0.tar.gz
Algorithm Hash digest
SHA256 b0cd22c37184e9ad3493948cedbdd848df63cf11db893686e700dcb2e5daeb2a
MD5 1221e6e57cb0d8f04dc41ea9c98f2d14
BLAKE2b-256 eec0c786018f750d70c4676ebd1475b1e7b6e51d49405900817bcd750fe76e2c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: btcaaron-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 13.9 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2470d62db76ff6af149bf5572b194a5663ff01132b2e5167e59e5be4f88af8ce
MD5 beea65ce26296f359520eb6471834dff
BLAKE2b-256 e5a4d33b2925d3a894c44a56d01513ec7b48390aa0448d2414bc985210fbcf23

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