This PR is part of integrating silent payments into Bitcoin Core. It is the second iteration of #28201. Status and tracking for the project is managed in #28536
Prerequisite PRs:
Sending
Silent Payments logic The main focus of this PR is:
- Applying the Taptweak to a taproot internal private key (this is a copy-paste of the code for applying the taptweak in the signing process)
- Getting a private key from a given scriptPubKey
- Creating silent payment outputs
- Applying the created scriptPubKeys back to the vector of CRecipients
- The functions are then used together to create silent payment outputs during CreateTransactionInternal.
Final steps The last commits ensure that:
- Coin selection is silent payments aware and knows to exclude taproot script path spends and inputs with unknown witness when funding a transaction which pays to a silent payment address
- The change output type is correctly chosen when paying to a silent payment address
- Functional tests