Bitcoin Core 29.99.0
P2P Digital Currency
musig.h
Go to the documentation of this file.
1// Copyright (c) 2024-present The Bitcoin Core developers
2// Distributed under the MIT software license, see the accompanying
3// file COPYING or https://www.opensource.org/licenses/mit-license.php.
4
5#ifndef BITCOIN_MUSIG_H
6#define BITCOIN_MUSIG_H
7
8#include <pubkey.h>
9
10#include <optional>
11#include <vector>
12
14
16using namespace util::hex_literals;
18 // Use immediate lambda to work around GCC-14 bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117966
19 []() consteval { return uint256{"868087ca02a6f974c4598924c36b57762d32cb45717167e300622c7167e38965"_hex_u8}; }(),
20};
21
22
23
25bool GetMuSig2KeyAggCache(const std::vector<CPubKey>& pubkeys, secp256k1_musig_keyagg_cache& keyagg_cache);
29std::optional<CPubKey> MuSig2AggregatePubkeys(const std::vector<CPubKey>& pubkeys);
30
31#endif // BITCOIN_MUSIG_H
256-bit opaque blob.
Definition: uint256.h:196
bool GetMuSig2KeyAggCache(const std::vector< CPubKey > &pubkeys, secp256k1_musig_keyagg_cache &keyagg_cache)
Create a secp256k1_musig_keyagg_cache from the pubkeys in their current order. This is necessary for ...
Definition: musig.cpp:9
std::optional< CPubKey > GetCPubKeyFromMuSig2KeyAggCache(secp256k1_musig_keyagg_cache &cache)
Retrieve the full aggregate pubkey from the secp256k1_musig_keyagg_cache.
Definition: musig.cpp:31
std::optional< CPubKey > MuSig2AggregatePubkeys(const std::vector< CPubKey > &pubkeys)
Compute the full aggregate pubkey from the given participant pubkeys in their current order.
Definition: musig.cpp:46
constexpr uint256 MUSIG_CHAINCODE
Definition: musig.h:17
""_hex is a compile-time user-defined literal returning a std::array<std::byte>, equivalent to ParseH...
Definition: strencodings.h:384
This module implements BIP 327 "MuSig2 for BIP340-compatible Multi-Signatures" (https://github....