Bitcoin Core 30.99.0
P2P Digital Currency
Classes | Functions | Variables
musig.h File Reference
#include <pubkey.h>
#include <optional>
#include <vector>
Include dependency graph for musig.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  MuSig2SecNonce
 MuSig2SecNonce encapsulates a secret nonce in use in a MuSig2 signing session. More...
 

Functions

std::optional< CPubKeyMuSig2AggregatePubkeys (const std::vector< CPubKey > &pubkeys, secp256k1_musig_keyagg_cache &keyagg_cache, const std::optional< CPubKey > &expected_aggregate)
 Compute the full aggregate pubkey from the given participant pubkeys in their current order. More...
 
std::optional< CPubKeyMuSig2AggregatePubkeys (const std::vector< CPubKey > &pubkeys)
 
CExtPubKey CreateMuSig2SyntheticXpub (const CPubKey &pubkey)
 Construct the BIP 328 synthetic xpub for a pubkey. More...
 
uint256 MuSig2SessionID (const CPubKey &script_pubkey, const CPubKey &part_pubkey, const uint256 &sighash)
 
std::optional< std::vector< uint8_t > > CreateMuSig2AggregateSig (const std::vector< CPubKey > &participants, const CPubKey &aggregate_pubkey, const std::vector< std::pair< uint256, bool > > &tweaks, const uint256 &sighash, const std::map< CPubKey, std::vector< uint8_t > > &pubnonces, const std::map< CPubKey, uint256 > &partial_sigs)
 

Variables

constexpr uint256 MUSIG_CHAINCODE
 
constexpr size_t MUSIG2_PUBNONCE_SIZE {66}
 

Function Documentation

◆ CreateMuSig2AggregateSig()

std::optional< std::vector< uint8_t > > CreateMuSig2AggregateSig ( const std::vector< CPubKey > &  participants,
const CPubKey aggregate_pubkey,
const std::vector< std::pair< uint256, bool > > &  tweaks,
const uint256 sighash,
const std::map< CPubKey, std::vector< uint8_t > > &  pubnonces,
const std::map< CPubKey, uint256 > &  partial_sigs 
)

Definition at line 122 of file musig.cpp.

Here is the call graph for this function:

◆ CreateMuSig2SyntheticXpub()

CExtPubKey CreateMuSig2SyntheticXpub ( const CPubKey pubkey)

Construct the BIP 328 synthetic xpub for a pubkey.

Definition at line 64 of file musig.cpp.

Here is the caller graph for this function:

◆ MuSig2AggregatePubkeys() [1/2]

std::optional< CPubKey > MuSig2AggregatePubkeys ( const std::vector< CPubKey > &  pubkeys)

Definition at line 58 of file musig.cpp.

Here is the call graph for this function:

◆ MuSig2AggregatePubkeys() [2/2]

std::optional< CPubKey > MuSig2AggregatePubkeys ( const std::vector< CPubKey > &  pubkeys,
secp256k1_musig_keyagg_cache keyagg_cache,
const std::optional< CPubKey > &  expected_aggregate 
)

Compute the full aggregate pubkey from the given participant pubkeys in their current order.

Outputs the secp256k1_musig_keyagg_cache and validates that the computed aggregate pubkey matches an expected aggregate pubkey. This is necessary for most MuSig2 operations.

Definition at line 47 of file musig.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MuSig2SessionID()

uint256 MuSig2SessionID ( const CPubKey script_pubkey,
const CPubKey part_pubkey,
const uint256 sighash 
)

Definition at line 115 of file musig.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ MUSIG2_PUBNONCE_SIZE

constexpr size_t MUSIG2_PUBNONCE_SIZE {66}
constexpr

Definition at line 26 of file musig.h.

◆ MUSIG_CHAINCODE

constexpr uint256 MUSIG_CHAINCODE
constexpr
Initial value:
{
[]() consteval { return uint256{"868087ca02a6f974c4598924c36b57762d32cb45717167e300622c7167e38965"_hex_u8}; }(),
}
256-bit opaque blob.
Definition: uint256.h:196

Definition at line 19 of file musig.h.