What changed, and why it matters
This commit is a routine internal restructuring of the btcd project's Go module layout. It switches the btcutil package and its subpackages from the old module path to a new 'v2' path, and updates imports throughout the code to point at newly split-out submodules (address, chaincfg, chainhash, txscript, wire). It also copies one small helper function (HashMerkleBranches) into the bloom package to avoid depending on the blockchain package. There is no indication in the commit of any security bug being fixed.
No security action required. Treat as a normal dependency/module refactor. Consumers of btcutil should update their import paths to /v2 when upgrading.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The change is a large-scale import-path migration: module github.com/btcsuite/btcd/btcutil becomes github.com/btcsuite/btcd/btcutil/v2, and imports are updated to use the new /v2 submodules for address, base58, chaincfg, chainhash, txscript, and wire. The only non-import code change is in btcutil/bloom/merkleblock.go, where the dependency on github.com/btcsuite/btcd/blockchain is removed by inlining a local copy of HashMerkleBranches. Dependency versions are bumped (golang.org/x/crypto, kkdai/bstream, btclog) and local replace directives are added. No functional security fix is described or visible in the diff.
Changed components
btcutil module path and all subpackages (bloom, coinset, gcs, hdkeychain, psbt, txsort)go.mod / go.sum dependency graphInspect captured patch +172 / −160
diff --git a/btcutil/README.md b/btcutil/README.md
index ad32607..96548a3 100644
--- a/btcutil/README.md
+++ b/btcutil/README.md
@@ -20,7 +20,7 @@ provided.
## Installation and Updating
```bash
-$ go get -u github.com/btcsuite/btcd/btcutil
+$ go get -u github.com/btcsuite/btcd/btcutil/v2
```
## GPG Verification Key
diff --git a/btcutil/amount_test.go b/btcutil/amount_test.go
index 69498b0..7be29dc 100644
--- a/btcutil/amount_test.go
+++ b/btcutil/amount_test.go
@@ -8,7 +8,7 @@ import (
"math"
"testing"
- . "github.com/btcsuite/btcd/btcutil"
+ . "github.com/btcsuite/btcd/btcutil/v2"
)
func TestAmountCreation(t *testing.T) {
diff --git a/btcutil/appdata_test.go b/btcutil/appdata_test.go
index 061b1b5..c6995a8 100644
--- a/btcutil/appdata_test.go
+++ b/btcutil/appdata_test.go
@@ -12,7 +12,7 @@ import (
"testing"
"unicode"
- "github.com/btcsuite/btcd/btcutil"
+ "github.com/btcsuite/btcd/btcutil/v2"
)
// TestAppDataDir tests the API for AppDataDir to ensure it gives expected
diff --git a/btcutil/bench_test.go b/btcutil/bench_test.go
index c1f52da..ed4b649 100644
--- a/btcutil/bench_test.go
+++ b/btcutil/bench_test.go
@@ -3,8 +3,8 @@ package btcutil_test
import (
"testing"
- "github.com/btcsuite/btcd/btcutil"
- "github.com/btcsuite/btcd/chaincfg/chainhash"
+ "github.com/btcsuite/btcd/btcutil/v2"
+ "github.com/btcsuite/btcd/chainhash/v2"
)
var (
diff --git a/btcutil/block.go b/btcutil/block.go
index 7f8d878..da7a47e 100644
--- a/btcutil/block.go
+++ b/btcutil/block.go
@@ -9,8 +9,8 @@ import (
"fmt"
"io"
- "github.com/btcsuite/btcd/chaincfg/chainhash"
- "github.com/btcsuite/btcd/wire"
+ "github.com/btcsuite/btcd/chainhash/v2"
+ "github.com/btcsuite/btcd/wire/v2"
)
// OutOfRangeError describes an error due to accessing an element that is out
diff --git a/btcutil/block_test.go b/btcutil/block_test.go
index 06e0ad2..e5ae983 100644
--- a/btcutil/block_test.go
+++ b/btcutil/block_test.go
@@ -11,9 +11,9 @@ import (
"testing"
"time"
- "github.com/btcsuite/btcd/btcutil"
- "github.com/btcsuite/btcd/chaincfg/chainhash"
- "github.com/btcsuite/btcd/wire"
+ "github.com/btcsuite/btcd/btcutil/v2"
+ "github.com/btcsuite/btcd/chainhash/v2"
+ "github.com/btcsuite/btcd/wire/v2"
"github.com/davecgh/go-spew/spew"
)
diff --git a/btcutil/bloom/README.md b/btcutil/bloom/README.md
index 4a5c937..1d549ab 100644
--- a/btcutil/bloom/README.md
+++ b/btcutil/bloom/README.md
@@ -15,7 +15,7 @@ report.
## Installation and Updating
```bash
-$ go get -u github.com/btcsuite/btcd/btcutil/bloom
+$ go get -u github.com/btcsuite/btcd/btcutil/v2/bloom
```
## Examples
diff --git a/btcutil/bloom/example_test.go b/btcutil/bloom/example_test.go
index 2be2b67..bbf63f7 100644
--- a/btcutil/bloom/example_test.go
+++ b/btcutil/bloom/example_test.go
@@ -9,9 +9,9 @@ import (
"math/rand"
"time"
- "github.com/btcsuite/btcd/btcutil/bloom"
- "github.com/btcsuite/btcd/chaincfg/chainhash"
- "github.com/btcsuite/btcd/wire"
+ "github.com/btcsuite/btcd/btcutil/v2/bloom"
+ "github.com/btcsuite/btcd/chainhash/v2"
+ "github.com/btcsuite/btcd/wire/v2"
)
// This example demonstrates how to create a new bloom filter, add a transaction
diff --git a/btcutil/bloom/filter.go b/btcutil/bloom/filter.go
index e919862..cd43f5c 100644
--- a/btcutil/bloom/filter.go
+++ b/btcutil/bloom/filter.go
@@ -9,10 +9,10 @@ import (
"math"
"sync"
- "github.com/btcsuite/btcd/btcutil"
- "github.com/btcsuite/btcd/chaincfg/chainhash"
- "github.com/btcsuite/btcd/txscript"
- "github.com/btcsuite/btcd/wire"
+ "github.com/btcsuite/btcd/btcutil/v2"
+ "github.com/btcsuite/btcd/chainhash/v2"
+ "github.com/btcsuite/btcd/txscript/v2"
+ "github.com/btcsuite/btcd/wire/v2"
)
// ln2Squared is simply the square of the natural log of 2.
diff --git a/btcutil/bloom/filter_test.go b/btcutil/bloom/filter_test.go
index 942bed5..a16d21e 100644
--- a/btcutil/bloom/filter_test.go
+++ b/btcutil/bloom/filter_test.go
@@ -9,10 +9,11 @@ import (
"encoding/hex"
"testing"
- "github.com/btcsuite/btcd/btcutil"
- "github.com/btcsuite/btcd/btcutil/bloom"
- "github.com/btcsuite/btcd/chaincfg/chainhash"
- "github.com/btcsuite/btcd/wire"
+ "github.com/btcsuite/btcd/address/v2"
+ "github.com/btcsuite/btcd/btcutil/v2"
+ "github.com/btcsuite/btcd/btcutil/v2/bloom"
+ "github.com/btcsuite/btcd/chainhash/v2"
+ "github.com/btcsuite/btcd/wire/v2"
)
// TestFilterLarge ensures a maximum sized filter can be created.
@@ -255,7 +256,7 @@ func TestFilterInsertKey(t *testing.T) {
f := bloom.NewFilter(2, 0, 0.001, wire.BloomUpdateAll)
f.Add(wif.SerializePubKey())
- f.Add(btcutil.Hash160(wif.SerializePubKey()))
+ f.Add(address.Hash160(wif.SerializePubKey()))
want, err := hex.DecodeString("038fc16b080000000000000001")
if err != nil {
diff --git a/btcutil/bloom/merkleblock.go b/btcutil/bloom/merkleblock.go
index 468aa72..fb903ff 100644
--- a/btcutil/bloom/merkleblock.go
+++ b/btcutil/bloom/merkleblock.go
@@ -5,10 +5,9 @@
package bloom
import (
- "github.com/btcsuite/btcd/blockchain"
- "github.com/btcsuite/btcd/btcutil"
- "github.com/btcsuite/btcd/chaincfg/chainhash"
- "github.com/btcsuite/btcd/wire"
+ "github.com/btcsuite/btcd/btcutil/v2"
+ "github.com/btcsuite/btcd/chainhash/v2"
+ "github.com/btcsuite/btcd/wire/v2"
)
// merkleBlock is used to house intermediate information needed to generate a
@@ -41,7 +40,7 @@ func (m *merkleBlock) calcHash(height, pos uint32) *chainhash.Hash {
} else {
right = left
}
- res := blockchain.HashMerkleBranches(left, right)
+ res := HashMerkleBranches(left, right)
return &res
}
@@ -124,3 +123,15 @@ func NewMerkleBlock(block *btcutil.Block, filter *Filter) (*wire.MsgMerkleBlock,
}
return &msgMerkleBlock, matchedIndices
}
+
+// HashMerkleBranches takes two hashes, treated as the left and right tree
+// nodes, and returns the hash of their concatenation. This is a helper
+// function used to aid in the generation of a merkle tree.
+func HashMerkleBranches(left, right *chainhash.Hash) chainhash.Hash {
+ // Concatenate the left and right nodes.
+ var hash [chainhash.HashSize * 2]byte
+ copy(hash[:chainhash.HashSize], left[:])
+ copy(hash[chainhash.HashSize:], right[:])
+
+ return chainhash.DoubleHashH(hash[:])
+}
diff --git a/btcutil/bloom/merkleblock_test.go b/btcutil/bloom/merkleblock_test.go
index ae7b1f3..0e5fc00 100644
--- a/btcutil/bloom/merkleblock_test.go
+++ b/btcutil/bloom/merkleblock_test.go
@@ -9,10 +9,10 @@ import (
"encoding/hex"
"testing"
- "github.com/btcsuite/btcd/btcutil"
- "github.com/btcsuite/btcd/btcutil/bloom"
- "github.com/btcsuite/btcd/chaincfg/chainhash"
- "github.com/btcsuite/btcd/wire"
+ "github.com/btcsuite/btcd/btcutil/v2/bloom"
+ "github.com/btcsuite/btcd/btcutil/v2"
+ "github.com/btcsuite/btcd/chainhash/v2"
+ "github.com/btcsuite/btcd/wire/v2"
)
func TestMerkleBlock3(t *testing.T) {
diff --git a/btcutil/bloom/murmurhash3_test.go b/btcutil/bloom/murmurhash3_test.go
index 9c102d5..2916f25 100644
--- a/btcutil/bloom/murmurhash3_test.go
+++ b/btcutil/bloom/murmurhash3_test.go
@@ -7,7 +7,7 @@ package bloom_test
import (
"testing"
- "github.com/btcsuite/btcd/btcutil/bloom"
+ "github.com/btcsuite/btcd/btcutil/v2/bloom"
)
// TestMurmurHash3 ensure the MurmurHash3 function produces the correct hash
diff --git a/btcutil/certgen_test.go b/btcutil/certgen_test.go
index 81aeea5..66cd6a1 100644
--- a/btcutil/certgen_test.go
+++ b/btcutil/certgen_test.go
@@ -11,8 +11,7 @@ import (
"testing"
"time"
- "github.com/btcsuite/btcd/btcutil"
- //"github.com/davecgh/go-spew/spew"
+ "github.com/btcsuite/btcd/btcutil/v2"
)
// TestNewTLSCertPair ensures the NewTLSCertPair function works as expected.
diff --git a/btcutil/coinset/coins.go b/btcutil/coinset/coins.go
index a0e680d..7e551e2 100644
--- a/btcutil/coinset/coins.go
+++ b/btcutil/coinset/coins.go
@@ -9,9 +9,9 @@ import (
"errors"
"sort"
- "github.com/btcsuite/btcd/btcutil"
- "github.com/btcsuite/btcd/chaincfg/chainhash"
- "github.com/btcsuite/btcd/wire"
+ "github.com/btcsuite/btcd/btcutil/v2"
+ "github.com/btcsuite/btcd/chainhash/v2"
+ "github.com/btcsuite/btcd/wire/v2"
)
// Coin represents a spendable transaction outpoint
diff --git a/btcutil/coinset/coins_test.go b/btcutil/coinset/coins_test.go
index c198462..a4c432b 100644
--- a/btcutil/coinset/coins_test.go
+++ b/btcutil/coinset/coins_test.go
@@ -11,10 +11,10 @@ import (
"fmt"
"testing"
- "github.com/btcsuite/btcd/btcutil"
- "github.com/btcsuite/btcd/btcutil/coinset"
- "github.com/btcsuite/btcd/chaincfg/chainhash"
- "github.com/btcsuite/btcd/wire"
+ "github.com/btcsuite/btcd/btcutil/v2/coinset"
+ "github.com/btcsuite/btcd/btcutil/v2"
+ "github.com/btcsuite/btcd/chainhash/v2"
+ "github.com/btcsuite/btcd/wire/v2"
)
type TestCoin struct {
diff --git a/btcutil/example_test.go b/btcutil/example_test.go
index 90be77b..d4cd149 100644
--- a/btcutil/example_test.go
+++ b/btcutil/example_test.go
@@ -4,7 +4,7 @@ import (
"fmt"
"math"
- "github.com/btcsuite/btcd/btcutil"
+ "github.com/btcsuite/btcd/btcutil/v2"
)
func ExampleAmount() {
diff --git a/btcutil/gcs/README.md b/btcutil/gcs/README.md
index ee0c120..ff9b14e 100644
--- a/btcutil/gcs/README.md
+++ b/btcutil/gcs/README.md
@@ -15,7 +15,7 @@ A comprehensive suite of tests is provided to ensure proper functionality.
## Installation and Updating
```bash
-$ go get -u github.com/btcsuite/btcd/btcutil/gcs
+$ go get -u github.com/btcsuite/btcd/btcutil/v2/gcs
```
## License
diff --git a/btcutil/gcs/builder/builder.go b/btcutil/gcs/builder/builder.go
index 8e257b3..6b1c7f7 100644
--- a/btcutil/gcs/builder/builder.go
+++ b/btcutil/gcs/builder/builder.go
@@ -11,10 +11,10 @@ import (
"io"
"math"
- "github.com/btcsuite/btcd/btcutil/gcs"
- "github.com/btcsuite/btcd/chaincfg/chainhash"
- "github.com/btcsuite/btcd/txscript"
- "github.com/btcsuite/btcd/wire"
+ "github.com/btcsuite/btcd/btcutil/v2/gcs"
+ "github.com/btcsuite/btcd/chainhash/v2"
+ "github.com/btcsuite/btcd/txscript/v2"
+ "github.com/btcsuite/btcd/wire/v2"
)
const (
diff --git a/btcutil/gcs/builder/builder_test.go b/btcutil/gcs/builder/builder_test.go
index 5976838..64fdf7c 100644
--- a/btcutil/gcs/builder/builder_test.go
+++ b/btcutil/gcs/builder/builder_test.go
@@ -9,13 +9,13 @@ import (
"encoding/hex"
"testing"
- "github.com/btcsuite/btcd/btcutil"
- "github.com/btcsuite/btcd/btcutil/gcs"
- "github.com/btcsuite/btcd/btcutil/gcs/builder"
- "github.com/btcsuite/btcd/chaincfg"
- "github.com/btcsuite/btcd/chaincfg/chainhash"
- "github.com/btcsuite/btcd/txscript"
- "github.com/btcsuite/btcd/wire"
+ "github.com/btcsuite/btcd/address/v2"
+ "github.com/btcsuite/btcd/btcutil/v2/gcs"
+ "github.com/btcsuite/btcd/btcutil/v2/gcs/builder"
+ "github.com/btcsuite/btcd/chaincfg/v2"
+ "github.com/btcsuite/btcd/chainhash/v2"
+ "github.com/btcsuite/btcd/txscript/v2"
+ "github.com/btcsuite/btcd/wire/v2"
)
var (
@@ -77,7 +77,7 @@ func TestUseBlockHash(t *testing.T) {
}
// btcutil.Address
- addr, err := btcutil.DecodeAddress(testAddr, &chaincfg.MainNetParams)
+ addr, err := address.DecodeAddress(testAddr, &chaincfg.MainNetParams)
if err != nil {
t.Fatalf("Address decode failed: %s", err.Error())
}
diff --git a/btcutil/gcs/gcs.go b/btcutil/gcs/gcs.go
index fca315d..ba08b94 100644
--- a/btcutil/gcs/gcs.go
+++ b/btcutil/gcs/gcs.go
@@ -12,7 +12,7 @@ import (
"sort"
"github.com/aead/siphash"
- "github.com/btcsuite/btcd/wire"
+ "github.com/btcsuite/btcd/wire/v2"
"github.com/kkdai/bstream"
)
diff --git a/btcutil/gcs/gcs_test.go b/btcutil/gcs/gcs_test.go
index 8ae49f0..dfa6d93 100644
--- a/btcutil/gcs/gcs_test.go
+++ b/btcutil/gcs/gcs_test.go
@@ -11,7 +11,7 @@ import (
"math/rand"
"testing"
- "github.com/btcsuite/btcd/btcutil/gcs"
+ "github.com/btcsuite/btcd/btcutil/v2/gcs"
)
var (
diff --git a/btcutil/gcs/gcsbench_test.go b/btcutil/gcs/gcsbench_test.go
index 69ce770..80d92b5 100644
--- a/btcutil/gcs/gcsbench_test.go
+++ b/btcutil/gcs/gcsbench_test.go
@@ -10,7 +10,7 @@ import (
"math/rand"
"testing"
- "github.com/btcsuite/btcd/btcutil/gcs"
+ "github.com/btcsuite/btcd/btcutil/v2/gcs"
)
func genRandFilterElements(numElements uint) ([][]byte, error) {
diff --git a/btcutil/go.mod b/btcutil/go.mod
index 1e57a54..deca289 100644
--- a/btcutil/go.mod
+++ b/btcutil/go.mod
@@ -1,24 +1,45 @@
-module github.com/btcsuite/btcd/btcutil
+module github.com/btcsuite/btcd/btcutil/v2
go 1.25
require (
github.com/aead/siphash v1.0.1
- github.com/btcsuite/btcd v0.24.2
+ github.com/btcsuite/btcd/address/v2 v2.0.0
github.com/btcsuite/btcd/btcec/v2 v2.4.0
- github.com/btcsuite/btcd/chaincfg/chainhash v1.2.0
+ github.com/btcsuite/btcd/chaincfg/v2 v2.0.0
+ github.com/btcsuite/btcd/chainhash/v2 v2.0.0
+ github.com/btcsuite/btcd/txscript/v2 v2.0.0
+ github.com/btcsuite/btcd/wire/v2 v2.0.0
github.com/davecgh/go-spew v1.1.1
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0
github.com/kcalvinalvin/anet v0.0.0-20251112173137-d8ddc1f6dbee
- github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23
+ github.com/kkdai/bstream v1.0.0
github.com/stretchr/testify v1.8.4
- golang.org/x/crypto v0.25.0
+ golang.org/x/crypto v0.40.0
)
require (
- github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f // indirect
+ github.com/btcsuite/btclog v1.0.0 // indirect
github.com/decred/dcrd/crypto/blake256 v1.1.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
- golang.org/x/sys v0.22.0 // indirect
+ golang.org/x/sys v0.35.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
+
+// TODO(guggero): Remove this as soon as we have a tagged version of address.
+replace github.com/btcsuite/btcd/address/v2 => ../address
+
+// TODO(guggero): Remove this as soon as we have a tagged version of btcec.
+replace github.com/btcsuite/btcd/btcec/v2 => ../btcec
+
+// TODO(guggero): Remove this as soon as we have a tagged version of chaincfg.
+replace github.com/btcsuite/btcd/chaincfg/v2 => ../chaincfg
+
+// TODO(guggero): Remove this as soon as we have a tagged version of chainhash.
+replace github.com/btcsuite/btcd/chainhash/v2 => ../chainhash
+
+// TODO(guggero): Remove this as soon as we have a tagged version of txscript.
+replace github.com/btcsuite/btcd/txscript/v2 => ../txscript
+
+// TODO(guggero): Remove this as soon as we have a tagged version of wire.
+replace github.com/btcsuite/btcd/wire/v2 => ../wire
diff --git a/btcutil/go.sum b/btcutil/go.sum
index 37cf6dc..10844f0 100644
--- a/btcutil/go.sum
+++ b/btcutil/go.sum
@@ -1,13 +1,9 @@
github.com/aead/siphash v1.0.1 h1:FwHfE/T45KPKYuuSAKyyvE+oPWcaQ+CUmFW0bPlM+kg=
github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII=
-github.com/btcsuite/btcd v0.24.2 h1:aLmxPguqxza+4ag8R1I2nnJjSu2iFn/kqtHTIImswcY=
-github.com/btcsuite/btcd v0.24.2/go.mod h1:5C8ChTkl5ejr3WHj8tkQSCmydiMEPB0ZhQhehpq7Dgg=
github.com/btcsuite/btcd/btcec/v2 v2.4.0 h1:9JgnRkOL8J1UKuGlpJs7oL5tFRgrBgyM/uhwfS+cUiI=
github.com/btcsuite/btcd/btcec/v2 v2.4.0/go.mod h1:64BXFSNzV1koQHPqljB4LaD6lZPQEQNZ38zMImajCRo=
-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/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f h1:bAs4lUbRJpnnkd9VhRV3jjAVU7DJVjMaK+IsvSeZvFo=
-github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA=
+github.com/btcsuite/btclog v1.0.0 h1:sEkpKJMmfGiyZjADwEIgB1NSwMyfdD1FB8v6+w1T0Ns=
+github.com/btcsuite/btclog v1.0.0/go.mod h1:w7xnGOhwT3lmrS4H3b/D1XAXxvh+tbhUm8xeHN2y3TQ=
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=
github.com/decred/dcrd/crypto/blake256 v1.1.0 h1:zPMNGQCm0g4QTY27fOCorQW7EryeQ/U0x++OzVrdms8=
@@ -18,18 +14,18 @@ github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM=
github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/kcalvinalvin/anet v0.0.0-20251112173137-d8ddc1f6dbee h1:FPP9HDkBbPyniu+u7FHZg+kKFX1WW0gxOGteJ0h3AJk=
github.com/kcalvinalvin/anet v0.0.0-20251112173137-d8ddc1f6dbee/go.mod h1:N6sz6HwJAenJ6d+/xmSl0ikfV05ZrVGmjt1ryy/WOtE=
-github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23 h1:FOOIBWrEkLgmlgGfMuZT83xIwfPDxEI2OHu6xUmJMFE=
-github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4=
+github.com/kkdai/bstream v1.0.0 h1:Se5gHwgp2VT2uHfDrkbbgbgEvV9cimLELwrPJctSjg8=
+github.com/kkdai/bstream v1.0.0/go.mod h1:FDnDOHt5Yx4p3FaHcioFT0QjDOtgUpvjeZqAs+NVZZA=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY=
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc=
-golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30=
-golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M=
-golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI=
-golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/crypto v0.40.0 h1:r4x+VvoG5Fm+eJcxMaY8CQM7Lb0l1lsmjGBQ6s8BfKM=
+golang.org/x/crypto v0.40.0/go.mod h1:Qr1vMER5WyS2dfPHAlsOj01wgLbsyWtFn/aY+5+ZdxY=
+golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI=
+golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
diff --git a/btcutil/hdkeychain/README.md b/btcutil/hdkeychain/README.md
index 2101ed4..4bd1ea2 100644
--- a/btcutil/hdkeychain/README.md
+++ b/btcutil/hdkeychain/README.md
@@ -1,9 +1,9 @@
hdkeychain
==========
-[](https://travis-ci.org/btcsuite/btcutil)
+[](https://github.com/btcsuite/btcd/actions)
[](http://copyfree.org)
-[](http://godoc.org/github.com/btcsuite/btcd/btcutil/hdkeychain)
+[](http://godoc.org/github.com/btcsuite/btcd/btcutil/v2/hdkeychain)
Package hdkeychain provides an API for bitcoin hierarchical deterministic
extended keys (BIP0032).
@@ -39,18 +39,18 @@ report.
## Installation and Updating
```bash
-$ go get -u github.com/btcsuite/btcd/btcutil/hdkeychain
+$ go get -u github.com/btcsuite/btcd/btcutil/v2/hdkeychain
```
## Examples
-* [NewMaster Example](http://godoc.org/github.com/btcsuite/btcd/btcutil/hdkeychain#example-NewMaster)
+* [NewMaster Example](http://godoc.org/github.com/btcsuite/btcd/btcutil/v2/hdkeychain#example-NewMaster)
Demonstrates how to generate a cryptographically random seed then use it to
create a new master node (extended key).
-* [Default Wallet Layout Example](http://godoc.org/github.com/btcsuite/btcd/btcutil/hdkeychain#example-package--DefaultWalletLayout)
+* [Default Wallet Layout Example](http://godoc.org/github.com/btcsuite/btcd/btcutil/v2/hdkeychain#example-package--DefaultWalletLayout)
Demonstrates the default hierarchical deterministic wallet layout as described
in BIP0032.
-* [Audits Use Case Example](http://godoc.org/github.com/btcsuite/btcd/btcutil/hdkeychain#example-package--Audits)
+* [Audits Use Case Example](http://godoc.org/github.com/btcsuite/btcd/btcutil/v2/hdkeychain#example-package--Audits)
Demonstrates the audits use case in BIP0032.
## License
diff --git a/btcutil/hdkeychain/bench_test.go b/btcutil/hdkeychain/bench_test.go
index 285ef3e..9a76040 100644
--- a/btcutil/hdkeychain/bench_test.go
+++ b/btcutil/hdkeychain/bench_test.go
@@ -7,7 +7,7 @@ package hdkeychain_test
import (
"testing"
- "github.com/btcsuite/btcd/btcutil/hdkeychain"
+ "github.com/btcsuite/btcd/btcutil/v2/hdkeychain"
)
// bip0032MasterPriv1 is the master private extended key from the first set of
diff --git a/btcutil/hdkeychain/example_test.go b/btcutil/hdkeychain/example_test.go
index 8ea4244..5f4575b 100644
--- a/btcutil/hdkeychain/example_test.go
+++ b/btcutil/hdkeychain/example_test.go
@@ -7,8 +7,8 @@ package hdkeychain_test
import (
"fmt"
- "github.com/btcsuite/btcd/btcutil/hdkeychain"
- "github.com/btcsuite/btcd/chaincfg"
+ "github.com/btcsuite/btcd/btcutil/v2/hdkeychain"
+ "github.com/btcsuite/btcd/chaincfg/v2"
)
// This example demonstrates how to generate a cryptographically random seed
diff --git a/btcutil/hdkeychain/extendedkey.go b/btcutil/hdkeychain/extendedkey.go
index 8bbcdce..f8b23a1 100644
--- a/btcutil/hdkeychain/extendedkey.go
+++ b/btcutil/hdkeychain/extendedkey.go
@@ -18,11 +18,11 @@ import (
"fmt"
"math/big"
+ "github.com/btcsuite/btcd/address/v2"
+ "github.com/btcsuite/btcd/address/v2/base58"
"github.com/btcsuite/btcd/btcec/v2"
- "github.com/btcsuite/btcd/btcutil"
- "github.com/btcsuite/btcd/btcutil/base58"
- "github.com/btcsuite/btcd/chaincfg"
- "github.com/btcsuite/btcd/chaincfg/chainhash"
+ "github.com/btcsuite/btcd/chaincfg/v2"
+ "github.com/btcsuite/btcd/chainhash/v2"
)
const (
@@ -376,7 +376,7 @@ func (k *ExtendedKey) Derive(i uint32) (*ExtendedKey, error) {
// The fingerprint of the parent for the derived child is the first 4
// bytes of the RIPEMD160(SHA256(parentPubKey)).
- parentFP := btcutil.Hash160(k.pubKeyBytes())[:4]
+ parentFP := address.Hash160(k.pubKeyBytes())[:4]
return NewExtendedKey(k.version, childKey, childChainCode, parentFP,
k.depth+1, i, isPrivate), nil
}
@@ -462,7 +462,7 @@ func (k *ExtendedKey) DeriveNonStandard(i uint32) (*ExtendedKey, error) {
childKey = childKeyPub.SerializeCompressed()
}
- parentFP := btcutil.Hash160(k.pubKeyBytes())[:4]
+ parentFP := address.Hash160(k.pubKeyBytes())[:4]
return NewExtendedKey(k.version, childKey, childChainCode, parentFP,
k.depth+1, i, isPrivate), nil
}
@@ -554,9 +554,11 @@ func (k *ExtendedKey) ECPrivKey() (*btcec.PrivateKey, error) {
// Address converts the extended key to a standard bitcoin pay-to-pubkey-hash
// address for the passed network.
-func (k *ExtendedKey) Address(net *chaincfg.Params) (*btcutil.AddressPubKeyHash, error) {
- pkHash := btcutil.Hash160(k.pubKeyBytes())
- return btcutil.NewAddressPubKeyHash(pkHash, net)
+func (k *ExtendedKey) Address(net *chaincfg.Params) (*address.AddressPubKeyHash,
+ error) {
+
+ pkHash := address.Hash160(k.pubKeyBytes())
+ return address.NewAddressPubKeyHash(pkHash, net)
}
// paddedAppend appends the src byte slice to dst, returning the new slice.
diff --git a/btcutil/hdkeychain/extendedkey_test.go b/btcutil/hdkeychain/extendedkey_test.go
index 05ec2d6..ba01f94 100644
--- a/btcutil/hdkeychain/extendedkey_test.go
+++ b/btcutil/hdkeychain/extendedkey_test.go
@@ -17,7 +17,7 @@ import (
"reflect"
"testing"
- "github.com/btcsuite/btcd/chaincfg"
+ "github.com/btcsuite/btcd/chaincfg/v2"
secp_ecdsa "github.com/decred/dcrd/dcrec/secp256k1/v4"
)
diff --git a/btcutil/hdkeychain/test_coverage.txt b/btcutil/hdkeychain/test_coverage.txt
deleted file mode 100644
index c0bc7ef..0000000
--- a/btcutil/hdkeychain/test_coverage.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-
-github.com/conformal/btcutil/hdkeychain/extendedkey.go ExtendedKey.String 100.00% (18/18)
-github.com/conformal/btcutil/hdkeychain/extendedkey.go ExtendedKey.Zero 100.00% (9/9)
-github.com/conformal/btcutil/hdkeychain/extendedkey.go ExtendedKey.pubKeyBytes 100.00% (7/7)
-github.com/conformal/btcutil/hdkeychain/extendedkey.go ExtendedKey.Neuter 100.00% (6/6)
-github.com/conformal/btcutil/hdkeychain/extendedkey.go ExtendedKey.ECPrivKey 100.00% (4/4)
-github.com/conformal/btcutil/hdkeychain/extendedkey.go zero 100.00% (3/3)
-github.com/conformal/btcutil/hdkeychain/extendedkey.go ExtendedKey.SetNet 100.00% (3/3)
-github.com/conformal/btcutil/hdkeychain/extendedkey.go ExtendedKey.Address 100.00% (2/2)
-github.com/conformal/btcutil/hdkeychain/extendedkey.go newExtendedKey 100.00% (1/1)
-github.com/conformal/btcutil/hdkeychain/extendedkey.go ExtendedKey.IsPrivate 100.00% (1/1)
-github.com/conformal/btcutil/hdkeychain/extendedkey.go ExtendedKey.ParentFingerprint 100.00% (1/1)
-github.com/conformal/btcutil/hdkeychain/extendedkey.go ExtendedKey.ECPubKey 100.00% (1/1)
-github.com/conformal/btcutil/hdkeychain/extendedkey.go ExtendedKey.IsForNet 100.00% (1/1)
-github.com/conformal/btcutil/hdkeychain/extendedkey.go NewKeyFromString 95.83% (23/24)
-github.com/conformal/btcutil/hdkeychain/extendedkey.go ExtendedKey.Child 91.67% (33/36)
-github.com/conformal/btcutil/hdkeychain/extendedkey.go NewMaster 91.67% (11/12)
-github.com/conformal/btcutil/hdkeychain/extendedkey.go GenerateSeed 85.71% (6/7)
-github.com/conformal/btcutil/hdkeychain ----------------------------- 95.59% (130/136)
-
diff --git a/btcutil/psbt/creator.go b/btcutil/psbt/creator.go
index 58b9a54..60185ad 100644
--- a/btcutil/psbt/creator.go
+++ b/btcutil/psbt/creator.go
@@ -5,7 +5,7 @@
package psbt
import (
- "github.com/btcsuite/btcd/wire"
+ "github.com/btcsuite/btcd/wire/v2"
)
// MinTxVersion is the lowest transaction version that we'll permit.
diff --git a/btcutil/psbt/extractor.go b/btcutil/psbt/extractor.go
index 365e2f1..cf7e7b6 100644
--- a/btcutil/psbt/extractor.go
+++ b/btcutil/psbt/extractor.go
@@ -12,8 +12,8 @@ package psbt
import (
"bytes"
- "github.com/btcsuite/btcd/txscript"
- "github.com/btcsuite/btcd/wire"
+ "github.com/btcsuite/btcd/txscript/v2"
+ "github.com/btcsuite/btcd/wire/v2"
)
// Extract takes a finalized psbt.Packet and outputs a finalized transaction
diff --git a/btcutil/psbt/finalizer.go b/btcutil/psbt/finalizer.go
index b1bf12d..fa1d8f2 100644
--- a/btcutil/psbt/finalizer.go
+++ b/btcutil/psbt/finalizer.go
@@ -16,8 +16,8 @@ import (
"fmt"
"github.com/btcsuite/btcd/btcec/v2/schnorr"
- "github.com/btcsuite/btcd/txscript"
- "github.com/btcsuite/btcd/wire"
+ "github.com/btcsuite/btcd/txscript/v2"
+ "github.com/btcsuite/btcd/wire/v2"
)
// isFinalized considers this input finalized if it contains at least one of
diff --git a/btcutil/psbt/partial_input.go b/btcutil/psbt/partial_input.go
index 73595d2..2e784be 100644
--- a/btcutil/psbt/partial_input.go
+++ b/btcutil/psbt/partial_input.go
@@ -6,8 +6,8 @@ import (
"io"
"sort"
- "github.com/btcsuite/btcd/txscript"
- "github.com/btcsuite/btcd/wire"
+ "github.com/btcsuite/btcd/txscript/v2"
+ "github.com/btcsuite/btcd/wire/v2"
)
// PInput is a struct encapsulating all the data that can be attached to any
diff --git a/btcutil/psbt/partial_output.go b/btcutil/psbt/partial_output.go
index 86e4764..94b5d33 100644
--- a/btcutil/psbt/partial_output.go
+++ b/btcutil/psbt/partial_output.go
@@ -5,7 +5,7 @@ import (
"io"
"sort"
- "github.com/btcsuite/btcd/wire"
+ "github.com/btcsuite/btcd/wire/v2"
)
// POutput is a struct encapsulating all the data that can be attached
diff --git a/btcutil/psbt/psbt.go b/btcutil/psbt/psbt.go
index 5249aad..264f671 100644
--- a/btcutil/psbt/psbt.go
+++ b/btcutil/psbt/psbt.go
@@ -13,8 +13,8 @@ import (
"errors"
"io"
- "github.com/btcsuite/btcd/btcutil"
- "github.com/btcsuite/btcd/wire"
+ "github.com/btcsuite/btcd/btcutil/v2"
+ "github.com/btcsuite/btcd/wire/v2"
)
// psbtMagicLength is the length of the magic bytes used to signal the start of
diff --git a/btcutil/psbt/psbt_test.go b/btcutil/psbt/psbt_test.go
index 0dfa44c..1e0f4fe 100644
--- a/btcutil/psbt/psbt_test.go
+++ b/btcutil/psbt/psbt_test.go
@@ -13,10 +13,10 @@ import (
"strings"
"testing"
- "github.com/btcsuite/btcd/btcutil"
- "github.com/btcsuite/btcd/chaincfg/chainhash"
- "github.com/btcsuite/btcd/txscript"
- "github.com/btcsuite/btcd/wire"
+ "github.com/btcsuite/btcd/btcutil/v2"
+ "github.com/btcsuite/btcd/chainhash/v2"
+ "github.com/btcsuite/btcd/txscript/v2"
+ "github.com/btcsuite/btcd/wire/v2"
"github.com/davecgh/go-spew/spew"
"github.com/stretchr/testify/require"
)
diff --git a/btcutil/psbt/signer.go b/btcutil/psbt/signer.go
index dcbcf93..ad5e7fd 100644
--- a/btcutil/psbt/signer.go
+++ b/btcutil/psbt/signer.go
@@ -10,7 +10,7 @@ package psbt
// is in the correct state.
import (
- "github.com/btcsuite/btcd/txscript"
+ "github.com/btcsuite/btcd/txscript/v2"
)
// SignOutcome is a enum-like value that expresses the outcome of a call to the
diff --git a/btcutil/psbt/sort.go b/btcutil/psbt/sort.go
index 2232d68..11454ba 100644
--- a/btcutil/psbt/sort.go
+++ b/btcutil/psbt/sort.go
@@ -4,7 +4,7 @@ import (
"bytes"
"sort"
- "github.com/btcsuite/btcd/chaincfg/chainhash"
+ "github.com/btcsuite/btcd/chainhash/v2"
)
// InPlaceSort modifies the passed packet's wire TX inputs and outputs to be
diff --git a/btcutil/psbt/sort_test.go b/btcutil/psbt/sort_test.go
index 3dee0f4..4423d8b 100644
--- a/btcutil/psbt/sort_test.go
+++ b/btcutil/psbt/sort_test.go
@@ -4,8 +4,8 @@ import (
"reflect"
"testing"
- "github.com/btcsuite/btcd/chaincfg/chainhash"
- "github.com/btcsuite/btcd/wire"
+ "github.com/btcsuite/btcd/chainhash/v2"
+ "github.com/btcsuite/btcd/wire/v2"
)
func TestInPlaceSort(t *testing.T) {
diff --git a/btcutil/psbt/taproot.go b/btcutil/psbt/taproot.go
index 02a0e3a..117a1bf 100644
--- a/btcutil/psbt/taproot.go
+++ b/btcutil/psbt/taproot.go
@@ -6,8 +6,8 @@ import (
"math/bits"
"github.com/btcsuite/btcd/btcec/v2/schnorr"
- "github.com/btcsuite/btcd/txscript"
- "github.com/btcsuite/btcd/wire"
+ "github.com/btcsuite/btcd/txscript/v2"
+ "github.com/btcsuite/btcd/wire/v2"
)
const (
diff --git a/btcutil/psbt/updater.go b/btcutil/psbt/updater.go
index 66c8d1d..26329f8 100644
--- a/btcutil/psbt/updater.go
+++ b/btcutil/psbt/updater.go
@@ -14,9 +14,9 @@ import (
"bytes"
"crypto/sha256"
- "github.com/btcsuite/btcd/btcutil"
- "github.com/btcsuite/btcd/txscript"
- "github.com/btcsuite/btcd/wire"
+ "github.com/btcsuite/btcd/txscript/v2"
+ "github.com/btcsuite/btcd/wire/v2"
+ "github.com/btcsuite/btcutil/v2"
)
// Updater encapsulates the role 'Updater' as specified in BIP174; it accepts
diff --git a/btcutil/psbt/utils.go b/btcutil/psbt/utils.go
index c47f6af..2c880e2 100644
--- a/btcutil/psbt/utils.go
+++ b/btcutil/psbt/utils.go
@@ -12,8 +12,8 @@ import (
"io"
"sort"
- "github.com/btcsuite/btcd/txscript"
- "github.com/btcsuite/btcd/wire"
+ "github.com/btcsuite/btcd/txscript/v2"
+ "github.com/btcsuite/btcd/wire/v2"
)
// WriteTxWitness is a utility function due to non-exported witness
diff --git a/btcutil/psbt/utils_test.go b/btcutil/psbt/utils_test.go
index 90593ff..28eaa96 100644
--- a/btcutil/psbt/utils_test.go
+++ b/btcutil/psbt/utils_test.go
@@ -5,8 +5,8 @@ import (
"reflect"
"testing"
- "github.com/btcsuite/btcd/chaincfg/chainhash"
- "github.com/btcsuite/btcd/wire"
+ "github.com/btcsuite/btcd/chainhash/v2"
+ "github.com/btcsuite/btcd/wire/v2"
)
func TestSumUtxoInputValues(t *testing.T) {
diff --git a/btcutil/tx.go b/btcutil/tx.go
index 4f26bef..c66f81b 100644
--- a/btcutil/tx.go
+++ b/btcutil/tx.go
@@ -8,8 +8,8 @@ import (
"bytes"
"io"
- "github.com/btcsuite/btcd/chaincfg/chainhash"
- "github.com/btcsuite/btcd/wire"
+ "github.com/btcsuite/btcd/chainhash/v2"
+ "github.com/btcsuite/btcd/wire/v2"
)
// TxIndexUnknown is the value returned for a transaction index that is unknown.
diff --git a/btcutil/tx_test.go b/btcutil/tx_test.go
index 71b7488..52447ae 100644
--- a/btcutil/tx_test.go
+++ b/btcutil/tx_test.go
@@ -10,8 +10,8 @@ import (
"reflect"
"testing"
- "github.com/btcsuite/btcd/btcutil"
- "github.com/btcsuite/btcd/chaincfg/chainhash"
+ "github.com/btcsuite/btcd/btcutil/v2"
+ "github.com/btcsuite/btcd/chainhash/v2"
"github.com/davecgh/go-spew/spew"
)
diff --git a/btcutil/txsort/README.md b/btcutil/txsort/README.md
index cb8e413..dd04683 100644
--- a/btcutil/txsort/README.md
+++ b/btcutil/txsort/README.md
@@ -22,7 +22,7 @@ A comprehensive suite of tests is provided to ensure proper functionality.
## Installation and Updating
```bash
-$ go get -u github.com/btcsuite/btcd/btcutil/txsort
+$ go get -u github.com/btcsuite/btcd/btcutil/v2/txsort
```
## License
diff --git a/btcutil/txsort/txsort.go b/btcutil/txsort/txsort.go
index f72a7db..b8bb96c 100644
--- a/btcutil/txsort/txsort.go
+++ b/btcutil/txsort/txsort.go
@@ -11,8 +11,8 @@ import (
"bytes"
"sort"
- "github.com/btcsuite/btcd/chaincfg/chainhash"
- "github.com/btcsuite/btcd/wire"
+ "github.com/btcsuite/btcd/chainhash/v2"
+ "github.com/btcsuite/btcd/wire/v2"
)
// InPlaceSort modifies the passed transaction inputs and outputs to be sorted
diff --git a/btcutil/txsort/txsort_test.go b/btcutil/txsort/txsort_test.go
index 16a3e61..d28c07a 100644
--- a/btcutil/txsort/txsort_test.go
+++ b/btcutil/txsort/txsort_test.go
@@ -11,8 +11,8 @@ import (
"path/filepath"
"testing"
- "github.com/btcsuite/btcd/btcutil/txsort"
- "github.com/btcsuite/btcd/wire"
+ "github.com/btcsuite/btcd/btcutil/v2/txsort"
+ "github.com/btcsuite/btcd/wire/v2"
)
// TestSort ensures the transaction sorting works according to the BIP.
diff --git a/btcutil/wif.go b/btcutil/wif.go
index 26316dd..4ea06aa 100644
--- a/btcutil/wif.go
+++ b/btcutil/wif.go
@@ -8,10 +8,11 @@ import (
"bytes"
"errors"
+ "github.com/btcsuite/btcd/address/v2"
+ "github.com/btcsuite/btcd/address/v2/base58"
"github.com/btcsuite/btcd/btcec/v2"
- "github.com/btcsuite/btcd/btcutil/base58"
- "github.com/btcsuite/btcd/chaincfg"
- "github.com/btcsuite/btcd/chaincfg/chainhash"
+ "github.com/btcsuite/btcd/chaincfg/v2"
+ "github.com/btcsuite/btcd/chainhash/v2"
)
// ErrMalformedPrivateKey describes an error where a WIF-encoded private
@@ -112,7 +113,7 @@ func DecodeWIF(wif string) (*WIF, error) {
}
cksum := chainhash.DoubleHashB(tosum)[:4]
if !bytes.Equal(cksum, decoded[decodedLen-4:]) {
- return nil, ErrChecksumMismatch
+ return nil, address.ErrChecksumMismatch
}
netID := decoded[0]
diff --git a/btcutil/wif_test.go b/btcutil/wif_test.go
index c255c1b..37d3e46 100644
--- a/btcutil/wif_test.go
+++ b/btcutil/wif_test.go
@@ -9,9 +9,10 @@ import (
"encoding/hex"
"testing"
+ "github.com/btcsuite/btcd/address/v2"
"github.com/btcsuite/btcd/btcec/v2"
- . "github.com/btcsuite/btcd/btcutil"
- "github.com/btcsuite/btcd/chaincfg"
+ . "github.com/btcsuite/btcd/btcutil/v2"
+ "github.com/btcsuite/btcd/chaincfg/v2"
)
func TestEncodeDecodeWIF(t *testing.T) {
@@ -119,7 +120,7 @@ func TestEncodeDecodeWIF(t *testing.T) {
{
name: "decodeInvalidChecksumWif",
wif: "5HueCGU8rMjxEXxiPuD5BDku4MkFqeZyd4dZ1jvhTVqvbTLvyTj",
- err: ErrChecksumMismatch,
+ err: address.ErrChecksumMismatch,
},
}
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.