75 if (pubkey[0] == 0x02 || pubkey[0] == 0x03) {
78 }
else if (pubkey[0] == 0x04) {
79 out[0] = 0x04 | (pubkey[64] & 0x01);
88 if (nSize == 0 || nSize == 1)
90 if (nSize == 2 || nSize == 3 || nSize == 4 || nSize == 5)
124 unsigned char vch[33] = {};
128 if (!pubkey.Decompress())
130 assert(pubkey.size() == 65);
154 while (((n % 10) == 0) && e < 9) {
162 return 1 + (n*9 + d - 1)*10 + e;
164 return 1 + (n - 1)*10 + 9;
uint64_t CompressAmount(uint64_t n)
Compress amount.
void Set(const T pbegin, const T pend)
Initialize a public key using begin/end iterators to byte data.
static bool IsToScriptID(const CScript &script, CScriptID &hash)
memcpy(result.begin(), stream.data(), stream.size())
static bool IsToKeyID(const CScript &script, CKeyID &hash)
bool CompressScript(const CScript &script, CompressedScript &out)
bool IsFullyValid() const
fully validate whether this is a valid public key (more expensive than IsValid()) ...
An encapsulated public key.
Implements a drop-in replacement for std::vector<T> which stores up to N elements directly (without h...
static bool IsToPubKey(const CScript &script, CPubKey &pubkey)
Serialized script, used inside transaction inputs and outputs.
A reference to a CKey: the Hash160 of its serialized public key.
A reference to a CScript: the Hash160 of its serialization.
unsigned int GetSpecialScriptSize(unsigned int nSize)
uint64_t DecompressAmount(uint64_t x)
bool DecompressScript(CScript &script, unsigned int nSize, const CompressedScript &in)