golos.base58

Contains Base58 and various helper functions for working with Base58 public/private keys used on blockchains such as GOLOS and STEEM.

Functions

b58decode(v)

b58encode(v)

base58CheckDecode(s)

base58CheckEncode(version, payload)

base58decode(base58_str)

base58encode(hexstring)

doublesha256(s)

gphBase58CheckDecode(s)

gphBase58CheckEncode(s)

ripemd160(s)

Classes

Base58(data[, prefix])

Base58 base class. This class serves as an abstraction layer to deal with base58 encoded strings and their corresponding hex and binary representation throughout the library.

class golos.base58.Base58(data, prefix='GLS')[source]

Bases: object

Base58 base class. This class serves as an abstraction layer to deal with base58 encoded strings and their corresponding hex and binary representation throughout the library.

Parameters

data – Data to initialize object, e.g. pubkey data, address data,

Parameters

prefix (str) – Prefix to use for Address/PubKey strings (defaults

to GPH)

Returns

Base58 object initialized with data

Return type

Base58

Raises

ValueError – if data cannot be decoded

  • bytes(Base58): Returns the raw data

  • str(Base58): Returns the readable Base58CheckEncoded data.

  • repr(Base58): Gives the hex representation of the data.

  • format(Base58,_format) Formats the instance according to

_format:

  • "btc": prefixed with 0x80. Yields a valid btc address

  • "wif": prefixed with 0x00. Yields a valid wif key

  • "bts": prefixed with BTS

  • etc.

golos.base58.PREFIX = 'GLS'

Default Prefix

golos.base58.b58decode(v)[source]
golos.base58.b58encode(v)[source]
golos.base58.base58CheckDecode(s)[source]
golos.base58.base58CheckEncode(version, payload)[source]
golos.base58.base58decode(base58_str)[source]
golos.base58.base58encode(hexstring)[source]
golos.base58.doublesha256(s)[source]
golos.base58.gphBase58CheckDecode(s)[source]
golos.base58.gphBase58CheckEncode(s)[source]
golos.base58.known_prefixes = ['GLS', 'STM', 'TST']

A list of known public key prefixes, used by Base58 for alerting the user if an invalid prefix may have been used.

golos.base58.ripemd160(s)[source]