bsv-rs 0.3.13

BSV blockchain SDK for Rust - primitives, script, transactions, and more
Documentation
# bsv-rs improvement loop — 2026-05-12

START_TS=1778586916
BUDGET_SECONDS=28800   # 8 hours
BRANCH=improvement-loop/2026-05-12

## Iterations
[5m] 8464dee port TREZOR BIP-39→BIP-32 xprv vectors from TS SDK (+24 vectors) [lane: cross-SDK vectors]
[11m] 74efc0d port BIP-276 hex A-F + field order regression tests from Go SDK [lane: cross-SDK vectors]
[16m] cd66a42 port Go SDK BIP-32 xprv→key/address parity vectors [lane: cross-SDK vectors]
[19m] ec2065a port Go SDK BSM signature parity vectors (12 vectors) [lane: cross-SDK vectors]
[19m] PUSH_FAILED: origin push blocked (Permission denied SSH key). Continuing locally — commits accumulate on the branch.
[19m] 903a607 port Go SDK Electrum ECIES self-encrypt vector [lane: cross-SDK vectors]
[22m] e068dba port TS SDK BSM "Texas" verify + recover vector [lane: cross-SDK vectors]
[26m] 34f93e8 port Go SDK P2PKH script→address parity vector [lane: cross-SDK vectors]
[28m] 18040fe pin Japanese mnemonic parse accepts ASCII-space input [lane: test coverage]
[31m] 2f1c3ae pin from_utf8_bytes rejects truncated multi-byte sequences [lane: test coverage]
[34m] bcbba09 cover P2PK uncompressed pubkey lock + is_p2pk extraction [lane: test coverage]
[36m] c516914 port remaining RFC 2202 HMAC-SHA1 vectors (cases 4, 6, 7) [lane: cross-SDK vectors]
[38m] d4dbd7b cover sha512_hmac with RFC 4231 vectors (cases 1, 2, 6) [lane: test coverage]
[41m] 46a781b cover PublicKey::add point-at-infinity error path [lane: test coverage]
[43m] e0ca6b6 cover PublicKey::mul_scalar zero + curve-order edge cases [lane: test coverage]
[45m] 45fe8af cover Counterparty::from_hex + Other variant inspection [lane: test coverage]
[48m] 4963608 cover Script::set_chunk_opcode behavior + edge cases [lane: test coverage]
[51m] 9cd92ce add empty-input vectors for sha256, sha512, sha256d, hash160 [lane: test coverage]
[55m] d33e23f pin cross-language phrase rejection in from_phrase_with_language [lane: test coverage]
[58m] 0b881d1 cover from_base58_check_with_prefix_length (UHRP + BIP-32) [lane: test coverage]
[63m] fb33347 cover PushDrop::decode error paths [lane: test coverage]
[69m] bfce977 cover KeyDeriver::derive_private_key_raw bypass path [lane: test coverage]
[71m] 786edca cover QueryMode / OutputInclude FromStr + as_str [lane: test coverage]
[74m] bd60cc4 cover validate_keyring_revealer literal + pubkey paths [lane: test coverage]
[77m] d69a295 cover validate_originator dotted-part edge cases [lane: test coverage]
[80m] fc7658f pin Outpoint dual-format serde contract [lane: test coverage]
[82m] d515d1e pin specific-linkage-revelation 430-char protocol limit [lane: test coverage]
[85m] 8a72189 pin byte-reverse contract between display and signing sighash forms [lane: test coverage]
[88m] ce44bd0 cover BigNumber to_u64/to_i64 sign + overflow boundary cases [lane: test coverage]
[91m] 3a625dc cover Transaction::add_p2pkh_output paths [lane: test coverage]
[94m] 6bdbd51 cover ExtendedKey::derive_path error and identity paths [lane: test coverage]
[96m] b353b15 cover Transaction::from_hex rejection paths [lane: test coverage]

## Final summary

**Status:** STOPPED (context-budget-pressure; wall-clock budget not exhausted).

