Inside Bitcoin
Opening the selected file…
Opening the selected file…
The code behind the network, with room to understand it.
Release published 2026-10-28 · Snapshot fetched 2026-11-01. Latest stable release at fetch time; development branches and Git history are excluded. Only the selected code window and visible folders load here.
1// Copyright (c) 2019-present The Bitcoin Core developers2// Distributed under the MIT software license, see the accompanying3// file COPYING or http://www.opensource.org/licenses/mit-license.php.5#ifndef BITCOIN_SIGNET_H6#define BITCOIN_SIGNET_H8#include <primitives/block.h>9#include <primitives/transaction.h>11#include <optional>13class CScript;14namespace Consensus {15struct Params;16} // namespace Consensus18/**19* Extract signature and check whether a block has a valid solution20*/21bool CheckSignetBlockSolution(const CBlock& block, const Consensus::Params& consensusParams);23/**24* Generate the signet tx corresponding to the given block25*26* The signet tx commits to everything in the block except:27* 1. It hashes a modified merkle root with the signet signature removed.28* 2. It skips the nonce.29*/30class SignetTxs {31template<class T1, class T2>32SignetTxs(const T1& to_spend, const T2& to_sign) : m_to_spend{to_spend}, m_to_sign{to_sign} { }34public:35static std::optional<SignetTxs> Create(const CBlock& block, const CScript& challenge);37const CTransaction m_to_spend;38const CTransaction m_to_sign;39};41#endif // BITCOIN_SIGNET_H
Independent explanations by MyBitcoinExplorer. Not affiliated with or endorsed by Bitcoin Core. Guides are educational and do not replace the source or its tests.
Bitcoin Core source © its contributors, distributed under the MIT license. Original notices and bundled third-party licenses are retained in the source tree.