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 http://www.opensource.org/licenses/mit-license.php.
7 #ifndef BITCOIN_KEYIO_H
8 #define BITCOIN_KEYIO_H
10 #include <chainparams.h>
13 #include <script/standard.h>
14 #include <zcash/Address.hpp>
15 #include <zcash/zip32.h>
19 CKey DecodeSecret(const std::string& str);
20 std::string EncodeSecret(const CKey& key);
22 CExtKey DecodeExtKey(const std::string& str);
23 std::string EncodeExtKey(const CExtKey& extkey);
24 CExtPubKey DecodeExtPubKey(const std::string& str);
25 std::string EncodeExtPubKey(const CExtPubKey& extpubkey);
27 std::string EncodeDestination(const CTxDestination& dest);
28 CTxDestination DecodeDestination(const std::string& str);
29 bool IsValidDestinationString(const std::string& str);
30 bool IsValidDestinationString(const std::string& str, const CChainParams& params);
32 std::string EncodePaymentAddress(const libzcash::PaymentAddress& zaddr);
33 libzcash::PaymentAddress DecodePaymentAddress(const std::string& str);
34 bool IsValidPaymentAddressString(const std::string& str, uint32_t consensusBranchId);
36 std::string EncodeViewingKey(const libzcash::ViewingKey& vk);
37 libzcash::ViewingKey DecodeViewingKey(const std::string& str);
39 std::string EncodeSpendingKey(const libzcash::SpendingKey& zkey);
40 libzcash::SpendingKey DecodeSpendingKey(const std::string& str);
42 #endif // BITCOIN_KEYIO_H