cbitcoin
 All Data Structures Files Functions Variables Typedefs
src/structures/CBObject/CBByteArray/CBVersionChecksumBytes/CBAddress/CBAddress.h File Reference

Based upon an ECDSA public key and a network version code. Used for receiving bitcoins. Inherits CBVersionChecksumBytes. More...

Go to the source code of this file.

Data Structures

struct  CBAddress
 Structure for CBAddress objects. More...

Functions

CBAddressCBNewAddressFromRIPEMD160Hash (uint8_t *hash, uint8_t networkCode, bool cacheString, void(*onErrorReceived)(CBError error, char *,...))
 Creates a new CBAddress object from a RIPEMD-160 hash.
CBAddressCBNewAddressFromString (CBByteArray *string, bool cacheString, void(*onErrorReceived)(CBError error, char *,...))
 Creates a new CBAddress object from a base-58 encoded string.
CBAddressCBGetAddress (void *self)
 Gets a CBAddress from another object. Use this to avoid casts.
bool CBInitAddressFromRIPEMD160Hash (CBAddress *self, uint8_t networkCode, uint8_t *hash, bool cacheString, void(*onErrorReceived)(CBError error, char *,...))
 Initialises a CBAddress object from a RIPEMD-160 hash.
bool CBInitAddressFromString (CBAddress *self, CBByteArray *string, bool cacheString, void(*onErrorReceived)(CBError error, char *,...))
 Initialises a CBAddress object from a base-58 encoded string.
void CBFreeAddress (void *self)
 Frees a CBAddress object.

Detailed Description

Based upon an ECDSA public key and a network version code. Used for receiving bitcoins. Inherits CBVersionChecksumBytes.

Here is a diagram of how a bitcoin address is structured created by Alan Reiner, developer of Bitcoin Armory (http://bitcoinarmory.com/):

CBAddress.png

Function Documentation

void CBFreeAddress ( void *  self)

Frees a CBAddress object.

Parameters:
selfThe CBAddress object to free.
CBAddress* CBGetAddress ( void *  self)

Gets a CBAddress from another object. Use this to avoid casts.

Parameters:
selfThe object to obtain the CBAddress from.
Returns:
The CBAddress object.
bool CBInitAddressFromRIPEMD160Hash ( CBAddress self,
uint8_t  networkCode,
uint8_t *  hash,
bool  cacheString,
void(*)(CBError error, char *,...)  onErrorReceived 
)

Initialises a CBAddress object from a RIPEMD-160 hash.

Parameters:
selfThe CBAddress object to initialise.
networkA CBNetworkParameters object with the network information.
hashThe RIPEMD-160 hash. Must be 20 bytes.
cacheStringIf true, the bitcoin string for this object will be cached in memory.
onErrorReceivedEvents for errors.
Returns:
true on success, false on failure.
bool CBInitAddressFromString ( CBAddress self,
CBByteArray string,
bool  cacheString,
void(*)(CBError error, char *,...)  onErrorReceived 
)

Initialises a CBAddress object from a base-58 encoded string.

Parameters:
selfThe CBAddress object to initialise.
stringThe base-58 encoded CBString with a termination character.
cacheStringIf true, the bitcoin string for this object will be cached in memory.
onErrorReceivedEvents for errors.
Returns:
true on success, false on failure.
CBAddress* CBNewAddressFromRIPEMD160Hash ( uint8_t *  hash,
uint8_t  networkCode,
bool  cacheString,
void(*)(CBError error, char *,...)  onErrorReceived 
)

Creates a new CBAddress object from a RIPEMD-160 hash.

Parameters:
networkA CBNetworkParameters object with the network information.
hashThe RIPEMD-160 hash. Must be 20 bytes.
cacheStringIf true, the bitcoin string for this object will be cached in memory.
onErrorReceivedCallback for errors.
Returns:
A new CBAddress object.
CBAddress* CBNewAddressFromString ( CBByteArray string,
bool  cacheString,
void(*)(CBError error, char *,...)  onErrorReceived 
)

Creates a new CBAddress object from a base-58 encoded string.

Parameters:
selfThe CBAddress object to initialise.
stringThe base-58 encoded CBString with a termination character.
cacheStringIf true, the bitcoin string for this object will be cached in memory.
onErrorReceivedCallback for errors.
Returns:
A new CBAddress object. Returns NULL on failure such as an invalid bitcoin address.