Use base58check to encode Zcash payment addresses, such that the first two bytes are "zc".
This commit is contained in:
12
src/base58.h
12
src/base58.h
@@ -20,6 +20,7 @@
|
||||
#include "script/script.h"
|
||||
#include "script/standard.h"
|
||||
#include "support/allocators/zeroafterfree.h"
|
||||
#include "zcash/Address.hpp"
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
@@ -95,6 +96,17 @@ public:
|
||||
bool operator> (const CBase58Data& b58) const { return CompareTo(b58) > 0; }
|
||||
};
|
||||
|
||||
class CZCPaymentAddress : public CBase58Data {
|
||||
public:
|
||||
bool Set(const libzcash::PaymentAddress& addr);
|
||||
CZCPaymentAddress() {}
|
||||
|
||||
CZCPaymentAddress(const std::string& strAddress) { SetString(strAddress.c_str(), 2); }
|
||||
CZCPaymentAddress(const libzcash::PaymentAddress& addr) { Set(addr); }
|
||||
|
||||
libzcash::PaymentAddress Get() const;
|
||||
};
|
||||
|
||||
/** 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.
|
||||
|
||||
Reference in New Issue
Block a user