// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2014 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
-// file COPYING or http://www.opensource.org/licenses/mit-license.php.
+// file COPYING or https://www.opensource.org/licenses/mit-license.php .
/**
* Why base-58 instead of standard base-64 encoding?
#ifndef BITCOIN_BASE58_H
#define BITCOIN_BASE58_H
-#include "chainparams.h"
#include "key.h"
#include "pubkey.h"
#include "script/script.h"
#include "script/standard.h"
#include "support/allocators/zeroafterfree.h"
#include "zcash/Address.hpp"
+#include "chainparams.h"
#include <string>
#include <vector>
* Decode a base58-encoded string (psz) that includes a checksum into a byte
* vector (vchRet), return true if decoding is successful
*/
-inline bool DecodeBase58Check(const char* psz, std::vector<unsigned char>& vchRet);
+bool DecodeBase58Check(const char* psz, std::vector<unsigned char>& vchRet);
/**
* Decode a base58-encoded string (str) that includes a checksum into a byte
* vector (vchRet), return true if decoding is successful
*/
-inline bool DecodeBase58Check(const std::string& str, std::vector<unsigned char>& vchRet);
+bool DecodeBase58Check(const std::string& str, std::vector<unsigned char>& vchRet);
/**
* Base class for all base58-encoded data
DATA_TYPE Get() const;
};
-class CZCPaymentAddress : public CZCEncoding<libzcash::PaymentAddress, CChainParams::ZCPAYMENT_ADDRRESS, libzcash::SerializedPaymentAddressSize> {
-protected:
- std::string PrependName(const std::string& s) const { return "payment address" + s; }
-
-public:
- CZCPaymentAddress() {}
-
- CZCPaymentAddress(const std::string& strAddress) { SetString(strAddress.c_str(), 2); }
- CZCPaymentAddress(const libzcash::PaymentAddress& addr) { Set(addr); }
-};
-
-class CZCViewingKey : public CZCEncoding<libzcash::ViewingKey, CChainParams::ZCVIEWING_KEY, libzcash::SerializedViewingKeySize> {
-protected:
- std::string PrependName(const std::string& s) const { return "viewing key" + s; }
-
-public:
- CZCViewingKey() {}
-
- CZCViewingKey(const std::string& strViewingKey) { SetString(strViewingKey.c_str(), 3); }
- CZCViewingKey(const libzcash::ViewingKey& vk) { Set(vk); }
-};
-
-class CZCSpendingKey : public CZCEncoding<libzcash::SpendingKey, CChainParams::ZCSPENDING_KEY, libzcash::SerializedSpendingKeySize> {
-protected:
- std::string PrependName(const std::string& s) const { return "spending key" + s; }
-
-public:
- CZCSpendingKey() {}
-
- CZCSpendingKey(const std::string& strAddress) { SetString(strAddress.c_str(), 2); }
- CZCSpendingKey(const libzcash::SpendingKey& addr) { Set(addr); }
-};
-
/** base58-encoded Bitcoin addresses.
* Public-key-hash-addresses have version 0 (or 111 testnet).
* The data vector contains RIPEMD160(SHA256(pubkey)), where pubkey is the serialized public key.
class CBitcoinAddress : public CBase58Data {
public:
bool Set(const CKeyID &id);
+ bool Set(const CPubKey &key);
bool Set(const CScriptID &id);
+ bool Set(const CIdentityID& id);
+ bool Set(const CIndexID &id);
+ bool Set(const CQuantumID &id);
bool Set(const CTxDestination &dest);
bool IsValid() const;
bool IsValid(const CChainParams ¶ms) const;
CTxDestination Get() const;
bool GetKeyID(CKeyID &keyID) const;
+ bool GetIdentityID(CIdentityID &idID) const;
+ bool GetKeyID_NoCheck(CKeyID& keyID) const;
+ bool GetIndexKey(uint160& hashBytes, int& type) const;
bool IsScript() const;
+ bool IsIdentity() const;
};
/**