Skip to content

feat(deps)!: migrate to bsv-blockchain SDK (v3) - #314

Merged
mrz1836 merged 8 commits into
masterfrom
feat/bsv-blockchain-pkgs
May 28, 2026
Merged

mrz1836 merged 8 commits into
masterfrom
feat/bsv-blockchain-pkgs

Conversation

@mrz1836

@mrz1836 mrz1836 commented May 28, 2026

Copy link
Copy Markdown
Member

Overview

Migrates go-bitcoin to the bsv-blockchain ecosystem and bumps the module to v3.

Changes

Dependencies & module (feat(deps)!)

  • Replace legacy dependencies with maintained bsv-blockchain packages:
    • bitcoinsv/bsvd, libsv/go-bk, libsv/go-bt → bsv-blockchain/go-sdk + bsv-blockchain/go-bt
  • Bump module path from /v2 to /v3.
  • Add local ECIES (ecies.go) and WIF (wif.go) implementations to cover functionality previously provided by go-bk, including a known-vector test proving byte-for-byte wire compatibility with the original go-bk/bec.Encrypt (Pyelliptic / ANSI-X9.63) output.
  • Update all source, tests, and examples/ to use bsv-blockchain/go-sdk primitives (ec.PrivateKey / ec.PublicKey).

Docs

  • Update install instructions, dependency list, and feature links for v3.
  • Add a supported-versions table to SECURITY.md marking v1/v2 as deprecated.

CI

  • Normalize permission-comment alignment across workflows.

Breaking changes

BREAKING CHANGE: the module path is now github.com/bitcoinschema/go-bitcoin/v3 and public APIs use bsv-blockchain/go-sdk primitives (ec.PrivateKey / ec.PublicKey) in place of bec.*. Consumers must update imports and key types.

Validation

  • go build ./... passes.
  • Pre-commit checks (lint, fumpt, mod-tidy, gitleaks, whitespace, eof) pass on every commit.

mrz1836 added 3 commits May 28, 2026 10:53
Replace legacy bitcoinsv/bsvd, libsv/go-bk, and libsv/go-bt
dependencies with bsv-blockchain/go-sdk and bsv-blockchain/go-bt.
Add local ECIES and WIF implementations to cover functionality
previously provided by go-bk.

BREAKING CHANGE: module path is now /v3 and public APIs use
bsv-blockchain/go-sdk primitives (ec.PrivateKey/ec.PublicKey).
Update install instructions, dependency list, and feature links for v3. Add a supported-versions table marking v1 and v2 as deprecated.
Copilot AI review requested due to automatic review settings May 28, 2026 14:54
@github-actions github-actions Bot added chore Simple dependency updates or version bumps dependencies Dependency updates, version bumps, etc. feature Any new significant addition labels May 28, 2026
@github-actions github-actions Bot added the size/XL Very large change (>500 lines) label May 28, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR performs a major-version migration of go-bitcoin to the bsv-blockchain ecosystem (module path /v3), replacing legacy bsvd/libsv primitives with bsv-blockchain/go-sdk and bsv-blockchain/go-bt, and backfilling missing functionality (notably ECIES + WIF) to preserve existing wire formats and APIs where required.

Changes:

  • Migrate cryptographic key/signing/verification primitives to bsv-blockchain/go-sdk (ec.PrivateKey / ec.PublicKey) and update transaction/script usage to bsv-blockchain/go-bt.
  • Bump module path from /v2 to /v3, updating docs and all examples accordingly.
  • Add local implementations + tests for Pyelliptic/ANSI-X9.63 ECIES and WIF to maintain backwards compatibility with previous encodings.

Reviewed changes

Copilot reviewed 50 out of 56 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
wif.go Adds local WIF encode/decode to preserve uncompressed WIF support on top of go-sdk keys.
wif_test.go Adds WIF vectors + round-trip tests for compressed/uncompressed WIF behavior.
ecies.go Adds local ECIES (Pyelliptic / ANSI X9.63 compatible) encrypt/decrypt implementation.
ecies_test.go Adds ECIES interop vector test and additional round-trip/format/failure tests.
encryption.go Switches encryption helpers from bec.* to local ECIES helpers using go-sdk keys.
encryption_test.go Updates encryption tests to use go-sdk key types and ECIES helpers.
private_key.go Migrates private key creation/parsing/WIF helpers to go-sdk + local WIF implementation.
private_key_test.go Updates private key + WIF tests for go-sdk key types and local WIF.
pubkey.go Migrates public key derivation/parsing to go-sdk primitives.
pubkey_test.go Updates pubkey tests/examples to use go-sdk serialization methods.
hd_key.go Migrates HD key operations to go-sdk compat bip32 and go-sdk key types.
hd_key_test.go Updates HD key tests/examples for go-sdk key types and serialization.
address.go Migrates address derivation hashing to go-sdk hash primitives and go-sdk pubkeys.
address_test.go Updates address tests to use go-sdk key generation and types.
sign.go Replaces manual BSM hashing/signing with go-sdk compat/bsm signing.
verify.go Replaces manual BSM hashing/recovery with go-sdk compat/bsm public-key recovery and uses go-sdk DER verification.
script.go Updates script helpers to bsv-blockchain/go-bt import path.
transaction.go Updates transaction creation/signing types to use go-sdk private keys and bsv-blockchain go-bt packages.
transaction_test.go Updates go-bt dependency import path in tests.
transaction_creation_test.go Updates key types in transaction creation tests to go-sdk ec.PrivateKey.
README.md Updates module install path/docs links and dependency references for v3.
.github/SECURITY.md Adds a supported-version matrix marking v1/v2 as deprecated and v3 supported.
.gitleaksignore Ignores the ECIES test fixture that resembles a secret.
go.mod Bumps module to /v3 and replaces legacy deps with bsv-blockchain/go-sdk + bsv-blockchain/go-bt.
go.sum Updates dependency checksums to match the new module graph.
.github/workflows/stale-check.yml Normalizes permissions/comment alignment.
.github/workflows/pull-request-management.yml Normalizes permissions/comment alignment.
.github/workflows/fortress-security-scans.yml Normalizes permissions/comment alignment.
.github/workflows/dependabot-auto-merge.yml Normalizes permissions/comment alignment.
.github/workflows/auto-merge-on-approval.yml Normalizes permissions/comment alignment.
examples/wif_to_private_key/wif_to_private_key.go Updates example imports to module /v3.
examples/wif_from_string/wif_from_string.go Updates example imports and uses local bitcoin.WIF type.
examples/verify_signature/verify_signature.go Updates example imports to module /v3.
examples/verify_signature_der/verify_signature_der.go Updates example imports to module /v3.
examples/tx_from_hex/tx_from_hex.go Updates example imports to module /v3.
examples/sign_message/sign_message.go Updates example imports to module /v3.
examples/script_from_address/script_from_address.go Updates example imports to module /v3.
examples/private_key_to_wif/private_key_to_wif.go Updates example imports to module /v3.
examples/get_public_keys_for_path/get_public_keys_for_path.go Updates example imports and pubkey serialization to go-sdk.
examples/get_private_key_for_path/get_private_key_for_path.go Updates example imports and privkey serialization to go-sdk.
examples/get_hd_key_from_xpub/get_hd_key_from_xpub.go Updates example imports to module /v3.
examples/get_extended_public_key/get_extended_public_key.go Updates example imports to module /v3.
examples/get_addresses_for_path/get_addresses_for_path.go Updates example imports to module /v3.
examples/get_address_from_hd_key/get_address_from_hd_key.go Updates example imports and go-bt bscript import path.
examples/generate_hd_key/generate_hd_key.go Updates example imports to module /v3.
examples/encrypt_with_private_key/encrypt_with_private_key.go Updates example imports and privkey serialization to go-sdk.
examples/encrypt_shared_keys/encrypt_shared_keys.go Updates example imports and decryption flow to match new encryption API.
examples/decrypt_with_private_key/decrypt_with_private_key.go Updates example imports to module /v3.
examples/create_wif/create_wif.go Updates example imports to module /v3.
examples/create_tx/create_tx.go Updates example imports and go-bt import path.
examples/create_tx_with_change/create_tx_with_change.go Updates example imports to module /v3.
examples/create_tx_using_wif/create_tx_using_wif.go Updates example imports to module /v3.
examples/create_pubkey/create_pubkey.go Updates example imports to module /v3.
examples/calculate_fee_for_tx/calculate_fee_for_tx.go Updates example imports to module /v3.
examples/address_from_wif/address_from_wif.go Updates example imports to module /v3.
examples/address_from_private_key/address_from_private_key.go Updates example imports to module /v3.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread wif.go Resolved
Comment thread wif.go Resolved
Comment thread ecies.go Resolved
Comment thread ecies.go Resolved
Comment thread address.go Resolved
@mrz1836
mrz1836 requested a review from Copilot May 28, 2026 16:00
@mrz1836
mrz1836 merged commit 6f23360 into master May 28, 2026
18 of 19 checks passed
@github-actions
github-actions Bot deleted the feat/bsv-blockchain-pkgs branch May 28, 2026 16:04
@mrz1836
mrz1836 removed the request for review from Copilot May 28, 2026 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Simple dependency updates or version bumps dependencies Dependency updates, version bumps, etc. feature Any new significant addition size/XL Very large change (>500 lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants