BitShares-Core  7.0.2
BitShares blockchain node software and command-line wallet software
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
graphene::protocol::address Class Reference

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

#include <address.hpp>

Public Member Functions

 address (const std::string &base58str)
 converts to binary, validates checksum More...
 
 address (const fc::ecc::public_key &pub)
 converts to address More...
 
 address (const fc::ecc::public_key_data &pub)
 converts to address More...
 
 address (const pts_address &pub)
 converts to address More...
 
 address (const public_key_type &pubkey)
 converts to address More...
 
 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
 

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 44 of file address.hpp.

Constructor & Destructor Documentation

◆ address() [1/5]

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

converts to binary, validates checksum

Definition at line 33 of file address.cpp.

◆ address() [2/5]

graphene::protocol::address::address ( const fc::ecc::public_key pub)
explicit

converts to address

Definition at line 69 of file address.cpp.

◆ address() [3/5]

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

converts to address

Definition at line 80 of file address.cpp.

◆ address() [4/5]

graphene::protocol::address::address ( const pts_address pub)
explicit

converts to address

Definition at line 75 of file address.cpp.

◆ address() [5/5]

graphene::protocol::address::address ( const public_key_type pubkey)
explicit

converts to address

Definition at line 85 of file address.cpp.

Member Function Documentation

◆ is_valid()

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

Definition at line 42 of file address.cpp.

◆ operator std::string()

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

converts to base58 + checksum

Definition at line 90 of file address.cpp.

Member Data Documentation

◆ addr

fc::ripemd160 graphene::protocol::address::addr

Definition at line 58 of file address.hpp.


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