Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
167 commits
Select commit Hold shift + click to select a range
3c3dc6d
test commit for develop branch
jo7ueb Aug 13, 2025
be2d032
chore: refactor imports & test tweaks before cert port
Aug 16, 2025
03983c2
feat(auth): add certificate module initial port
Aug 16, 2025
5746bf1
feat(auth): add certificate module initial port
Aug 16, 2025
db5b5f0
feat(auth): add certificate related modules (auth_message, cert_encry…
Aug 16, 2025
9fdd6b1
chore(keys): sync with upstream master version
Aug 16, 2025
d8e65d4
merge: resolve conflict in __init__.py, keep minimal initializer and …
Aug 16, 2025
c5d8ee1
Merge pull request #78 from bsv-blockchain/feature/auth/certificates-…
voyager1708 Aug 16, 2025
a7d758f
feat(certificates): add authhttp client, certificate utils and crypto…
Aug 19, 2025
fc1958b
refactor(auth): update authhttp client and utils
Aug 19, 2025
a10f65e
feat(primitives): add Encrypt-then-MAC helpers (aes_cbc_encrypt_mac /…
Aug 19, 2025
4a1fdb8
Update imports to absolute package paths. Refactor for clarity
Aug 20, 2025
f554350
feat(auth): concurrent sessions, handshake, cert request/response; wa…
Aug 20, 2025
3d088f8
Merge pull request #81 from voyager1708/feature/auth/certificates-port
voyager1708 Aug 20, 2025
df60380
Refactor SimplifiedHTTPTransport: improve error handling and payload …
Aug 20, 2025
484144f
Merge pull request #82 from voyager1708/feature/auth/certificates-port
voyager1708 Aug 20, 2025
5c64b00
fix(utils): Update utils module with latest changes and absolute imports
Aug 22, 2025
0998ea6
Merge pull request #83 from voyager1708/feature/auth/certificates-port
voyager1708 Aug 22, 2025
fed14eb
feat(auth/clients): Add and update client modules under auth/clients
Aug 22, 2025
408c402
Merge pull request #84 from voyager1708/feature/auth/certificates-port
voyager1708 Aug 22, 2025
f976fff
feat(auth/transports): Add and update modules under auth/transports
Aug 22, 2025
37691fb
Merge pull request #85 from voyager1708/feature/auth/certificates-port
voyager1708 Aug 22, 2025
383cc1c
chore(auth): Translate Japanese comments and docstrings to English in…
Aug 22, 2025
0004fff
refactor: rename broadcaster modules, add compatibility re-export, an…
Aug 22, 2025
59bd409
Merge pull request #86 from voyager1708/feature/auth/certificates-port
voyager1708 Aug 22, 2025
1d2038c
refactor(chaintrackers): update imports to absolute paths and clean u…
Aug 22, 2025
33e39cb
Merge pull request #87 from voyager1708/feature/auth/certificates-port
voyager1708 Aug 22, 2025
9159928
chore(registry): translate comments to English and clean up code
Aug 22, 2025
c9c7e1a
Merge pull request #88 from voyager1708/feature/auth/certificates-port
voyager1708 Aug 22, 2025
a51e21f
chore(identity): add and update identity module files
Aug 22, 2025
2cbd2e8
Merge pull request #89 from voyager1708/feature/auth/certificates-port
voyager1708 Aug 22, 2025
7f8baf6
chore(keystore): add and update keystore module files
Aug 22, 2025
d0c6084
Merge pull request #90 from voyager1708/feature/auth/certificates-port
voyager1708 Aug 22, 2025
00ba6f7
chore(auth): add and update auth module files
Aug 22, 2025
ce73fb1
Merge pull request #91 from voyager1708/feature/auth/certificates-port
voyager1708 Aug 22, 2025
1c5c815
chore(storage): add and update storage module files
Aug 22, 2025
5cdeee6
Merge pull request #92 from voyager1708/feature/auth/certificates-port
voyager1708 Aug 22, 2025
805801c
chore(script): add or update spend.py
Aug 22, 2025
0b96ded
refactor(transaction): reduce cognitive complexity, deduplicate liter…
Aug 22, 2025
672d287
chore(wallet): add and update wallet module files
Aug 22, 2025
7cf5728
Merge pull request #93 from voyager1708/feature/auth/certificates-port
voyager1708 Aug 22, 2025
6687eb9
refactor(broadcasters): unify broadcaster_core and broadcaster_plugin…
Aug 22, 2025
32d7f74
chore(chaintrackers): update and maintain chaintrackers module files
Aug 22, 2025
cc82109
chore(wallet): update wallet_impl.py for broadcaster import unificati…
Aug 22, 2025
85541ee
chore(registry): update and maintain registry module files
Aug 22, 2025
0339313
chore(overlay): update and maintain overlay module files
Aug 22, 2025
086aee8
fix(broadcasters): import WhatsOnChainBroadcaster for default_broadca…
Aug 22, 2025
aac5fff
Merge pull request #94 from voyager1708/feature/auth/certificates-port
voyager1708 Aug 22, 2025
f0b9f31
refactor: reorganize broadcaster modules and fix circular imports
Aug 23, 2025
3c380db
Merge pull request #95 from voyager1708/feature/auth/certificates-port
voyager1708 Aug 23, 2025
35668c4
Refactor bsv: ensure unique context/basket and local output usage
Aug 28, 2025
c43010d
Merge pull request #96 from voyager1708/feature/auth/certificates-port
voyager1708 Aug 28, 2025
6277364
Script class enhancement and core classes type safety - Add from_byte…
Aug 28, 2025
6f974cd
Merge pull request #97 from voyager1708/feature/auth/certificates-port
voyager1708 Aug 29, 2025
06dc96a
feat: Enhance Script type safety - replace bytes with Script objects
Aug 29, 2025
eb0f066
Merge pull request #98 from voyager1708/feature/auth/certificates-port
voyager1708 Aug 29, 2025
98c2a51
Merge pull request #102 from voyager1708/feature/auth/certificates-port
voyager1708 Oct 9, 2025
ed793ff
Refactor `WalletInterface` to use `Protocol` for type safety and add …
ALiberalVoluntarist Oct 15, 2025
883b368
Enhance `WalletInterface` implementation, add cryptographic utilities…
ALiberalVoluntarist Oct 15, 2025
c6a4259
Merge pull request #103 from bsv-blockchain/feature/middleware_feedback
ALiberalVoluntarist Oct 15, 2025
15f923e
Refactor auth message constants for better maintainability
defiant1708 Oct 20, 2025
a0a7009
Merge pull request #105 from voyager1708/feature/auth/certificates-port
voyager1708 Oct 20, 2025
306c0f6
chore(auth): remove backup file bsv/auth/peer.py.bak
defiant1708 Oct 20, 2025
0118da6
Merge pull request #107 from voyager1708/remove-peer-py-bak
voyager1708 Oct 20, 2025
e7d25d7
Add unit tests and vector generation for WOC, auth, and certificates
defiant1708 Oct 20, 2025
64527f9
Merge branch 'develop-port' of https://github.com/bsv-blockchain/py-s…
defiant1708 Oct 20, 2025
7c9961c
test: restore classic test suite at project root (21 files)
defiant1708 Oct 20, 2025
78029ce
Merge pull request #110 from voyager1708/restore-tests-and-peer-bak
voyager1708 Oct 20, 2025
2a69ffe
chore(tests): reflect server tests folder as source of truth (#116)
voyager1708 Oct 30, 2025
a944eb8
Refactor `WalletInterface` and cryptographic utilities for BRC-100 co…
ALiberalVoluntarist Nov 4, 2025
8de3230
fix incompatible protocol name length (#111)
jo7ueb Nov 6, 2025
bbf246c
add abstract method current_height which is present in ts-sdk, but no…
jo7ueb Nov 6, 2025
ac4aa32
Fixed 12/13 failing tests
F1r3Hydr4nt Nov 11, 2025
9885884
Fixed the serialisation bug
F1r3Hydr4nt Nov 11, 2025
2ba2a58
Increased pass rate with some bug fixes and test changes. Removed war…
F1r3Hydr4nt Nov 12, 2025
954b0a6
Added scripts and test-manual-review.md (not to be regenerated)
F1r3Hydr4nt Nov 12, 2025
03ec64b
CounterpartyType fixes + current working script
F1r3Hydr4nt Nov 12, 2025
01a7bb8
Revert incorrect CounterpartyType changes in test_pushdrop_parity.py
F1r3Hydr4nt Nov 12, 2025
a81a404
Manual script working correctly
F1r3Hydr4nt Nov 12, 2025
79a4ab9
Saving 20 odd reviews
F1r3Hydr4nt Nov 12, 2025
8a2d774
Develop port (#117)
voyager1708 Nov 12, 2025
f50fe51
Add utility and builder methods to Beef class
voyager1708 Nov 12, 2025
2b4c10f
Develop port (#119)
voyager1708 Nov 12, 2025
7c70076
Develop port (#120)
voyager1708 Nov 13, 2025
d4e83f2
Develop port (#121)
voyager1708 Nov 13, 2025
425ce3c
Develop port (#122)
voyager1708 Nov 13, 2025
3a378a4
201 test reviewed!
F1r3Hydr4nt Nov 12, 2025
20b1185
209
F1r3Hydr4nt Nov 12, 2025
82554dc
356
F1r3Hydr4nt Nov 13, 2025
3f5d3fa
Review complete, isolating failures next
F1r3Hydr4nt Nov 13, 2025
7216276
52 isolated
F1r3Hydr4nt Nov 13, 2025
31cfa53
Improved testing
F1r3Hydr4nt Nov 13, 2025
f79451a
15 left
F1r3Hydr4nt Nov 13, 2025
43a8424
Fixing tests
F1r3Hydr4nt Nov 13, 2025
e0526f8
Isolated new test for manual review
F1r3Hydr4nt Nov 13, 2025
03e52a6
Improved precision of tests
F1r3Hydr4nt Nov 14, 2025
fcc88cf
Added coverage report and pytest-cov
F1r3Hydr4nt Nov 17, 2025
dae9613
Added missing TS features via Test Driven Development
F1r3Hydr4nt Nov 17, 2025
27c8ecb
Implemented missing features from Go & addressed Github issues
F1r3Hydr4nt Nov 17, 2025
5c00984
Improved test precision
F1r3Hydr4nt Nov 17, 2025
1dbfc57
Added SHIP BRoadcaster and LookupResolver
F1r3Hydr4nt Nov 17, 2025
51df9e7
Removed ecdsa
F1r3Hydr4nt Nov 17, 2025
71b862e
Improved interpreter testing
F1r3Hydr4nt Nov 17, 2025
6b62985
Added missing tests and kvstore beef functions
F1r3Hydr4nt Nov 17, 2025
9110c9c
Develop port (#123)
voyager1708 Nov 17, 2025
dccde00
More tests!
F1r3Hydr4nt Nov 17, 2025
899ae19
968 tests passing
F1r3Hydr4nt Nov 18, 2025
097c703
Interpreter tests parity with Go
F1r3Hydr4nt Nov 18, 2025
40a57cc
973 tests passing, improvements
F1r3Hydr4nt Nov 18, 2025
5d1727b
78% coverage
F1r3Hydr4nt Nov 18, 2025
154fada
Added auto-cov tests and results to README & github-actions
F1r3Hydr4nt Nov 19, 2025
f15e62e
Added many test files for coverage, perhaps too many?
F1r3Hydr4nt Nov 19, 2025
d84851e
Refactored opcode_dup to op_dup etc
F1r3Hydr4nt Nov 19, 2025
9a83c59
Addressed code duplication
F1r3Hydr4nt Nov 19, 2025
4ba3768
Addressing sonar-cube issues
F1r3Hydr4nt Nov 19, 2025
27f3e22
Fixing reliability issues
F1r3Hydr4nt Nov 20, 2025
d887a23
50% of the big refactor due to Sonar issues
F1r3Hydr4nt Nov 20, 2025
d4ba85d
Addressing sonar cube issues
F1r3Hydr4nt Nov 20, 2025
eb222f6
Fixes
F1r3Hydr4nt Nov 20, 2025
1c3fac2
Lets see issues down from 781?
F1r3Hydr4nt Nov 20, 2025
a0307e3
Added smore sonar fixes, attempting complex refactoring next
F1r3Hydr4nt Nov 21, 2025
04aff6a
Fixed breaking sonar issues
F1r3Hydr4nt Nov 21, 2025
31c97eb
No tests failing, breaking change finding next
F1r3Hydr4nt Nov 21, 2025
f6c231c
Fixed sonar crap
F1r3Hydr4nt Nov 21, 2025
ea066a8
Add CodeQL suppression comments for debug logging and test code
F1r3Hydr4nt Nov 21, 2025
64e0aeb
Potential fix for code scanning alert no. 14: Clear-text logging of s…
F1r3Hydr4nt Nov 21, 2025
f53850f
Potential fix for code scanning alert no. 17: Incomplete URL substrin…
F1r3Hydr4nt Nov 21, 2025
6fdcde0
Potential fix for code scanning alert no. 15: Clear-text logging of s…
F1r3Hydr4nt Nov 21, 2025
c592a35
Potential fix for code scanning alert no. 18: Incomplete URL substrin…
F1r3Hydr4nt Nov 21, 2025
31d8c9d
Potential fix for code scanning alert no. 19: Incomplete URL substrin…
F1r3Hydr4nt Nov 21, 2025
cd5af21
Potential fix for code scanning alert no. 20: Incomplete URL substrin…
F1r3Hydr4nt Nov 21, 2025
13602c4
Potential fix for code scanning alert no. 24: Information exposure th…
F1r3Hydr4nt Nov 21, 2025
3f8c3d1
Configure CodeQL to exclude test files from security checks
F1r3Hydr4nt Nov 21, 2025
449393e
Potential fix for code scanning alert no. 23: Information exposure th…
F1r3Hydr4nt Nov 21, 2025
7cb4981
Potential fix for code scanning alert no. 11: Clear-text logging of s…
F1r3Hydr4nt Nov 21, 2025
3122e0b
Remove custom CodeQL configuration to use default setup
F1r3Hydr4nt Nov 21, 2025
8887916
Fix CodeQL URL substring sanitization warnings in tests
F1r3Hydr4nt Nov 21, 2025
5c26cad
Potential fix for code scanning alert no. 26: Incomplete URL substrin…
F1r3Hydr4nt Nov 21, 2025
2806877
Fixed rebase
F1r3Hydr4nt Nov 21, 2025
39766f3
Merge master into develop-port
F1r3Hydr4nt Nov 21, 2025
55d7268
Replace time.sleep() with asyncio.sleep() in async test
F1r3Hydr4nt Nov 21, 2025
1737ceb
Fix EndBug/add-and-commit action reference
F1r3Hydr4nt Nov 21, 2025
1a0d5fc
Fix test failures after merge
F1r3Hydr4nt Nov 21, 2025
373ca93
Pin EndBug/add-and-commit to full commit SHA
F1r3Hydr4nt Nov 21, 2025
184c432
Correct hash 777a761e0f8293b7b051170404976d7cf10611cb
F1r3Hydr4nt Nov 21, 2025
aea9ffb
from unittest.mock import Mock
F1r3Hydr4nt Nov 21, 2025
23ebba9
import time
F1r3Hydr4nt Nov 21, 2025
93a98ca
The CI should now pass!
F1r3Hydr4nt Nov 21, 2025
7fd37d5
Addressing build failures
F1r3Hydr4nt Nov 21, 2025
8be2164
Ahhhhhhhhhhhh
F1r3Hydr4nt Nov 21, 2025
0a1d9d8
All tests pass with zero warnings:
F1r3Hydr4nt Nov 21, 2025
69651ed
Breaking changes report!
F1r3Hydr4nt Nov 21, 2025
6d67096
Saved contradiction
F1r3Hydr4nt Nov 21, 2025
29a8599
Fixing failure
F1r3Hydr4nt Nov 21, 2025
1dbb780
Addressed High code reliability sonar cube issues
F1r3Hydr4nt Nov 25, 2025
7e7e0ba
Addressed 3 more High code reliability sonar cube issues
F1r3Hydr4nt Nov 25, 2025
1fbf89d
Addressed 1 more High code reliability sonar cube issues
F1r3Hydr4nt Nov 25, 2025
8e08c43
Merge master into develop-port: resolved conflicts in favor of develo…
F1r3Hydr4nt Nov 25, 2025
0b3ef52
Re-adding legacy tests
F1r3Hydr4nt Nov 25, 2025
7f64861
Removed legacy tests
F1r3Hydr4nt Nov 25, 2025
6acb5d9
Removing working files
F1r3Hydr4nt Nov 25, 2025
3eb98ea
Bumping version number
F1r3Hydr4nt Nov 25, 2025
dfc6d57
Merge master into develop-port, keeping develop-port versions
F1r3Hydr4nt Nov 25, 2025
6406e56
Keeping Kens new changes, all tests passing and reverting deletion of…
F1r3Hydr4nt Nov 25, 2025
cc7e823
Keeping Kens new changes, all tests passing and reverting deletion of…
F1r3Hydr4nt Nov 25, 2025
ff4df70
Ran linter, updated docs
F1r3Hydr4nt Nov 25, 2025
b4730f4
Export fix
F1r3Hydr4nt Nov 26, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 8 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Example environment variables for testing
# Copy this file to .env.local and fill in your actual values

# ARC Broadcaster API Key
ARC_API_KEY=your_api_key_here

# WhatsOnChain API Key for wallet tests
WOC_API_KEY=your_woc_api_key_here
25 changes: 22 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: build
permissions:
contents: read
contents: write

on:
push:
Expand Down Expand Up @@ -33,6 +33,25 @@ jobs:
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=140 --statistics
- name: Test with pytest
- name: Test with pytest and coverage
run: |
pytest
pytest --cov=bsv --cov-report=html --cov-report=term --cov-report=xml
- name: Extract coverage percentage
if: matrix.python-version == '3.11'
id: coverage
run: |
COVERAGE=$(python -c "import xml.etree.ElementTree as ET; root = ET.parse('coverage.xml').getroot(); print(f\"{float(root.attrib['line-rate'])*100:.1f}\")")
echo "coverage_percentage=$COVERAGE" >> $GITHUB_OUTPUT
- name: Update README with coverage
if: matrix.python-version == '3.11' && github.ref == 'refs/heads/master' && github.event_name == 'push'
run: |
python update_coverage.py ${{ steps.coverage.outputs.coverage_percentage }}
- name: Commit coverage update
if: matrix.python-version == '3.11' && github.ref == 'refs/heads/master' && github.event_name == 'push'
# Pin to specific commit SHA for security - v9.1.4
uses: EndBug/add-and-commit@777a761e0f8293b7b051170404976d7cf10611cb # v9.1.4
with:
add: README.md
message: "Update coverage badge to ${{ steps.coverage.outputs.coverage_percentage }}%"
author_name: github-actions[bot]
author_email: github-actions[bot]@users.noreply.github.com
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,10 @@ dist/
htmlcov/
.coverage
build/
.venv/
.wallet
.venv/

# Environment files
.env
.env.local
.env.*.local
Empty file added .test
Empty file.
41 changes: 27 additions & 14 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,38 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
- [0.1.0 - 2024-04-09](#010---2024-04-09)

---
## [Unreleased]
## [1.0.12] - 2025-11-25

### Added
- (Include new features or significant user-visible enhancements here.)
- Complete Wallet infrastructure with serializers, substrates, and implementations for full wallet functionality
- Authentication system including peer authentication, certificates, session management, and HTTP transport
- Enhanced BEEF infrastructure with dedicated builder, serializer, and validator modules for advanced transaction management
- Script interpreter with comprehensive opcode support, stack operations, and script execution engine
- Storage interfaces and implementations for data upload/download with encryption support
- Overlay tools including lookup resolver, SHIP broadcaster, historian, and host reputation tracker
- Registry client for overlay network management
- Identity client with contacts manager for identity and contact management
- Headers client for blockchain header synchronization
- Keystore with local key-value store implementation supporting encrypted storage
- Additional cryptographic primitives: Schnorr signatures, DRBG (Deterministic Random Bit Generator), AES-GCM encryption
- Compatibility modules for BSM (Bitcoin Signed Message) and ECIES encryption
- TOTP (Time-based One-Time Password) support for two-factor authentication
- BIP-276 payment destination encoding support
- PushDrop token protocol implementation
- Teranode broadcaster support

### Changed
- (Detail modifications that are non-breaking but relevant to the end-users.)
- Refactored `bsv/utils.py` monolithic module into organized submodules under `bsv/utils/` for better maintainability
- Enhanced broadcaster implementations with improved error handling and status categorization
- Updated chain trackers with block headers service integration
- Improved transaction handling with extended BEEF support and validation
- Reorganized entire test suite into `tests/bsv/` structure with comprehensive coverage tests (455 files changed, 74,468+ additions)

### Deprecated
- (List features that are in the process of being phased out or replaced.)

### Removed
- (Indicate features or capabilities that were taken out of the project.)

### Fixed
- (Document bugs that were fixed since the last release.)

### Security
- (Notify of any improvements related to security vulnerabilities or potential risks.)
### Notes
- **No breaking changes** - All existing APIs remain fully compatible
- Legacy tests continue to pass but have been superseded by new comprehensive test structure
- Test organization now follows a more modular and maintainable structure under `tests/bsv/`
- Added extensive test coverage across all modules ensuring code quality and reliability

---
## [1.0.11] - 2025-11-23
Expand Down
113 changes: 108 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
[![build](https://github.com/bitcoin-sv/py-sdk/actions/workflows/build.yml/badge.svg)](https://github.com/bitcoin-sv/py-sdk/actions/workflows/build.yml)
[![PyPI version](https://img.shields.io/pypi/v/bsv-sdk)](https://pypi.org/project/bsv-sdk)
[![Python versions](https://img.shields.io/pypi/pyversions/bsv-sdk)](https://pypi.org/project/bsv-sdk)
[![Coverage](https://img.shields.io/badge/coverage-85.7%25-green)](https://github.com/bitcoin-sv/py-sdk/actions/workflows/build.yml)


Welcome to the BSV Blockchain Libraries Project, the comprehensive Python SDK designed to provide an updated and unified layer for developing scalable applications on the BSV Blockchain. This SDK addresses the limitations of previous tools by offering a fresh, peer-to-peer approach, adhering to SPV, and ensuring privacy and scalability.
Expand All @@ -12,9 +13,10 @@ Welcome to the BSV Blockchain Libraries Project, the comprehensive Python SDK de
2. [Getting Started](#getting-started)
3. [Features & Deliverables](#features--deliverables)
4. [Documentation](#documentation)
5. [Tutorial](#Tutorial)
5. [Contribution Guidelines](#contribution-guidelines)
6. [Support & Contacts](#support--contacts)
5. [Testing & Quality](#testing--quality)
6. [Tutorial](#Tutorial)
7. [Contribution Guidelines](#contribution-guidelines)
8. [Support & Contacts](#support--contacts)

## Objective

Expand All @@ -33,6 +35,16 @@ pip package manager
pip install bsv-sdk
```

### Development Setup

For contributors and developers, install with test dependencies:

```bash
pip install -e .[test]
```

This installs the package in development mode along with all testing dependencies including pytest-cov for code coverage analysis.

### Basic Usage

```python
Expand Down Expand Up @@ -105,6 +117,59 @@ For a more detailed tutorial and advanced examples, check our [Documentation](#d
* Support for chain tracking and verification


### Wallet Infrastructure:

* Complete wallet implementation with BIP270 payment protocols
* Action serializers for creating, signing, and broadcasting transactions
* Substrate support for various wallet backends (HTTP, Wire protocol)
* Key derivation with caching for performance


### Authentication & Security:

* Peer-to-peer authentication with certificate management
* Session handling with automatic renewal
* Multiple transport protocols (HTTP, simplified transports)
* Encrypted communications with AES-GCM


### Script Interpreter:

* Full Bitcoin script execution engine
* Comprehensive opcode support (arithmetic, crypto, stack operations)
* Configurable script flags for different validation modes
* Thread-based execution for complex scripts


### Storage & Overlay Services:

* Upload/download interfaces with encryption support
* Overlay network tools (SHIP broadcaster, lookup resolver)
* Historian for tracking overlay data
* Host reputation tracking
* Registry client for overlay management


### Identity & Registry:

* Identity client with certificate management
* Contacts manager for identity relationships
* Registry services for overlay network coordination
* Headers client for blockchain synchronization


### Enhanced Cryptography & Protocols:

* Schnorr signatures for advanced signing schemes
* DRBG (Deterministic Random Bit Generator)
* BSM (Bitcoin Signed Message) compatibility
* ECIES encryption compatibility
* TOTP (Time-based One-Time Password) 2FA support
* BIP-276 payment destination encoding
* PushDrop token protocol implementation
* Teranode broadcaster support


## Documentation

Detailed documentation of the SDK with code examples can be found at [BSV Skills Center](https://docs.bsvblockchain.org/guides/sdks/py).
Expand All @@ -114,6 +179,32 @@ Detailed documentation of the SDK with code examples can be found at [BSV Skills
You can also refer to the [User Test Report](./docs/Py-SDK%20User%20Test%20Report.pdf) for insights and feedback provided by
[Yenpoint](https://yenpoint.jp/).

## Testing & Quality

This project maintains high code quality standards with comprehensive test coverage:

- **567+ tests** covering core functionality
- **85.7%+ code coverage** across the entire codebase
- Automated testing with GitHub Actions CI/CD

### Running Tests & Coverage

```bash
# Install test dependencies
pip install -e .[test]

# Run all tests
pytest

# Run tests with coverage analysis
pytest --cov=bsv --cov-report=html --cov-report=term

# View detailed coverage report
xdg-open htmlcov/index.html
```

We welcome contributions that improve test coverage, especially in currently under-tested areas.

## Beginner Tutorial
#### [Step-by-Step BSV Tutorial: Sending BSV and NFTs](./docs/beginner_tutorial.md)

Expand All @@ -125,9 +216,21 @@ We're always looking for contributors to help us improve the project. Whether it
contributions are welcome.

1. **Fork & Clone**: Fork this repository and clone it to your local machine.
2. **Set Up**: Run `pip install -r requirements.txt` to install all dependencies.
2. **Set Up**: Install in development mode with test dependencies:
```bash
pip install -e .[test]
```
3. **Make Changes**: Create a new branch and make your changes.
4. **Test**: Ensure all tests pass by running `pytest --cov=bsv --cov-report=html`.
4. **Test**: Ensure all tests pass and check code coverage:
```bash
# Run tests with coverage report
pytest --cov=bsv --cov-report=html --cov-report=term

# View detailed HTML coverage report
open htmlcov/index.html # or xdg-open htmlcov/index.html on Linux
```

Current target: 64%+ code coverage. Help us improve this by adding tests for uncovered areas!
5. **Commit**: Commit your changes and push to your fork.
6. **Pull Request**: Open a pull request from your fork to this repository.

Expand Down
59 changes: 44 additions & 15 deletions bsv/__init__.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,52 @@
from .broadcasters import *
from .broadcaster import *
from .chaintrackers import *
from .chaintracker import *
"""bsv Python SDK package initializer.

Provides backward-compatible exports while maintaining modular structure.
You can import commonly used classes directly:
from bsv import Transaction, PrivateKey, PublicKey
from bsv.auth.peer import Peer
"""

# Phase 1: Safe imports - constants, hash, curve (no dependencies)
from .constants import *
from .curve import *
from .fee_models import *
from .fee_model import *
from .script import *
from .hash import *
from .utils import *
from .transaction_preimage import *
from .curve import *

# Base58 encoding/decoding functions
from .base58 import base58check_encode, base58check_decode, b58_encode, b58_decode, to_base58check, from_base58check

# Step 2: HTTP client
from .http_client import HttpClient, default_http_client
from .keys import verify_signed_text, PublicKey, PrivateKey

# Step 3: Keys
from .keys import PrivateKey, PublicKey, verify_signed_text

# Step 4: Data structures
from .merkle_path import MerklePath, MerkleLeaf
from .transaction import Transaction, InsufficientFunds
from .transaction_input import TransactionInput
from .transaction_output import TransactionOutput
from .encrypted_message import *
from .signed_message import *
from .transaction_input import TransactionInput
from .transaction_output import TransactionOutput
from .transaction_preimage import *

# Step 5: Transaction
from .transaction import Transaction, InsufficientFunds

# Phase 3: Wildcard imports (one at a time, testing for circular imports)
# Step 6.1: broadcaster (base classes)
from .broadcaster import *
# Step 6.2: broadcasters (implementations)
from .broadcasters import *
# Step 6.3: chaintracker (base classes)
from .chaintracker import *
# Step 6.4: chaintrackers (implementations)
from .chaintrackers import *
# Step 6.5: fee_model (base classes)
from .fee_model import *
# Step 6.6: fee_models (implementations)
from .fee_models import *
# Step 6.7: script
from .script import *
# Step 6.8: utils
from .utils import *

__version__ = '1.0.11'
__version__ = '1.0.12'
9 changes: 9 additions & 0 deletions bsv/__init__.py.backup
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
"""bsv Python SDK package minimal initializer.

Avoid importing heavy submodules at package import time to prevent circular imports
and reduce side effects. Import submodules explicitly where needed, e.g.:
from bsv.keys import PrivateKey
from bsv.auth.peer import Peer
"""

__version__ = '1.0.10'
Loading
Loading