btcd v0.22.0-beta

This release of `btcd` is primarily to act as a catchup for the various changes that have accumulated. # Verifying the Release In order to verify the release, you'll need to have `gpg` or `gpg2` installed on your system. Once you've obtained a copy (and hopefully verified that as well), you'll first need to import the keys that have signed this release if you haven't done so already: Once you have the required PGP keys, you can verify the release (assuming `manifest-v0.22.0-beta.txt` and `manifest-v0.22.0-beta.txt.sig` are in the current directory) with: ``` gpg --verify manifest-v0.22.0-beta.txt.sig ``` You should see the following if the verification was successful: ``` gpg: assuming signed data in 'manifest-v0.22.0-beta.txt' gpg: Signature made Tue 08 Jun 2021 10:07:53 AM EDT gpg: using DSA key 0DB39EAF526568682088EEDFB15210D35378BD54 gpg: Good signature from "John C. Vernaleo " [ultimate] ``` That will verify the signature of the manifest file, which ensures integrity and authenticity of the archive you've downloaded locally containing the binaries. Next, depending on your operating system, you should then re-compute the `sha256` hash of the archive with `shasum -a 256 `, compare it with the corresponding one in the manifest file, and ensure they match *exactly*. ## Verifying the Release Binaries As of this release, our release binaries are **fully reproducible** thanks to `go1.13`! Third parties are now able to verify that the release binaries were produced properly without having to trust the release manager(s). See our [reproducible builds guide](https://github.com/btcsuite/btcd/tree/master/release) for how this can be achieved. The release binaries are compiled with `go1.16.5`, which is required by verifiers to arrive at the same ones. Finally, you can also verify the _tag_ itself with the following command: ``` git verify-tag v0.22.0-beta ``` You should see something along the lines of this in the case of a valid tag: ``` gpg: Signature made Tue 08 Jun 2021 09:42:52 AM EDT gpg: using DSA key 0DB39EAF526568682088EEDFB15210D35378BD54 gpg: Good signature from "John C. Vernaleo " [ultimate] ``` # Building the Contained Release Users are able to rebuild the target release themselves without having to fetch any of the dependencies. In order to do so, assuming that `vendor.tar.gz` and `btcd-source-v0.22.0-beta.tar.gz` are in the current directory, follow these steps: ``` tar -xvzf vendor.tar.gz tar -xvzf btcd-source-v0.22.0.tar.gz GO111MODULE=on go install -v -mod=vendor GO111MODULE=on go install -v -mod=vendor ./cmd/btcctl ``` The `-mod=vendor` flag tells the `go build` command that it doesn't need to fetch the dependencies, and instead, they're all enclosed in the local vendor directory. Additionally, it's also possible to use the enclosed `release.sh` script to bundle a release for a _specific_ system like so: ``` BTCBUILDSYS="linux-arm64 darwin-amd64" ./build/release/release.sh ``` # Release Notes #### Protocol and network-related changes: * Added support for witness tx and block in `notfound` msg. (#1625) * Added support for receiving `sendaddrv2` messages from a peer. (#1670) * Fixed bug in `peer` package causing last block height to go backwards. (#1606) * Added chain parameters for connecting to the public Signet network. (#1692, #1718) Also added `--signet` command line flag to `btcctl` and `btcd` utilities. #### Crypto changes: * Fixed bug causing panic due to bad R and S signature components in `btcec.RecoverCompact`. (#1691) * Set the name (`secp256k1`) in the CurveParams of the S256 curve. (#1565) #### Notable developer-related package changes: * Improve gc for `txscript.IsUnspendable` method. (#1615) Significantly reduced allocations, which should bring a performance gain during sync. * Used `RLock`/`RUnlock` when possible in the `addrmgr` package. (#1697) * Removed unknown block version warning in the `blockchain` package, due to false positives triggered by AsicBoost. (#1463) * Added proper types for flag field and improve docs, for `msgtx` in the `wire` package. (#1632) * Added `chaincfg.RegisterHDKeyID` function to populate HD key ID pairs. (#1617) * Fixed flaky hash cache test due to resetting RNG. (#1689) * Added new method `mining.AddWitnessCommitment` to add the witness commitment as an `OP_RETURN` output within the coinbase transaction. (#1716) #### RPC changes: * Implemented Batch JSON-RPC in `rpcclient` and server. (#1583) Please refer to `rpcclient/examples/bitcoincorehttpbulk/README.md` for examples. * Implemented `rpcclient` method to invoke `getdescriptorinfo` JSON-RPC command. (#1578) * Updated the `rpcserver` handler for `validateaddress` JSON-RPC command to have parity with the bitcoind 0.20.0 interface. (#1613) * Implemented `rpcclient` method to invoke `getblockfilter` JSON-RPC command. (#1579) * Implemented `signmessagewithprivkey` JSON-RPC command in rpcserver. (#1585) * Implemented `rpcclient` method to invoke `importmulti` JSON-RPC command. (#1579) * Implemented `watchOnly` argument in `rpcclient` method to invoke `listtransactions` JSON-RPC command. (#1628) * Updated `btcjson.ListTransactionsResult` for compatibility with Bitcoin Core 0.20.0. (#1626) Two new fields `BlockHeight` and `Label` were added as optional, to keep backwards compatibility. * Implemented nullable optional JSON-RPC parameters. (#1594) Fixed command marshalling dropping params that follow params with `nil` value. * Implemented `rpcclient` and server method to invoke `getnodeaddresses` JSON-RPC command. (#1590) * Implemented `rpcclient` methods to invoke PSBT JSON-RPC commands. (#1596) The `walletcreatefundedpsbt` and `walletprocesspsbt` commands were implemented. * Implemented `rpcclient` method to invoke `listsinceblock` with the `include_watchonly` parameter enabled. (#1451) * Implemented `rpcclient` method to invoke `deriveaddresses` JSON-RPC command. (#1631) * Implemented `rpcclient` method to invoke `getblocktemplate` JSON-RPC command. (#1629) The corresponding `btcjson` structs were also updated to reflect changes in Bitcoin Core. * Implemented `rpcclient` method to invoke `getaddressinfo` JSON-RPC command. (#1633) * Implemented `rpcclient` method to invoke `getwalletinfo` JSON-RPC command. (#1638) * Fixed error message in rpcserver when an unknown RPC command is encountered. (#1695) * Fixed error message returned by `estimatefee` when the number of blocks exceeds the max depth. (#1678) * Updated `btcjson.GetBlockChainInfoResult` to include new fields in Bitcoin Core. (#1676) Two new fields `InitialBlockDownload` and `SizeOnDisk` were added. * Added `ExtraHeaders` in `rpcclient.ConnConfig` struct. (#1669) It's useful when the RPC provider needs customized headers, for example, the `X-Auth-Token` header. * Fixed bitcoind compatibility issue with the `sendrawtransaction` JSON-RPC command. (#1659) * Added new JSON-RPC errors to `btcjson` package, and documented them. (#1648) * Implemented `rpcclient` method to invoke `createwallet` JSON-RPC command. (#1650) This is also the first `rpcclient` method that uses the functional options pattern, which will be used more and more in future. * Implemented `rpcclient` methods to invoke `backupwallet`, `dumpwallet`, `loadwallet` and `unloadwallet` JSON-RPC commands. (#1645) * Fixed unmarshalling error in `getmininginfo` JSON-RPC command, for valid integers in scientific notation. (#1644) * Implemented `rpcclient` method to invoke `gettxoutsetinfo` JSON-RPC command. (#1641) * Implemented `rpcclient` method to invoke `signrawtransactionwithwallet` JSON-RPC command. (#1642) * Added `txid` to `getblocktemplate` response of rpcserver. (#1639) * Fixed monetary unit used in `createrawtransaction` JSON-RPC command in rpcserver. (#1614) * Added `rawtx` field to `btcjson.GetBlockVerboseTxResult` to provide backwards compatibility with older versions of Bitcoin Core. (#1677) #### Misc changes: * Updated `btcutil` dependency. (#1704) * Updated documentation links to use https://pkg.go.dev instead of http://godoc.org. (#1693) * Added Dockerfile to build and run btcd on Docker. (#1465) * Reworked documentation and published on https://btcd.readthedocs.io. (#1468) * Added support for Go 1.15. (#1619) * Added Go 1.14 as the minimum supported version of Golang. (#1621) * Removed unnecessary `GOMAXPROCS` function calls. (#1627) * Enabled Go Race detector and code coverage on GitHub Actions. (#1601) ## Changelog The full list of changes since `v0.21.0-beta` can be found here: * https://github.com/btcsuite/btcd/compare/v0.21.0-beta..v0.22.0-beta # Contributors (Alphabetical Order) 10gic Andrew Tugarinov Anirudha Bose Appelberg-s Armando Ochoa Aurèle Oulès Calvin Kim Christian Lehmann Conner Fromknecht Dan Cline David Mazary Elliott Minns Federico Bond Friedger Müffke Gustavo Chain Hanjun Kim Henry Fisher Iskander Sharipov Jake Sylvestre Johan T. Halseth John C. Vernaleo Liran Sharir Mikael Lindlof Olaoluwa Osuntokun Oliver Gugger Rjected Steven Kreuzer Torkel Rogstad Tristyn Victor Lavaud Vinayak Borkar Wilmer Paulino Yaacov Akiba Slama ebiiim ipriver wakiyamap yyforyongyu