|
| util::Expected< SilentPaymentsDestination, std::string > | DecodeSilentPaymentsAddress (const std::string &str, const CChainParams ¶ms) |
| | Decode a BIP352 "sp1..." address. Returns the destination, or an error message on failure. More...
|
| |
| std::optional< PubKey > | GetPubKeyFromInput (const CTxIn &txin, const CScript &spk) |
| | Get the public key from an input. More...
|
| |
| static std::optional< PrevoutsSummary > | CreateInputPubkeysTweak (const std::vector< CPubKey > &plain_pubkeys, const std::vector< XOnlyPubKey > &taproot_pubkeys, const COutPoint &smallest_outpoint) |
| |
| util::Expected< PrevoutsSummary, PrevoutsSummaryError > | GetSilentPaymentsPrevoutsSummary (const std::vector< CTxIn > &vin, const std::map< COutPoint, Coin > &coins) |
| | Get silent payments public data from transaction inputs. More...
|
| |
| static std::optional< std::vector< secp256k1_xonly_pubkey > > | CreateOutputs (const std::vector< SilentPaymentsDestination > &recipients, const std::vector< CKey > &plain_keys, const std::vector< KeyPair > &taproot_keypairs, const COutPoint &smallest_outpoint) |
| |
| std::optional< std::map< size_t, WitnessV1Taproot > > | GenerateSilentPaymentsTaprootDestinations (const std::map< size_t, SilentPaymentsDestination > &sp_dests, const std::vector< CKey > &plain_keys, const std::vector< KeyPair > &taproot_keys, const COutPoint &smallest_outpoint) |
| | Generate silent payments taproot destinations. More...
|
| |
| static const unsigned char * | LabelLookupCallback (const unsigned char *key, const void *context) |
| |
| static std::pair< SilentPaymentsLabel, uint256 > | CreateLabel (const CKey &scan_key, const uint32_t m) |
| |
| static CPubKey | CreateLabeledSpendPubKey (const CPubKey &spend_pubkey, const SilentPaymentsLabel &label) |
| |
| CKey | ParseHexToCKey (std::string_view hex) |
| |
| | BOOST_AUTO_TEST_CASE (bip352_send_and_receive_test_vectors) |
| |
| | BOOST_AUTO_TEST_CASE (bip352_preserves_requested_output_indexes) |
| |
| | BOOST_AUTO_TEST_CASE (bip352_skips_transactions_spending_unknown_segwit_versions) |
| |
| | BOOST_AUTO_TEST_CASE (bip352_scan_skips_invalid_taproot_outputs) |
| |
| | BOOST_AUTO_TEST_CASE (bip352_label_serialize_roundtrip) |
| |
| | BOOST_AUTO_TEST_CASE (bip352_decode_address) |
| |
Generate silent payments taproot destinations.
Given a set of silent payments destinations, generate the requested number of outputs. If a silent payment destination is repeated, this indicates multiple outputs are requested for the same recipient. The silent payment destinations are passed in a map where the key indicates their desired position in the final tx.vout array.
- Parameters
-
| sp_dests | The silent payments destinations. |
| plain_keys | The private keys for non-taproot inputs. |
| taproot_keys | The keypairs for taproot inputs. |
| smallest_outpoint | The smallest_outpoint from the transaction inputs. |
- Precondition
- smallest_outpoint is not null, and at least one of plain_keys or taproot_keys is non-empty.
- Returns
- The generated silent payments taproot destinations or std::nullopt if the set of provided inputs is invalid:
- The size of any group (i.e. recipients sharing the same scan public key) exceeds the protocol limit SECP256K1_SILENTPAYMENTS_RECIPIENT_GROUP_LIMIT.
- There is an invalid key in the set.
- The inputs sum to zero.
Definition at line 353 of file bip352.cpp.
| std::optional< PubKey > bip352::GetPubKeyFromInput |
( |
const CTxIn & |
txin, |
|
|
const CScript & |
spk |
|
) |
| |
Get the public key from an input.
Get the public key from a silent payments eligible input. This requires knowledge of the prevout scriptPubKey to determine the type of input and whether or not it is eligible for silent payments.
If the input is not eligible for silent payments, the input is skipped (indicated by returning a nullopt).
- Parameters
-
| txin | The transaction input. |
| spk | The scriptPubKey of the prevout. |
- Returns
- The public key, or nullopt if not found.
Definition at line 143 of file bip352.cpp.
Get silent payments public data from transaction inputs.
Get the necessary data from the transaction inputs to be able to scan the transaction outputs for silent payments outputs. This requires knowledge of the prevout scriptPubKey, which is passed via coins.
This function returns the public key sum and the input hash separately and is intended to be used by the wallet when scanning a transaction.
If there are no eligible inputs, or one of the inputs spends an unknown segwit version (i.e > 1), this transaction is not eligible to be scanned for silent payments outputs; see PrevoutsSummaryError.
- Parameters
-
| vin | The transaction inputs. |
| coins | The coins (potentially) spent in this transaction. |
- Returns
- util::Expected<PrevoutsSummary, PrevoutsSummaryError> The silent payments public data, or the reason it could not be computed.
Definition at line 255 of file bip352.cpp.