BRC-100 compliant Bitcoin SV wallet implementation
Project description
BSV BLOCKCHAIN | Wallet Toolbox for Python
๐ Cross-SDK Interoperability (v2.0.0)
BRC-100 compliance with cross-SDK interoperability. Compatible with TypeScript SDK and Go SDK (v2.0.0+). Compatible with wallet-toolbox v2.0.0+.
Installation:
pip install bsv-wallet-toolbox --preThe
--preflag is required because this package depends onbsv-sdk>=2.0.0b1(beta).
BRC-100 conforming wallet implementation providing production-ready, persistent storage components. Built on top of the official Python SDK, this toolbox helps you assemble scalable wallet-backed applications and services.
Table of Contents
- Objective
- Current Status
- Getting Started
- Features
- Architecture
- Compatibility
- Contribution Guidelines
- Support & Contacts
- License
Objective
The BSV Wallet Toolbox builds on the BSV SDK for Python and provides:
- Production-Ready Wallet: Full BRC-100 WalletInterface implementation with persistent storage
- Database Persistence: SQLAlchemy-based storage compatible with SQLite, PostgreSQL, and MySQL
- Cross-Language Compatibility: 100% compatible with TypeScript and Go implementations
- Universal Test Vectors: Validated against official BRC-100 test data
- SPV-Friendly Workflows: Privacy-preserving, scalable wallet operations
Current Status
Version: 2.0.0
| Metric | Status |
|---|---|
| Lint Critical Errors | โ 0 |
| Test Suite | โ 846 tests |
| Manual Tests | โ 29 tests |
| Reference Unification | โ 851 locations (TS/Go compliant) |
See CHANGELOG.md for detailed version history.
Getting Started
Prerequisites
- Python 3.11 or higher
- pip package manager
- SQLite (included with Python) or PostgreSQL/MySQL (optional)
Installation
From PyPI
pip install bsv-wallet-toolbox
From Source
git clone https://github.com/bsv-blockchain/py-wallet-toolbox.git
cd py-wallet-toolbox
python -m venv .venv
source .venv/bin/activate # Linux/Mac
# or .venv\Scripts\activate on Windows
pip install -e .[dev]
Quick Start
import asyncio
from bsv_wallet_toolbox import Wallet
async def main():
wallet = Wallet(chain="main") # or chain="test" for testnet
result = await wallet.get_version({})
print(f"Wallet version: {result['version']}")
if __name__ == "__main__":
asyncio.run(main())
Error Handling
from bsv_wallet_toolbox import Wallet, InvalidParameterError
async def example():
wallet = Wallet(chain="main")
try:
result = await wallet.get_version({}, originator="x" * 251)
except InvalidParameterError as e:
print(f"Error: {e}")
Features
Current Features
- โ BRC-100 compliant WalletInterface
- โ Full type hints with mypy strict mode
- โ Async/await with asyncio
- โ Cross-platform (Linux, macOS, Windows)
- โ pytest-based testing framework
Planned Features
- โณ 28 BRC-100 methods (full WalletInterface)
- โณ SQLAlchemy-based storage (SQLite/PostgreSQL/MySQL)
- โณ Pluggable service layer (ARC, ChainTracker, Overlay)
- โณ Storage synchronization
- โณ JSON-RPC server
Architecture
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Application Layer โ
โโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
BRC-100 WalletInterface
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Wallet Class โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ โข getVersion() โข createAction() โ โ
โ โ โข getNetwork() โข signAction() โ โ
โ โ โข ... 24 more methods โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ โ
โ โโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโ โ
โ โผ โผ โผ โ
โ โโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโ โ
โ โ Storage โ โ Services โ โ Monitor โ โ
โ โโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ โ
โผ โผ โผ
Database Blockchain Background
(SQLAlchemy) Services Tasks
Design Principles
- Framework Neutral: No web framework dependencies
- Async First: All I/O uses async/await
- Type Safe: Complete type hints for IDE support
- Test Driven: Universal Test Vectors + comprehensive tests
- Cross-Language Compatible: 100% compatible with TypeScript and Go
Compatibility
This Python implementation is 100% compatible with:
| Implementation | Repository | Status |
|---|---|---|
| TypeScript | wallet-toolbox | โ API compatible |
| Go | go-wallet-toolbox | โ API compatible |
All three implementations share:
- Same BRC-100 WalletInterface API (28 methods)
- Identical behavior and error handling
- Same database schema
- Universal Test Vectors validation
Contribution Guidelines
We welcome contributions! See CONTRIBUTING.md for detailed guidelines.
Quick Start for Contributors
# Setup
pip install -e .[dev]
# Run tests
pytest tests/ -v
# Quality checks
black src/ tests/
ruff check src/ tests/
mypy src/
Important Notes
- Reference the TypeScript implementation when porting features
- All methods must pass official BRC-100 test vectors
- All code must pass mypy strict mode
- All docstrings and comments must be in English
Support & Contacts
Project Owners: Thomas Giacomo and Darren Kellenschwiler
For questions, bug reports, or feature requests:
- Open an issue on GitHub
Documentation
License
The license for the code in this repository is the Open BSV License version 4. See license.md for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bsv_wallet_toolbox-2.0.0.tar.gz.
File metadata
- Download URL: bsv_wallet_toolbox-2.0.0.tar.gz
- Upload date:
- Size: 981.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
94e16914789a120a1906d69297c794c14ce1e4e1a1a7d531a463a88b4f1a7e37
|
|
| MD5 |
6f14aa398f0e678bdebeb1d89ca9dd58
|
|
| BLAKE2b-256 |
75f6bfce9a69dd0525c27f4b6ba09f37bc8d3d673106e70326a69aed30ddd065
|
Provenance
The following attestation bundles were made for bsv_wallet_toolbox-2.0.0.tar.gz:
Publisher:
workflow.yml on bsv-blockchain/py-wallet-toolbox
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bsv_wallet_toolbox-2.0.0.tar.gz -
Subject digest:
94e16914789a120a1906d69297c794c14ce1e4e1a1a7d531a463a88b4f1a7e37 - Sigstore transparency entry: 836345604
- Sigstore integration time:
-
Permalink:
bsv-blockchain/py-wallet-toolbox@fa7e6bc2f2d8316d585d654d493df63aec4ac430 -
Branch / Tag:
refs/tags/v2.0.0 - Owner: https://github.com/bsv-blockchain
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@fa7e6bc2f2d8316d585d654d493df63aec4ac430 -
Trigger Event:
push
-
Statement type:
File details
Details for the file bsv_wallet_toolbox-2.0.0-py3-none-any.whl.
File metadata
- Download URL: bsv_wallet_toolbox-2.0.0-py3-none-any.whl
- Upload date:
- Size: 458.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e5938a2b275e640e36dfc8768d9321d2ea8e019fe5b2bf42ea1b9c1c7808ce5d
|
|
| MD5 |
fe26324de7a019e2c41f6750b943415f
|
|
| BLAKE2b-256 |
5e92ed33517867b97a69aae1dc6defb677aea7b7d3746a0934be7fedee8eaf1f
|
Provenance
The following attestation bundles were made for bsv_wallet_toolbox-2.0.0-py3-none-any.whl:
Publisher:
workflow.yml on bsv-blockchain/py-wallet-toolbox
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bsv_wallet_toolbox-2.0.0-py3-none-any.whl -
Subject digest:
e5938a2b275e640e36dfc8768d9321d2ea8e019fe5b2bf42ea1b9c1c7808ce5d - Sigstore transparency entry: 836345611
- Sigstore integration time:
-
Permalink:
bsv-blockchain/py-wallet-toolbox@fa7e6bc2f2d8316d585d654d493df63aec4ac430 -
Branch / Tag:
refs/tags/v2.0.0 - Owner: https://github.com/bsv-blockchain
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@fa7e6bc2f2d8316d585d654d493df63aec4ac430 -
Trigger Event:
push
-
Statement type: