Upgrade btcd and migrate to btcec/v2 - #21
Draft
mswilkison wants to merge 1 commit into
Draft
mswilkison wants to merge 1 commit into
mswilkison wants to merge 1 commit into
Conversation
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.
The current btcd version is covered by three published Dependabot advisories. Upgrade it to v0.24.2 and migrate the removed legacy btcec and btcutil imports to
btcd/btcec/v2 v2.2.0andbtcd/btcutil v1.1.5. This covers GHSA-2chg-86hq-7w38, GHSA-3jgf-r68h-xfqm, and GHSA-27vh-h6mc-q6g8.Stacked on #20; merge #19, then #20, then this PR. The combined stack selects versions at or above the fixed versions for all 30 current Dependabot alerts. Dependency selection was checked against each alert's published affected range; this is not a claim that all affected dependency paths are reachable in tss-lib.
The migration preserves compressed public-key parsing, the caller-supplied curve instance in derived keys, the registered
secp256k1name, and coordinate-based JSON/Gob persistence. Compatibility tests use fixed legacy encodings, synthetic save data with no signing secrets, ordinary point arithmetic, BIP32 vectors, hierarchy deltas, and curve registry controls. No legacy btcec or btcutil packages remain in the compiled library/test dependency closure.This PR is a draft pending downstream integration review. Exported
elliptic.Curvesignatures remain the same, but the concrete curve implementation changes from legacy btcec to Decred secp256k1/v4 through btcec/v2. Callers using legacy imports or concrete type assertions need adaptation. The selected btcd/btcec/btcutil versions match the public keep-core dependency set referenced by keep-core #4312; that PR also supplies the Go baseline used by #20. This does not establish keep-core integration compatibility, and Go module version selection in consumers can choose a higher btcec/v2 version.Validation on the final stacked commit with Go 1.26.8:
tss,crypto,crypto/ckd,crypto/schnorr,crypto/vss, andecdsa/signingpackage suites passed, including ordinary and HD signing end to end (signing: 67.601s).go build -mod=readonly -p 1 ./...,go vet -mod=readonly -p 1 ./...,go mod verify, module tidiness, and whitespace checks passed.The exact minimum Go toolchain was not exercised locally. Full repository CI was dispatched explicitly at
66aaeca3344b1977d2d2c20f6fd98c521bc58bbebecause this stacked PR targets a branch other than master: full tests, formatting.