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>
15 #include <pbaas/vdxf.h>
19 extern CIdentityID VERUS_DEFAULTID;
20 extern CIdentityID VERUS_NOTARYID;
21 extern uint160 VERUS_NODEID;
22 extern int32_t MAX_UTXOS_ID_RESCAN;
23 extern int32_t MAX_OUR_UTXOS_ID_RESCAN;
24 extern bool VERUS_PRIVATECHANGE;
25 extern std::string VERUS_DEFAULT_ZADDR;
27 std::vector<std::string> ParseSubNames(const std::string &Name, std::string &ChainOut, bool displayfilter=false, bool addVerus=true);
28 CKey DecodeSecret(const std::string& str);
29 std::string EncodeSecret(const CKey& key);
31 CExtKey DecodeExtKey(const std::string& str);
32 std::string EncodeExtKey(const CExtKey& extkey);
33 CExtPubKey DecodeExtPubKey(const std::string& str);
34 std::string EncodeExtPubKey(const CExtPubKey& extpubkey);
36 std::string EncodeDestination(const CTxDestination& dest);
37 std::vector<unsigned char> GetDestinationBytes(const CTxDestination& dest);
38 uint160 GetDestinationID(const CTxDestination dest);
39 CTxDestination DecodeDestination(const std::string& str);
40 CTxDestination ValidateDestination(const std::string &destStr);
41 bool IsValidDestinationString(const std::string& str);
42 bool IsValidDestinationString(const std::string& str, const CChainParams& params);
44 std::string EncodePaymentAddress(const libzcash::PaymentAddress& zaddr);
45 libzcash::PaymentAddress DecodePaymentAddress(const std::string& str);
46 bool IsValidPaymentAddressString(const std::string& str, uint32_t consensusBranchId);
48 std::string EncodeViewingKey(const libzcash::ViewingKey& vk);
49 libzcash::ViewingKey DecodeViewingKey(const std::string& str);
51 std::string EncodeSpendingKey(const libzcash::SpendingKey& zkey);
52 libzcash::SpendingKey DecodeSpendingKey(const std::string& str);
54 #endif // BITCOIN_KEYIO_H