Bitcoin Core 32.99.0
P2P Digital Currency
Loading...
Searching...
No Matches
key_io.h
Go to the documentation of this file.
1// Copyright (c) 2009-2010 Satoshi Nakamoto
2// Copyright (c) 2009-present The Bitcoin Core developers
3// Distributed under the MIT software license, see the accompanying
4// file COPYING or http://www.opensource.org/licenses/mit-license.php.
5
6#ifndef BITCOIN_KEY_IO_H
7#define BITCOIN_KEY_IO_H
8
9#include <addresstype.h>
10#include <chainparams.h>
11#include <key.h>
12#include <pubkey.h>
13
14#include <string>
15#include <string_view>
16#include <utility>
17
18CKey DecodeSecret(std::string_view str);
19std::string EncodeSecret(const CKey& key);
20
21CExtKey DecodeExtKey(std::string_view str);
22std::string EncodeExtKey(const CExtKey& extkey);
23CExtPubKey DecodeExtPubKey(std::string_view str);
24std::string EncodeExtPubKey(const CExtPubKey& extpubkey);
25
29std::pair<CExtKey, CExtPubKey> DecodeExtKeyOrPubKey(std::string_view str);
30
31std::string EncodeDestination(const CTxDestination& dest);
32CTxDestination DecodeDestination(const std::string& str);
33CTxDestination DecodeDestination(const std::string& str, std::string& error_msg, std::vector<int>* error_locations = nullptr);
34bool IsValidDestinationString(const std::string& str);
35bool IsValidDestinationString(const std::string& str, const CChainParams& params);
36
37#endif // BITCOIN_KEY_IO_H
std::variant< CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown > CTxDestination
A txout script categorized into standard templates.
CChainParams defines various tweakable parameters of a given instance of the Bitcoin system.
Definition chainparams.h:77
An encapsulated private key.
Definition key.h:46
CExtPubKey DecodeExtPubKey(std::string_view str)
Definition key_io.cpp:246
bool IsValidDestinationString(const std::string &str)
Definition key_io.cpp:333
std::string EncodeExtPubKey(const CExtPubKey &extpubkey)
Definition key_io.cpp:259
std::pair< CExtKey, CExtPubKey > DecodeExtKeyOrPubKey(std::string_view str)
Decode a base58-encoded extended key string as either an xprv or xpub, using a single base58 decode.
Definition key_io.cpp:283
std::string EncodeSecret(const CKey &key)
Definition key_io.cpp:233
std::string EncodeExtKey(const CExtKey &extkey)
Definition key_io.cpp:302
std::string EncodeDestination(const CTxDestination &dest)
Definition key_io.cpp:311
CTxDestination DecodeDestination(const std::string &str)
Definition key_io.cpp:321
CKey DecodeSecret(std::string_view str)
Definition key_io.cpp:215
CExtKey DecodeExtKey(std::string_view str)
Definition key_io.cpp:267
Definition key.h:238
constexpr auto Ticks(Dur2 d)
Helper to count the seconds of a duration/time_point.
Definition time.h:82