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 std::vector<unsigned char> GetDestinationBytes(const CTxDestination& dest);
29 uint160 GetDestinationID(const CTxDestination dest);
30 CTxDestination DecodeDestination(const std::string& str);
31 bool IsValidDestinationString(const std::string& str);
32 bool IsValidDestinationString(const std::string& str, const CChainParams& params);
34 std::string EncodePaymentAddress(const libzcash::PaymentAddress& zaddr);
35 libzcash::PaymentAddress DecodePaymentAddress(const std::string& str);
36 bool IsValidPaymentAddressString(const std::string& str, uint32_t consensusBranchId);
38 std::string EncodeViewingKey(const libzcash::ViewingKey& vk);
39 libzcash::ViewingKey DecodeViewingKey(const std::string& str);
41 std::string EncodeSpendingKey(const libzcash::SpendingKey& zkey);
42 libzcash::SpendingKey DecodeSpendingKey(const std::string& str);
44 #endif // BITCOIN_KEYIO_H