Bitcoin Core 31.99.0
P2P Digital Currency
secp256k1_silentpayments.h
Go to the documentation of this file.
1#ifndef SECP256K1_SILENTPAYMENTS_H
2#define SECP256K1_SILENTPAYMENTS_H
3
4#include <stdint.h>
5#include "secp256k1.h"
7
8#ifdef __cplusplus
9extern "C" {
10#endif
11
30/* Maximum number of Silent Payments recipients per group (i.e.
31 * recipients sharing the same scan public key) as per BIP-352 */
32#define SECP256K1_SILENTPAYMENTS_RECIPIENT_GROUP_LIMIT 2323
33
52 size_t index;
54
124 const secp256k1_context *ctx,
125 secp256k1_xonly_pubkey **generated_outputs,
126 const secp256k1_silentpayments_recipient **recipients,
127 size_t n_recipients,
128 const unsigned char *outpoint_smallest36,
129 const secp256k1_keypair * const *keypairs,
130 size_t n_keypairs,
131 const unsigned char * const *seckeys,
132 size_t n_seckeys
134
142 unsigned char data[68];
144
153 const secp256k1_context *ctx,
155 const unsigned char *in33
157
166 const secp256k1_context *ctx,
167 unsigned char *out33,
170
201 const secp256k1_context *ctx,
203 unsigned char *label_tweak32,
204 const unsigned char *scan_key32,
205 uint32_t m
207
229 const secp256k1_context *ctx,
230 secp256k1_pubkey *labeled_spend_pubkey,
231 const secp256k1_pubkey *unlabeled_spend_pubkey,
234
244 unsigned char data[101];
246
284 const secp256k1_context *ctx,
286 const unsigned char *outpoint_smallest36,
287 const secp256k1_xonly_pubkey * const *xonly_pubkeys,
288 size_t n_xonly_pubkeys,
289 const secp256k1_pubkey * const *pubkeys,
290 size_t n_pubkeys
292
310typedef const unsigned char* (*secp256k1_silentpayments_label_lookup)(const unsigned char* label33, const void* label_context);
311
325 unsigned char tweak[32];
329
383 const secp256k1_context *ctx,
385 uint32_t *n_found_outputs,
386 const secp256k1_xonly_pubkey * const *tx_outputs,
387 size_t n_tx_outputs,
388 const unsigned char *scan_key32,
389 const secp256k1_silentpayments_prevouts_summary *prevouts_summary,
390 const secp256k1_pubkey *unlabeled_spend_pubkey,
392 const void *label_context
394
395#ifdef __cplusplus
396}
397#endif
398
399#endif /* SECP256K1_SILENTPAYMENTS_H */
static const PrecomputedData data
Precomputed COutPoint and CCoins values.
static int tweak(const secp256k1_context *ctx, secp256k1_xonly_pubkey *agg_pk, secp256k1_musig_keyagg_cache *cache)
Definition: musig.c:64
#define SECP256K1_ARG_NONNULL(_x)
Definition: secp256k1.h:189
#define SECP256K1_API
Definition: secp256k1.h:173
#define SECP256K1_WARN_UNUSED_RESULT
Definition: secp256k1.h:184
SECP256K1_API int secp256k1_silentpayments_recipient_label_serialize(const secp256k1_context *ctx, unsigned char *out33, const secp256k1_silentpayments_label *label) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3)
Serialize a Silent Payments label.
Definition: main_impl.h:378
struct secp256k1_silentpayments_prevouts_summary secp256k1_silentpayments_prevouts_summary
Opaque data structure that holds Silent Payments prevouts summary data.
struct secp256k1_silentpayments_recipient secp256k1_silentpayments_recipient
The data from a single recipient address.
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_silentpayments_recipient_prevouts_summary_create(const secp256k1_context *ctx, secp256k1_silentpayments_prevouts_summary *prevouts_summary, const unsigned char *outpoint_smallest36, const secp256k1_xonly_pubkey *const *xonly_pubkeys, size_t n_xonly_pubkeys, const secp256k1_pubkey *const *pubkeys, size_t n_pubkeys) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3)
Compute Silent Payments prevouts summary from prevout public keys and transaction inputs.
Definition: main_impl.h:488
struct secp256k1_silentpayments_found_output secp256k1_silentpayments_found_output
Found outputs struct.
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_silentpayments_recipient_label_parse(const secp256k1_context *ctx, secp256k1_silentpayments_label *label, const unsigned char *in33) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3)
Parse a Silent Payments label.
Definition: main_impl.h:362
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_silentpayments_sender_create_outputs(const secp256k1_context *ctx, secp256k1_xonly_pubkey **generated_outputs, const secp256k1_silentpayments_recipient **recipients, size_t n_recipients, const unsigned char *outpoint_smallest36, const secp256k1_keypair *const *keypairs, size_t n_keypairs, const unsigned char *const *seckeys, size_t n_seckeys) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(5)
Create Silent Payments outputs for recipient(s).
Definition: main_impl.h:187
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_silentpayments_recipient_create_labeled_spend_pubkey(const secp256k1_context *ctx, secp256k1_pubkey *labeled_spend_pubkey, const secp256k1_pubkey *unlabeled_spend_pubkey, const secp256k1_silentpayments_label *label) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4)
Create Silent Payments labeled spend public key.
Definition: main_impl.h:430
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_silentpayments_recipient_scan_outputs(const secp256k1_context *ctx, secp256k1_silentpayments_found_output **found_outputs, uint32_t *n_found_outputs, const secp256k1_xonly_pubkey *const *tx_outputs, size_t n_tx_outputs, const unsigned char *scan_key32, const secp256k1_silentpayments_prevouts_summary *prevouts_summary, const secp256k1_pubkey *unlabeled_spend_pubkey, secp256k1_silentpayments_label_lookup label_lookup, const void *label_context) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4) SECP256K1_ARG_NONNULL(6) SECP256K1_ARG_NONNULL(7) SECP256K1_ARG_NONNULL(8)
Scan for Silent Payments transaction outputs.
Definition: main_impl.h:603
struct secp256k1_silentpayments_label secp256k1_silentpayments_label
Opaque data structure that holds a Silent Payments label.
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_silentpayments_recipient_label_create(const secp256k1_context *ctx, secp256k1_silentpayments_label *label, unsigned char *label_tweak32, const unsigned char *scan_key32, uint32_t m) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4)
Create Silent Payments label tweak and label.
Definition: main_impl.h:393
const unsigned char *(* secp256k1_silentpayments_label_lookup)(const unsigned char *label33, const void *label_context)
Type of callback function for label lookups.
const unsigned char * label_lookup(const unsigned char *label33, const void *cache_ptr)
Opaque data structure that holds a keypair consisting of a secret and a public key.
Opaque data structure that holds a parsed and valid public key.
Definition: secp256k1.h:62
Opaque data structure that holds a Silent Payments label.
Opaque data structure that holds Silent Payments prevouts summary data.
The data from a single recipient address.
Opaque data structure that holds a parsed and valid "x-only" public key.