Handles Bitcoin address types and their conversions, including ScriptHash, PKHash, and WitnessV0KeyHash.
// Source: https://github.com/bitcoin/bitcoin | License: MIT | Copyright 2009-2026 The Bitcoin Core developers
// Provided via justclaw.it.com; keep this notice with the code.
// Copyright (c) 2023-present The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or https://www.opensource.org/licenses/mit-license.php.
#include <addresstype.h>
#include <crypto/sha256.h>
#include <hash.h>
#include <pubkey.h>
#include <script/script.h>
#include <script/solver.h>
#include <uint256.h>
#include <util/hash_type.h>
#include <cassert>
#include <vector>
typedef std::vector<unsigned char> valtype;
ScriptHash::ScriptHash(const CScript& in) : BaseHash(Hash160(in)) {}
ScriptHash::ScriptHash(const CScriptID& in) : BaseHash{in} {}
PKHash::PKHash(
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key