What changed, and why it matters
This commit is a routine dependency update inside the btcd cryptocurrency project. It changes the btcec cryptographic package to use a newer version (v2) of the internal chainhash module instead of the older v1 path. No security bug is fixed or introduced in the visible code; it is purely an import-path and module-reference change.
No security action required. Treat as normal maintenance; verify that the chainhash/v2 module interface is compatible and that tests pass.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch updates import paths from github.com/btcsuite/btcd/chaincfg/chainhash to github.com/btcsuite/btcd/chainhash/v2 across the btcec module (ECDSA example tests, EllSwift encoding, MuSig2 key/nonce/sign logic, and Schnorr signatures). go.mod is updated to require chainhash/v2 v2.0.0 and adds a temporary local replace directive. No functional code changes are present in the diff.
Changed components
btcec module dependency graphchainhash import pathsInspect captured patch +10 / −9
diff --git a/btcec/ecdsa/example_test.go b/btcec/ecdsa/example_test.go
index 409a95b..5341504 100644
--- a/btcec/ecdsa/example_test.go
+++ b/btcec/ecdsa/example_test.go
@@ -10,7 +10,7 @@ import (
"github.com/btcsuite/btcd/btcec/v2"
"github.com/btcsuite/btcd/btcec/v2/ecdsa"
- "github.com/btcsuite/btcd/chaincfg/chainhash"
+ "github.com/btcsuite/btcd/chainhash/v2"
)
// This example demonstrates signing a message with a secp256k1 private key that
diff --git a/btcec/ellswift/ellswift.go b/btcec/ellswift/ellswift.go
index e08e0d5..d4077e3 100644
--- a/btcec/ellswift/ellswift.go
+++ b/btcec/ellswift/ellswift.go
@@ -5,7 +5,7 @@ import (
"fmt"
"github.com/btcsuite/btcd/btcec/v2"
- "github.com/btcsuite/btcd/chaincfg/chainhash"
+ "github.com/btcsuite/btcd/chainhash/v2"
)
var (
diff --git a/btcec/go.mod b/btcec/go.mod
index 6e27d27..7d24401 100644
--- a/btcec/go.mod
+++ b/btcec/go.mod
@@ -3,7 +3,7 @@ module github.com/btcsuite/btcd/btcec/v2
go 1.25
require (
- github.com/btcsuite/btcd/chaincfg/chainhash v1.2.0
+ github.com/btcsuite/btcd/chainhash/v2 v2.0.0
github.com/davecgh/go-spew v1.1.1
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0
github.com/stretchr/testify v1.8.0
@@ -14,3 +14,6 @@ require (
github.com/pmezard/go-difflib v1.0.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
+
+// TODO(guggero): Remove once we have a tagged version of the chainhash package.
+replace github.com/btcsuite/btcd/chainhash/v2 => ../chainhash
diff --git a/btcec/go.sum b/btcec/go.sum
index f234aac..39677be 100644
--- a/btcec/go.sum
+++ b/btcec/go.sum
@@ -1,5 +1,3 @@
-github.com/btcsuite/btcd/chaincfg/chainhash v1.2.0 h1:yMIg99+4aBvqfl/HzJRKfxTX9rGfikoI9uvFzterhc8=
-github.com/btcsuite/btcd/chaincfg/chainhash v1.2.0/go.mod h1:Y72Ren9gfhlEvnwnT78BGcSNO2UMphTKLn9AorF+5rg=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
diff --git a/btcec/schnorr/musig2/keys.go b/btcec/schnorr/musig2/keys.go
index 4ee63be..364aee5 100644
--- a/btcec/schnorr/musig2/keys.go
+++ b/btcec/schnorr/musig2/keys.go
@@ -11,7 +11,7 @@ import (
"github.com/btcsuite/btcd/btcec/v2"
"github.com/btcsuite/btcd/btcec/v2/schnorr"
- "github.com/btcsuite/btcd/chaincfg/chainhash"
+ "github.com/btcsuite/btcd/chainhash/v2"
)
var (
diff --git a/btcec/schnorr/musig2/nonces.go b/btcec/schnorr/musig2/nonces.go
index dbe39ef..b2d56df 100644
--- a/btcec/schnorr/musig2/nonces.go
+++ b/btcec/schnorr/musig2/nonces.go
@@ -11,7 +11,7 @@ import (
"github.com/btcsuite/btcd/btcec/v2"
"github.com/btcsuite/btcd/btcec/v2/schnorr"
- "github.com/btcsuite/btcd/chaincfg/chainhash"
+ "github.com/btcsuite/btcd/chainhash/v2"
)
const (
diff --git a/btcec/schnorr/musig2/sign.go b/btcec/schnorr/musig2/sign.go
index 9204611..67d194d 100644
--- a/btcec/schnorr/musig2/sign.go
+++ b/btcec/schnorr/musig2/sign.go
@@ -11,7 +11,7 @@ import (
"github.com/btcsuite/btcd/btcec/v2"
"github.com/btcsuite/btcd/btcec/v2/schnorr"
- "github.com/btcsuite/btcd/chaincfg/chainhash"
+ "github.com/btcsuite/btcd/chainhash/v2"
)
var (
diff --git a/btcec/schnorr/signature.go b/btcec/schnorr/signature.go
index 37f9cc2..fbfe161 100644
--- a/btcec/schnorr/signature.go
+++ b/btcec/schnorr/signature.go
@@ -6,7 +6,7 @@ import (
"fmt"
"github.com/btcsuite/btcd/btcec/v2"
- "github.com/btcsuite/btcd/chaincfg/chainhash"
+ "github.com/btcsuite/btcd/chainhash/v2"
secp "github.com/decred/dcrd/dcrec/secp256k1/v4"
ecdsa_schnorr "github.com/decred/dcrd/dcrec/secp256k1/v4/schnorr"
)
Why this scored 18/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.