Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
192 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
58bb6c9
Refactor: Remove unused `ctx` parameter across Wallet and Auth Peer i…
ALiberalVoluntarist Dec 5, 2025
5f1f791
Refactor `auth/master_certificate` for BRC-100 compliance and streaml…
ALiberalVoluntarist Dec 8, 2025
2904905
80% (#130)
F1r3Hydr4nt Dec 8, 2025
f452b1a
Fix indentation in `auth/master_certificate` argument definitions
ALiberalVoluntarist Dec 9, 2025
a74c38d
Merge remote-tracking branch 'origin/develop-port' into develop-port
ALiberalVoluntarist Dec 9, 2025
5abefda
Refactor nonce verification and HTTP transport logic for enhanced val…
ALiberalVoluntarist Dec 10, 2025
fd8b3d3
Rename `WalletImpl` to `ProtoWallet` for Go/TypeScript SDK parity
ALiberalVoluntarist Dec 10, 2025
2a225e0
Protwallet実装 Add `SymmetricKey` and AES-GCM encryption utilities for …
ALiberalVoluntarist Dec 10, 2025
d506697
Refactor `WalletImpl` methods to use TypedDict argument types for enh…
ALiberalVoluntarist Dec 10, 2025
61a7352
Improve cross-SDK parity and camelCase/snake_case support in `ProtoWa…
ALiberalVoluntarist Dec 11, 2025
453ba62
Align `counterparty` defaults and ciphertext handling with TS SDK beh…
ALiberalVoluntarist Dec 11, 2025
de42e58
Updated peer.py and tests!
F1r3Hydr4nt Dec 11, 2025
08a0a17
Linting errors otu
F1r3Hydr4nt Dec 11, 2025
385bac2
Refactor: Remove `ctx` parameter from `SimplifiedHTTPTransport.send` …
ALiberalVoluntarist Dec 11, 2025
79c3f54
Merge remote-tracking branch 'origin/develop-port' into develop-port
ALiberalVoluntarist Dec 11, 2025
b53f87c
More tests unskipped
F1r3Hydr4nt Dec 11, 2025
251af68
Refactor transaction parsing for improved error handling and data val…
ALiberalVoluntarist Dec 12, 2025
027abca
Merge remote-tracking branch 'origin/develop-port' into develop-port
ALiberalVoluntarist Dec 12, 2025
4ea9df3
Tests passing again
F1r3Hydr4nt Dec 12, 2025
e9770eb
106skipsremaining
F1r3Hydr4nt Dec 16, 2025
7fba470
82%
F1r3Hydr4nt Dec 16, 2025
ee4032e
Fixing lint error
F1r3Hydr4nt Dec 16, 2025
38f1846
Fixing reliability issues
F1r3Hydr4nt Dec 16, 2025
c741001
Fixed str indices error
F1r3Hydr4nt Dec 16, 2025
99023a4
Coverage issues
F1r3Hydr4nt Dec 16, 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
  •  
  •  
  •  
4 changes: 3 additions & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[run]
branch = True
source = src
source = bsv

[report]
exclude_lines =
Expand All @@ -11,3 +11,5 @@ ignore_errors = False
omit =
tests/*
setup.py
show_missing = True
skip_covered = False
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
27 changes: 24 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,27 @@ 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-branch --cov-report=html --cov-report=term --cov-report=xml
- name: Extract coverage percentage
if: matrix.python-version == '3.11'
id: coverage
run: |
LINE_COVERAGE=$(python -c "import xml.etree.ElementTree as ET; root = ET.parse('coverage.xml').getroot(); print(f\"{float(root.attrib['line-rate'])*100:.1f}\")")
BRANCH_COVERAGE=$(python -c "import xml.etree.ElementTree as ET; root = ET.parse('coverage.xml').getroot(); print(f\"{float(root.attrib['branch-rate'])*100:.1f}\")")
echo "line_coverage_percentage=$LINE_COVERAGE" >> $GITHUB_OUTPUT
echo "branch_coverage_percentage=$BRANCH_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.line_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.line_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
30 changes: 29 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ The BSV SDK is a comprehensive Python library for developing scalable applicatio
## Development Commands

### Installation

```bash
pip install -r requirements.txt
```

### Testing

```bash
# Run full test suite with coverage
pytest --cov=bsv --cov-report=html
Expand All @@ -31,6 +33,7 @@ pytest tests/bsv/auth/test_auth_peer_basic.py
```

### Building the Package

```bash
# Build distribution packages (requires python3 -m build)
make build
Expand All @@ -40,6 +43,7 @@ python3 -m build
```

### Publishing (Maintainers Only)

```bash
make upload_test # Upload to TestPyPI
make upload # Upload to PyPI
Expand All @@ -52,59 +56,71 @@ make upload # Upload to PyPI
The `bsv` package is organized into functional submodules:

- **Core Transaction Components** (`bsv/transaction.py`, `bsv/transaction_input.py`, `bsv/transaction_output.py`)

- `Transaction`: Main transaction class with serialization, signing, fee calculation, and broadcasting
- Supports BEEF (Bitcoin Encapsulated Format) and EF (Extended Format) serialization
- SPV validation through merkle paths

- **Script System** (`bsv/script/`)

- `ScriptTemplate`: Abstract base for locking/unlocking scripts
- Built-in templates: `P2PKH`, `P2PK`, `OpReturn`, `BareMultisig`, `RPuzzle`
- `Script`: Low-level script operations
- `Spend`: Script validation engine

- **Keys & Cryptography** (`bsv/keys.py`, `bsv/curve.py`, `bsv/hash.py`)

- `PrivateKey`, `PublicKey`: ECDSA key management
- Support for compressed/uncompressed keys
- WIF format support

- **HD Wallets** (`bsv/hd/`)

- Full BIP32/39/44 implementation
- Hierarchical deterministic key derivation
- Mnemonic phrase support (multiple languages via `hd/wordlist/`)

- **Authentication** (`bsv/auth/`)

- `Peer`: Central authentication protocol implementation
- `Certificate`: Certificate handling and verification
- `SessionManager`: Session lifecycle management
- `Transport`: Communication layer abstraction
- PKI-based authentication between peers

- **Wallet** (`bsv/wallet/`)

- `WalletInterface`: Abstract wallet interface
- `WalletImpl`: Full wallet implementation
- `ProtoWallet`: Core wallet implementation providing cryptographic operations (TS/Go parity)
- `WalletImpl`: Deprecated alias for ProtoWallet (backward compatibility)
- `KeyDeriver`: Protocol-based key derivation
- `CachedKeyDeriver`: Optimized key derivation with caching

- **Broadcasting** (`bsv/broadcasters/`)

- `Broadcaster`: Interface for transaction broadcasting
- `arc.py`: ARC broadcaster implementation
- `whatsonchain.py`: WhatsOnChain broadcaster
- `default_broadcaster.py`: Default broadcaster selection

- **Chain Tracking** (`bsv/chaintrackers/`)

- `ChainTracker`: Interface for chain state verification
- `whatsonchain.py`: WhatsOnChain chain tracker
- `default.py`: Default chain tracker

- **Storage** (`bsv/storage/`)

- `Uploader`, `Downloader`: File upload/download utilities
- Integration with blockchain storage

- **Keystore** (`bsv/keystore/`)

- Key persistence and retention management
- Local key-value store implementation

- **BEEF Support** (`bsv/beef/`)

- `build_beef_v2_from_raw_hexes`: BEEF format construction
- Transaction validation with merkle proofs

Expand All @@ -116,18 +132,21 @@ The `bsv` package is organized into functional submodules:
### Important Design Patterns

**Lazy Imports**: The `bsv/__init__.py` is intentionally minimal to avoid circular imports. Import specific modules where needed:

```python
from bsv.keys import PrivateKey
from bsv.transaction import Transaction
```

**Async Operations**: Transaction broadcasting and verification are async:

```python
await tx.broadcast()
await tx.verify(chaintracker)
```

**Template Pattern**: Script types use templates that provide `lock()` and `unlock()` methods:

```python
script_template = P2PKH()
locking_script = script_template.lock(address)
Expand All @@ -141,10 +160,12 @@ unlocking_template = script_template.unlock(private_key)
## Testing Structure

Tests are organized in two locations:

1. **Root-level tests** (`tests/`): Classic test structure with direct imports
2. **Nested tests** (`tests/bsv/`): Mirror the `bsv/` package structure

Test organization by feature:

- `tests/bsv/primitives/`: Core cryptographic primitives
- `tests/bsv/transaction/`: Transaction building and validation
- `tests/bsv/auth/`: Full authentication protocol test suite
Expand All @@ -153,6 +174,7 @@ Test organization by feature:
- `tests/bsv/broadcasters/`: Broadcaster integration tests

**Running single test**: Use standard pytest patterns:

```bash
pytest tests/bsv/auth/test_auth_peer_basic.py::test_function_name
pytest -k "test_pattern"
Expand All @@ -178,18 +200,21 @@ The SDK implements Assembly (ASM) representation of Bitcoin Script via `Script.f
**BRC-106 Standard**: https://github.com/bitcoin-sv/BRCs/blob/master/scripts/0106.md

Key requirements from BRC-106:

- Use full English names for op-codes (e.g., "OP_FALSE" not "OP_0")
- Output should always use the most human-readable format
- Multiple input names should parse to the same hex value
- Ensure deterministic translation across different SDKs (Py-SDK, TS-SDK, Go-SDK)

**Current Implementation** (bsv/script/script.py:140-191):

- `from_asm()`: Accepts both "OP_FALSE" and "OP_0", converts to b'\x00'
- `to_asm()`: Currently outputs "OP_0" for b'\x00' (see OPCODE_VALUE_NAME_DICT override at constants.py:343)

**Note**: The current `to_asm()` output may need adjustment to fully comply with BRC-106's human-readability requirement (should output "OP_FALSE" instead of "OP_0").

### Working with ASM

```python
# Parse ASM string to Script
script = Script.from_asm("OP_DUP OP_HASH160 abcd1234 OP_EQUALVERIFY OP_CHECKSIG")
Expand All @@ -214,6 +239,7 @@ for chunk in script.chunks:
## Common Patterns

### Creating and Broadcasting a Transaction

```python
priv_key = PrivateKey(wif_string)
source_tx = Transaction.from_hex(hex_string)
Expand All @@ -237,6 +263,7 @@ await tx.broadcast() # Broadcast to network
```

### Working with BEEF Format

```python
# Parse BEEF
tx = Transaction.from_beef(beef_hex)
Expand All @@ -246,6 +273,7 @@ beef_bytes = tx.to_beef()
```

### Script Templates

```python
# P2PKH
p2pkh = P2PKH()
Expand Down
7 changes: 5 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ contributors to adhere to.

2. **Commit Your Changes**: Make your changes and commit them. Commit messages should be clear and concise to explain what was done.

3. **Run Tests**: Ensure all tests pass using Jest: `pytest --cov=bsv --cov-report=html`.
3. **Run Tests**: Ensure all tests pass and check coverage: `pytest --cov=bsv --cov-branch --cov-report=html`.

4. **Documentation**: All code must be fully annotated with comments.

Expand All @@ -79,9 +79,12 @@ contributors to adhere to.

- **Documentation**: Update the documentation whenever you add or modify the code.

- **Testing**: We use Jest for all tests. Write comprehensive tests, ensuring edge cases are covered. All PRs should maintain or improve the
- **Testing**: We use pytest for all tests. Write comprehensive tests, ensuring edge cases are covered. All PRs should maintain or improve the
current test coverage.

- **Branch Coverage**: We measure both line and branch coverage. For critical modules (wallet, auth, crypto), aim for 70%+ branch coverage.
Include tests for both branches of conditional statements. Run `pytest --cov=bsv --cov-branch --cov-report=html` to check branch coverage.

## Contact & Support

If you have any questions or need assistance with your contributions, feel free to reach out. Remember, we're here to help each other grow
Expand Down
Loading
Loading