Bitshares-Core  2.0.181105
BitShares blockchain implementation and command-line interface software
Public Member Functions | Static Public Member Functions | Public Attributes | Friends | List of all members
graphene::chain::address Class Reference

a 160 bit hash of a public key More...

#include <address.hpp>

Public Member Functions

 address ()
 constructs empty / null address More...
 
 address (const std::string &base58str)
 converts to binary, validates checksum More...
 
 address (const fc::ecc::public_key &pub)
 converts to binary More...
 
 address (const fc::ecc::public_key_data &pub)
 converts to binary More...
 
 address (const pts_address &pub)
 converts to binary More...
 
 address (const public_key_type &pubkey)
 
 operator std::string () const
 converts to base58 + checksum More...
 

Static Public Member Functions

static bool is_valid (const std::string &base58str, const std::string &prefix=GRAPHENE_ADDRESS_PREFIX)
 

Public Attributes

fc::ripemd160 addr
 

Friends

size_t hash_value (const address &v)
 

Detailed Description

a 160 bit hash of a public key

An address can be converted to or from a base58 string with 32 bit checksum.

An address is calculated as ripemd160( sha512( compressed_ecc_public_key ) )

When converted to a string, checksum calculated as the first 4 bytes ripemd160( address ) is appended to the binary address before converting to base58.

Definition at line 51 of file address.hpp.

Constructor & Destructor Documentation

◆ address() [1/6]

graphene::chain::address::address ( )

constructs empty / null address

Definition at line 32 of file address.cpp.

◆ address() [2/6]

graphene::chain::address::address ( const std::string &  base58str)
explicit

converts to binary, validates checksum

Definition at line 34 of file address.cpp.

◆ address() [3/6]

graphene::chain::address::address ( const fc::ecc::public_key &  pub)

converts to binary

Definition at line 70 of file address.cpp.

◆ address() [4/6]

graphene::chain::address::address ( const fc::ecc::public_key_data pub)
explicit

converts to binary

Definition at line 81 of file address.cpp.

◆ address() [5/6]

graphene::chain::address::address ( const pts_address pub)

converts to binary

Definition at line 76 of file address.cpp.

◆ address() [6/6]

graphene::chain::address::address ( const public_key_type pubkey)

Definition at line 86 of file address.cpp.

Member Function Documentation

◆ is_valid()

bool graphene::chain::address::is_valid ( const std::string &  base58str,
const std::string &  prefix = GRAPHENE_ADDRESS_PREFIX 
)
static

Definition at line 43 of file address.cpp.

◆ operator std::string()

graphene::chain::address::operator std::string ( ) const
explicit

converts to base58 + checksum

Definition at line 91 of file address.cpp.

Friends And Related Function Documentation

◆ hash_value

size_t hash_value ( const address v)
friend

Definition at line 65 of file address.hpp.

Member Data Documentation

◆ addr

fc::ripemd160 graphene::chain::address::addr

Definition at line 71 of file address.hpp.


The documentation for this class was generated from the following files: