Repository navigation
feat(deps)!: migrate to bsv-blockchain SDK (v3) - #314
Merged
Merged
Conversation
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.
There was a problem hiding this comment.
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 tobsv-blockchain/go-bt. - Bump module path from
/v2to/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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Migrates go-bitcoin to the
bsv-blockchainecosystem and bumps the module to v3.Changes
Dependencies & module (
feat(deps)!)bsv-blockchainpackages:bitcoinsv/bsvd,libsv/go-bk,libsv/go-bt→bsv-blockchain/go-sdk+bsv-blockchain/go-bt/v2to/v3.ecies.go) and WIF (wif.go) implementations to cover functionality previously provided bygo-bk, including a known-vector test proving byte-for-byte wire compatibility with the originalgo-bk/bec.Encrypt(Pyelliptic / ANSI-X9.63) output.examples/to usebsv-blockchain/go-sdkprimitives (ec.PrivateKey/ec.PublicKey).Docs
SECURITY.mdmarking v1/v2 as deprecated.CI
Breaking changes
Validation
go build ./...passes.