34 std::vector<CScript> prev_spks;
37 for (
int i = 0; i < 32; i++) {
41 keystore.
keys.emplace(key_id, privkey);
42 keystore.
pubkeys.emplace(key_id, pubkey);
51 prev_spks.push_back(prev_spk);
58 unsigned_tx.
vin.emplace_back(prevout);
64 std::map<COutPoint, Coin> coins;
65 const CScript& prev_spk = prev_spks[(iter++) % prev_spks.size()];
66 coins[prevout] =
Coin(
CTxOut(10000, prev_spk), 100,
false);
67 std::map<int, bilingual_str> input_errors;
83 auto merkle_root = use_null_merkle_root ?
uint256() : rng.
rand256();
85 std::vector<unsigned char> sig(64);
88 bool success = key.SignSchnorr(
msg, sig, &merkle_root, aux);
CScript GetScriptForDestination(const CTxDestination &dest)
Generate a Bitcoin scriptPubKey for the given CTxDestination.
An encapsulated private key.
CPubKey GetPubKey() const
Compute the public key from a private key.
A reference to a CKey: the Hash160 of its serialized public key.
An outpoint - a combination of a transaction hash and an index n into its vout.
An encapsulated public key.
CKeyID GetID() const
Get the KeyID of this public key (hash of its serialization)
Serialized script, used inside transaction inputs and outputs.
An output of a transaction.
RAII class initializing and deinitializing global state for elliptic curve support.
uint256 rand256() noexcept
generate a random uint256.
Main entry point to nanobench's benchmarking facility.
Bench & run(char const *benchmarkName, Op &&op)
Repeatedly calls op() based on the configuration, and performs measurements.
ANKERL_NANOBENCH(NODISCARD) std Bench & minEpochIterations(uint64_t numIters) noexcept
Sets the minimum number of iterations each epoch should take.
static transaction_identifier FromUint256(const uint256 &id)
CKey GenerateRandomKey(bool compressed) noexcept
void SignTransaction(CMutableTransaction &mtx, const SigningProvider *keystore, const std::map< COutPoint, Coin > &coins, const UniValue &hashType, UniValue &result)
Sign a transaction with the given keystore and previous transactions.
static void SignTransactionSingleInput(benchmark::Bench &bench, InputType input_type)
static void SignTransactionECDSA(benchmark::Bench &bench)
static void SignSchnorrWithMerkleRoot(benchmark::Bench &bench)
static void SignTransactionSchnorr(benchmark::Bench &bench)
static void SignSchnorrTapTweakBenchmark(benchmark::Bench &bench, bool use_null_merkle_root)
BENCHMARK(SignTransactionECDSA, benchmark::PriorityLevel::HIGH)
static void SignSchnorrWithNullMerkleRoot(benchmark::Bench &bench)
A mutable version of CTransaction.
std::map< CKeyID, CPubKey > pubkeys
std::map< CKeyID, CKey > keys