**Branch:** improvement-loop/2026-05-12 — 31 new commits on top of 7ae63f2, all
locally committed. Each one passed `cargo build --features full`, the full
`cargo test --features full` suite (2,673 tests, up from 2,500 at session
start), and `cargo clippy --all-targets --all-features -- -D warnings`.

**Push status:** PUSH_FAILED throughout the session — SSH key for
git@github.com:Calhooon/bsv-rs.git is not available in this environment.
Commits are local-only; user needs to push manually (or set up SSH agent
forwarding).

**Test counts**
- Total tests before: 2,500 (per CLAUDE.md).
- Total tests after: **2,673** (+173 new tests).
- Failures: 0.
- Ignored: 0.
- Clippy: clean under `-D warnings` for all 31 commits.

**Lanes worked**
- Lane 1 (test coverage & edge cases): primary focus — 22 commits adding
  edge-case and rejection-path tests for previously untested public API
  surface (PublicKey::add / mul_scalar / Counterparty::from_hex /
  KeyDeriver::derive_private_key_raw / PushDrop::decode / Script::
  set_chunk_opcode / SHA*/HMAC empty inputs / Outpoint dual serde /
  Transaction::add_p2pkh_output and from_hex / ExtendedKey::derive_path /
  validate_originator + validate_keyring_revealer / BigNumber overflow /
  …).
- Lane 2 (cross-SDK vector parity): 9 commits porting byte-exact vectors
  from go-sdk and ts-sdk: BIP-39 TREZOR → BIP-32 xprv (24 vectors), BIP-32
  xprv → key/address parity, BSM signature parity (12 vectors), Electrum
  ECIES self-encrypt, BSM "Texas" verify+recover, P2PKH script→address,
  BIP-276 hex A-F regression, RFC 2202 HMAC-SHA1 (3 vectors), RFC 4231
  HMAC-SHA512 (3 vectors).
- Lane 3 (clippy::pedantic refactors): not pursued — warnings were
  scattered across many files; no clean single-logical-change candidates
  surfaced.
- Lane 4 (oversized file refactors): not pursued — risk to public API.
- Lane 5 (perf benchmarks): baseline captured to /tmp/bench_baseline.txt
  at session start; no perf changes attempted (perf claims require
  rigorous comparison and there were no obvious hot spots that didn't
  delegate to a vetted backend crate).
- BigNumber experimental lane: not started.

**Cross-SDK parity additions (highlights)**
- All 24 TREZOR BIP-39 → BIP-32 master xprv vectors verified byte-for-byte.
- 12 go-sdk BSM ECDSA signatures verified byte-for-byte (RFC 6979 anchor).
- Electrum ECIES self-encrypt ciphertext verified byte-for-byte against
  go-sdk.
- BIP-276 hex digits A-F + field order regression tests (catches a known
  go-sdk #286 regex bug that bsv-rs is already immune to — pins immunity).
- P2PKH scriptPubKey → mainnet address parity with go-sdk's Address()/
  Addresses().
- BIP-32 xprv → (private_key, compressed_pubkey, P2PKH address) full-chain
  parity with go-sdk example outputs.

**Per-commit average**
- 31 commits in 96 minutes = ~3.1 minutes per commit (build + test +
  clippy + commit each one).

**What was NOT done / needs human review**
1. Origin push failed throughout — local SSH key missing. User should
   push manually: `git push origin improvement-loop/2026-05-12`.
2. No BigNumber experimental lane (would have been a 2h sub-budget on a
   separate branch — context budget didn't favor starting it).
3. No internal refactors of oversized files (wallet/wire/encoding.rs 2554
   lines, transaction/transaction.rs 2476 lines). Risk of public-API
   signature regression too high for a one-shot commit.
4. No perf optimizations attempted — bench baseline captured but not
   compared against.
5. Some clippy::pedantic warnings remain (long literals lacking
   separators, missing must_use, manual let_else); these are scattered
   and not amenable to single-logical-change commits.

**Repo state at stop**
- HEAD: b353b15
- Working tree: clean (only untracked LOOP_GOAL.md, LOOP_LOG.md,
  examples/ — all left alone per goal directive).
- All tests: green.
- All clippy lints: clean under `-D warnings`.

BUDGET_EXHAUSTED