1 // Copyright (c) 2009-2010 Satoshi Nakamoto
2 // Copyright (c) 2009-2015 The Bitcoin Core developers
3 // Copyright (c) 2016-2018 The Zcash developers
4 // Distributed under the MIT software license, see the accompanying
5 // file COPYING or https://www.opensource.org/licenses/mit-license.php .
7 #ifndef BITCOIN_KEYIO_H
8 #define BITCOIN_KEYIO_H
10 #include <chainparams.h>
13 #include <zcash/Address.hpp>
14 #include <zcash/zip32.h>
18 CKey DecodeSecret(const std::string& str);
19 std::string EncodeSecret(const CKey& key);
21 CExtKey DecodeExtKey(const std::string& str);
22 std::string EncodeExtKey(const CExtKey& extkey);
23 CExtPubKey DecodeExtPubKey(const std::string& str);
24 std::string EncodeExtPubKey(const CExtPubKey& extpubkey);
26 std::string EncodeDestination(const CTxDestination& dest);
27 std::vector<unsigned char> GetDestinationBytes(const CTxDestination& dest);
28 uint160 GetDestinationID(const CTxDestination dest);
29 CTxDestination DecodeDestination(const std::string& str);
30 bool IsValidDestinationString(const std::string& str);
31 bool IsValidDestinationString(const std::string& str, const CChainParams& params);
33 std::string EncodePaymentAddress(const libzcash::PaymentAddress& zaddr);
34 libzcash::PaymentAddress DecodePaymentAddress(const std::string& str);
35 bool IsValidPaymentAddressString(const std::string& str, uint32_t consensusBranchId);
37 std::string EncodeViewingKey(const libzcash::ViewingKey& vk);
38 libzcash::ViewingKey DecodeViewingKey(const std::string& str);
40 std::string EncodeSpendingKey(const libzcash::SpendingKey& zkey);
41 libzcash::SpendingKey DecodeSpendingKey(const std::string& str);
43 #endif // BITCOIN_KEYIO_H