For reviewers
In an attempt to make reviewing a bit more sane, I’m breaking this up into a few smaller PRs, but will keep this one open as the parent PR and keep it rebased on the child PRs. The main purpose of having this PR is to track progress on child PRs and also have an easy way to compile bitcoind
with both send and receive support for testing. Additionally, I’ll be adding more functional tests to this PR since it’s much easier to test when bitcoind
can both send and receive.
PRs
- #28122
- Implements the logic from BIP352 without any wallet code. This PR adds the necessary cryptographic functions and implements the logic needed for sending and scanning. This PR also includes the test vectors from the BIP as unit tests. Both the send and receive PRs have this as a dependency. In terms of priority, this PR should be reviewed first
- #28201
- Implements sending in the Bitcoin Core wallet. This PR allows a wallet to send to a silent payment address, regardless of whether or not the wallet can receive silent payments
- Ready for review, but marked as a draft until dependencies are merged
- #28202
- Implements receiving in the Bitcoin Core wallet. This PR allows a wallet to generate silent payment addresses and scan for silent payments, regardless of whether or not the wallet can send to a silent payment address
- Ready for review but marked as a draft until dependencies are merged
For the silent payments specification, see https://github.com/bitcoin/bips/pull/1458
Overall
This PR implements the full silent payments scheme: sending and receiving. The following items are not covered in this PR and are intended for follow-up PRs:
- Adding labels for the receiver wallet
- Full RPC coverage (only
sendtoaddress
andsendmany
are covered in this PR) - Light client support (vending the tweak data per block, either in an index or to serve to indexer, such as electrum server)
- Add benchmarks to validate that there are no DoS concerns for doing silent payment verification for transactions in the mempool
- External signer support (dependent on hardware wallets supporting silent payments)
- More unit / functional test coverage
Major changes
This PR is a continuation of the work done in #24897. Below is a summary of the major changes:
- Remove labels
- The original draft included labels, but this has been deferred for a later PR. Labels are not necessary for sending and receiving and there are still some open questions on how best to implement them in Bitcoin Core. Labels can also be added at any point by the receiver without requiring any changes from the sender
- Remove indexes
- In the original draft, indexes were used when scanning for silent payments and when doing wallet rescans. This has been removed in favor of using
rev*.dat
files for rescanning. It may make sense to add an index in the future, but for the purpose of vending tweak data to light clients, which is still an open question
- In the original draft, indexes were used when scanning for silent payments and when doing wallet rescans. This has been removed in favor of using
- Update to implement the most current version of BIP352
- Since the original draft, there have been a few changes in the BIP which are reflected in the current PR. Most notably, using 33-byte compressed keys for the silent payment address (as opposed to X-only keys in the original draft)
It may be helpful for context to read through the discussions on #24897 , but ongoing review should happen in the relevant child PRs listed above.