A BIP32 chain code. Cleansed on destruction.

Synopsis

Declared in <hash.h>

class ChainCode
    : public base_blob<256>

Base Classes

Name

Description

base_blob<256>

Template base class for fixed‐sized opaque blobs.

Member Functions

Name

Description

ChainCode [constructor]

Constructors

~ChainCode [destructor]

Destroys the chain code, securely wiping its bytes from memory.

GetHex

The hex representation used by GetHex(), ToString(), and FromHex() is unusual, since it shows bytes of the base_blob in reverse order. For example, a 4‐byte blob {0x12, 0x34, 0x56, 0x78} is represented as "78563412" instead of the more typical "12345678" representation that would be shown in a hex editor or used by typical byte‐array / hex conversion functions like python's bytes.hex() and bytes.fromhex().

GetUint64

Reads a 64‐bit little‐endian word from the blob at a byte offset.

IsNull

Returns true if every byte of the blob is zero.

Serialize

Serializes the blob's raw bytes to a stream.

SetNull

Sets every byte of the blob to zero.

ToString

Returns the blob as a hex string in reverse byte order.

Unserialize

Deserializes the blob's raw bytes from a stream.

begin

Returns a pointer to the first byte of the blob.

data

Returns a pointer to the blob's raw bytes.

end

Returns a pointer just past the last byte of the blob.

operator==

Compares two blobs for byte‐wise equality.

operator<=>

Lexicographic ordering

Static Member Functions

Name

Description

size

Returns the size of the blob in bytes.

Protected Data Members

Name

Description

m_data

Fixed‐size byte storage holding the blob's raw bytes.

Non-Member Functions

Name

Description

BIP32Hash

Computes the BIP32 child key derivation hash.

Created with MrDocs