![]() |
Bitcoin Core 32.99.0
P2P Digital Currency
|
A silent payments recipient's scanning identity. More...
#include <bip352.h>
Public Member Functions | |
| SilentPaymentsReceiver (const CKey &scan_key, const CPubKey &spend_pubkey, const LabelTweakMap &labels={}) | |
| ~SilentPaymentsReceiver () | |
| SilentPaymentsReceiver (SilentPaymentsReceiver &&)=delete | |
| SilentPaymentsReceiver & | operator= (SilentPaymentsReceiver &&)=delete |
| SilentPaymentsReceiver (const SilentPaymentsReceiver &)=delete | |
| SilentPaymentsReceiver & | operator= (const SilentPaymentsReceiver &)=delete |
| const LabelTweakMap & | GetLabels () const |
| Get this recipient's registered labels, including the change label. More... | |
| SilentPaymentsDestination | GenerateLabeledAddress (uint32_t m) |
Register label m (e.g. More... | |
| SilentPaymentsDestination | GetChangeDestination () const |
| Get this recipient's silent payments change destination. More... | |
| std::optional< std::vector< SilentPaymentsOutput > > | Scan (const PrevoutsSummary &prevouts_summary, const std::vector< XOnlyPubKey > &tx_outputs) const |
| Scan a transaction for silent payments outputs. More... | |
Private Member Functions | |
| SilentPaymentsDestination | BuildLabeledDestination (const SilentPaymentsLabel &label) const |
Private Attributes | |
| CKey | m_scan_key |
| CPubKey | m_spend_pubkey |
| std::unique_ptr< secp256k1_pubkey > | m_spend_pubkey_obj |
| LabelTweakMap | m_labels |
| LabelTweakMap::const_iterator | m_change_it |
A silent payments recipient's scanning identity.
Bundles a recipient's scan key, spend public key, and known labels (always including the change label) into a single self-contained object capable of scanning transactions and deriving the recipient's change destination.
The change label is created automatically on construction if one is not supplied through the labels map; additional labels are registered on creation with GenerateLabeledAddress().
| bip352::SilentPaymentsReceiver::SilentPaymentsReceiver | ( | const CKey & | scan_key, |
| const CPubKey & | spend_pubkey, | ||
| const LabelTweakMap & | labels = {} |
||
| ) |
|
default |
|
delete |
|
delete |
|
private |
Definition at line 428 of file bip352.cpp.
| SilentPaymentsDestination bip352::SilentPaymentsReceiver::GenerateLabeledAddress | ( | uint32_t | m | ) |
Register label m (e.g.
for a labeled sub-address to hand out to a payer) and generate the resulting address.
Derives the label from this recipient's own scan key and m, registers it so Scan() can recognize outputs sent to it, and returns the address to hand out.
| m | An integer m, greater than 0 (m = 0 is reserved for the change label). |
B_spend -> B_spend + label. Definition at line 435 of file bip352.cpp.
| SilentPaymentsDestination bip352::SilentPaymentsReceiver::GetChangeDestination | ( | ) | const |
Get this recipient's silent payments change destination.
B_spend -> B_spend + change_label. Definition at line 441 of file bip352.cpp.
| const LabelTweakMap & bip352::SilentPaymentsReceiver::GetLabels | ( | ) | const |
Get this recipient's registered labels, including the change label.
Definition at line 424 of file bip352.cpp.
|
delete |
|
delete |
| std::optional< std::vector< SilentPaymentsOutput > > bip352::SilentPaymentsReceiver::Scan | ( | const PrevoutsSummary & | prevouts_summary, |
| const std::vector< XOnlyPubKey > & | tx_outputs | ||
| ) | const |
Scan a transaction for silent payments outputs.
Scan the transaction for silent payments outputs intended for this recipient. The output, shared secret tweak, and (optionally) label public key is returned for each output found. If the output was sent to a labeled address, the label tweak is added to the shared secret tweak. The shared secret tweak is needed to spend the output, by adding it to the spend secret key. If no outputs are found, this transaction does not contain silent payments outputs for this recipient.
| prevouts_summary | The silent payments public data. |
| tx_outputs | The taproot output public keys. |
Definition at line 445 of file bip352.cpp.
|
private |
|
private |
|
private |
|
private |