bitcoincash

bitcoincash

class bitcoincash.MainParams[source]

Bases: bitcoincash.core.CoreMainParams

DB_MAGIC: Magic bytes used as separator in block storage. Previously named
MESSAGE_START.
NETWORK_MAGIC: Prefix for messages in the P2P protocol. Previously named
MESSAGE_START and had the same value as DB_MAGIC.
BASE58_PREFIXES = {'PUBKEY_ADDR': 0, 'SCRIPT_ADDR': 5, 'SECRET_KEY': 128}
CASHADDR_PREFIX = 'bitcoincash'
DB_MAGIC = b'\xf9\xbe\xb4\xd9'
DEFAULT_PORT = 8333
DNS_SEEDS = (('bitcoinunlimited.info', 'btccash-seeder.bitcoinunlimited.info'), ('bitcoinabc.org', 'seed.bitcoinabc.org'), ('bitcoinforks.org', 'seed-abc.bitcoinforks.org'), ('deadalnix.me', 'seed.deadalnix.me'))
NETWORK_MAGIC = b'\xe3\xe1\xf3\xe8'
RPC_PORT = 8332
class bitcoincash.RegTestParams[source]

Bases: bitcoincash.core.CoreRegTestParams

DB_MAGIC: Magic bytes used as separator in block storage. Previously named
MESSAGE_START.
NETWORK_MAGIC: Prefix for messages in the P2P protocol. Previously named
MESSAGE_START and had the same value as DB_MAGIC.
BASE58_PREFIXES = {'PUBKEY_ADDR': 111, 'SCRIPT_ADDR': 196, 'SECRET_KEY': 239}
CASHADDR_PREFIX = 'bchreg'
DB_MAGIC = b'\xfa\xbf\xb5\xda'
DEFAULT_PORT = 18444
DNS_SEEDS = ()
NETWORK_MAGIC = b'\xda\xb5\xbf\xfa'
RPC_PORT = 18443
bitcoincash.SelectParams(name)[source]

Select the chain parameters to use

name is one of ‘mainnet’, ‘testnet’, or ‘regtest’

Default chain is ‘mainnet’

class bitcoincash.TestNetParams[source]

Bases: bitcoincash.core.CoreTestNetParams

DB_MAGIC: Magic bytes used as separator in block storage. Previously named
MESSAGE_START.
NETWORK_MAGIC: Prefix for messages in the P2P protocol. Previously named
MESSAGE_START and had the same value as DB_MAGIC.
BASE58_PREFIXES = {'PUBKEY_ADDR': 111, 'SCRIPT_ADDR': 196, 'SECRET_KEY': 239}
CASHADDR_PREFIX = 'bchtest'
DB_MAGIC = b'\x0b\x11\t\x07'
DEFAULT_PORT = 18333
DNS_SEEDS = (('bitcoinabc.org', 'testnet-seed.bitcoinabc.org'), ('bitcoinforks.org', 'testnet-seed-abc.bitcoinforks.org'), ('bitcoinunlimited.info', 'testnet-seed.bitcoinunlimited.info'), ('deadalnix.me', 'testnet-seed.deadalnix.me'))
NETWORK_MAGIC = b'\xf4\xe5\xf3\xf4'
RPC_PORT = 18332

base58

Base58 encoding and decoding

exception bitcoincash.base58.Base58Error[source]

Bases: Exception

exception bitcoincash.base58.InvalidBase58Error[source]

Bases: bitcoincash.base58.Base58Error

Raised on generic invalid base58 data, such as bad characters.

Checksum failures raise Base58ChecksumError specifically.

bitcoincash.base58.encode(b)[source]

Encode bytes to a base58-encoded string

bitcoincash.base58.decode(s)[source]

Decode a base58-encoding string, returning bytes

exception bitcoincash.base58.Base58ChecksumError[source]

Bases: bitcoincash.base58.Base58Error

Raised on Base58 checksum errors

class bitcoincash.base58.CBase58Data(s)[source]

Bases: bytes

Base58-encoded data

Includes a version and checksum.

Initialize from base58-encoded string

Note: subclasses put your initialization routines here, but ignore the argument - that’s handled by __new__(), and .from_bytes() will call __init__() with None in place of the string.

classmethod from_bytes(data, nVersion)[source]

Instantiate from data and nVersion

to_bytes()[source]

Convert to bytes instance

Note that it’s the data represented that is converted; the checkum and nVersion is not included.

bloom

Bloom filter support

bitcoincash.bloom.MurmurHash3(x86_32)[source]

Used for bloom filters. See http://code.google.com/p/smhasher/source/browse/trunk/MurmurHash3.cpp

class bitcoincash.bloom.CBloomFilter(nElements, nFPRate, nTweak, nFlags)[source]

Bases: bitcoincash.core.serialize.Serializable

Create a new bloom filter

The filter will have a given false-positive rate when filled with the given number of elements.

Note that if the given parameters will result in a filter outside the bounds of the protocol limits, the filter created will be as close to the given parameters as possible within the protocol limits. This will apply if nFPRate is very low or nElements is unreasonably high.

nTweak is a constant which is added to the seed value passed to the hash function It should generally always be a random value (and is largely only exposed for unit testing)

nFlags should be one of the UPDATE_* enums (but not _MASK)

IsRelevantAndUpdate(tx_hash)[source]
IsWithinSizeConstraints()[source]
MAX_BLOOM_FILTER_SIZE = 36000
MAX_HASH_FUNCS = 50
UPDATE_ALL = 1
UPDATE_MASK = 3
UPDATE_NONE = 0
UPDATE_P2PUBKEY_ONLY = 2
bloom_hash(nHashNum, vDataToHash)[source]
contains(elem)[source]

Test if the filter contains an element

elem may be a COutPoint or bytes

insert(elem)[source]

Insert an element in the filter.

elem may be a COutPoint or bytes

classmethod stream_deserialize(f)[source]

Deserialize from a stream

stream_serialize(f)[source]

Serialize to a stream

cashaddr

class bitcoincash.cashaddr.CashAddrData(s)[source]

Bases: bytes

CashAddr-encoded data

Initialize from cashaddr-encoded string

Note: subclasses put your initialization routines here, but ignore the argument - that’s handled by __new__(), and .from_bytes() will call __init__() with None in place of the string.

classmethod from_bytes(data, prefix, kind)[source]
to_bytes()[source]

Convert to bytes instance

Note that it’s the data represented that is converted; the prefix and kind is not included.

bitcoincash.cashaddr.decode(address)[source]

Given a cashaddr address, return a triple

(prefix, kind, hash)

bitcoincash.cashaddr.encode(prefix, kind, addr_hash)[source]

Encode a cashaddr address without prefix and separator.

bitcoincash.cashaddr.encode_full(prefix, kind, addr_hash)[source]

Encode a full cashaddr address, with prefix and separator.

messages

class bitcoincash.messages.MsgSerializable(protover=60002)[source]

Bases: bitcoincash.core.serialize.Serializable

classmethod from_bytes(b, protover=60002)[source]
classmethod msg_deser(f, protover=60002)[source]
msg_ser(f)[source]
classmethod stream_deserialize(f, protover=60002)[source]

Deserialize from a stream

stream_serialize(f)[source]

Serialize to a stream

to_bytes()[source]
class bitcoincash.messages.msg_version(protover=60002)[source]

Bases: bitcoincash.messages.MsgSerializable

command = b'version'
classmethod msg_deser(f, protover=60002)[source]
msg_ser(f)[source]
class bitcoincash.messages.msg_verack(protover=60002)[source]

Bases: bitcoincash.messages.MsgSerializable

command = b'verack'
classmethod msg_deser(f, protover=60002)[source]
msg_ser(f)[source]
class bitcoincash.messages.msg_addr(protover=60002)[source]

Bases: bitcoincash.messages.MsgSerializable

command = b'addr'
classmethod msg_deser(f, protover=60002)[source]
msg_ser(f)[source]
class bitcoincash.messages.msg_alert(protover=60002)[source]

Bases: bitcoincash.messages.MsgSerializable

command = b'alert'
classmethod msg_deser(f, protover=60002)[source]
msg_ser(f)[source]
class bitcoincash.messages.msg_inv(protover=60002)[source]

Bases: bitcoincash.messages.MsgSerializable

command = b'inv'
classmethod msg_deser(f, protover=60002)[source]
msg_ser(f)[source]
class bitcoincash.messages.msg_getdata(protover=60002)[source]

Bases: bitcoincash.messages.MsgSerializable

command = b'getdata'
classmethod msg_deser(f, protover=60002)[source]
msg_ser(f)[source]
class bitcoincash.messages.msg_getblocks(protover=60002)[source]

Bases: bitcoincash.messages.MsgSerializable

command = b'getblocks'
classmethod msg_deser(f, protover=60002)[source]
msg_ser(f)[source]
class bitcoincash.messages.msg_getheaders(protover=60002)[source]

Bases: bitcoincash.messages.MsgSerializable

command = b'getheaders'
classmethod msg_deser(f, protover=60002)[source]
msg_ser(f)[source]
class bitcoincash.messages.msg_headers(protover=60002)[source]

Bases: bitcoincash.messages.MsgSerializable

command = b'headers'
classmethod msg_deser(f, protover=60002)[source]
msg_ser(f)[source]
class bitcoincash.messages.msg_tx(protover=60002)[source]

Bases: bitcoincash.messages.MsgSerializable

command = b'tx'
classmethod msg_deser(f, protover=60002)[source]
msg_ser(f)[source]
class bitcoincash.messages.msg_block(protover=60002)[source]

Bases: bitcoincash.messages.MsgSerializable

command = b'block'
classmethod msg_deser(f, protover=60002)[source]
msg_ser(f)[source]
class bitcoincash.messages.msg_getaddr(protover=60002)[source]

Bases: bitcoincash.messages.MsgSerializable

command = b'getaddr'
classmethod msg_deser(f, protover=60002)[source]
msg_ser(f)[source]
class bitcoincash.messages.msg_ping(protover=60002, nonce=0)[source]

Bases: bitcoincash.messages.MsgSerializable

command = b'ping'
classmethod msg_deser(f, protover=60002)[source]
msg_ser(f)[source]
class bitcoincash.messages.msg_pong(protover=60002, nonce=0)[source]

Bases: bitcoincash.messages.MsgSerializable

command = b'pong'
classmethod msg_deser(f, protover=60002)[source]
msg_ser(f)[source]
class bitcoincash.messages.msg_mempool(protover=60002)[source]

Bases: bitcoincash.messages.MsgSerializable

command = b'mempool'
classmethod msg_deser(f, protover=60002)[source]
msg_ser(f)[source]

net

class bitcoincash.net.CAddress(protover=60002)[source]

Bases: bitcoincash.core.serialize.Serializable

classmethod stream_deserialize(f, without_time=False)[source]

Deserialize from a stream

stream_serialize(f, without_time=False)[source]

Serialize to a stream

class bitcoincash.net.CInv[source]

Bases: bitcoincash.core.serialize.Serializable

classmethod stream_deserialize(f)[source]

Deserialize from a stream

stream_serialize(f)[source]

Serialize to a stream

typemap = {0: 'Error', 1: 'TX', 2: 'Block', 3: 'FilteredBlock'}
class bitcoincash.net.CBlockLocator(protover=60002)[source]

Bases: bitcoincash.core.serialize.Serializable

classmethod stream_deserialize(f)[source]

Deserialize from a stream

stream_serialize(f)[source]

Serialize to a stream

class bitcoincash.net.CUnsignedAlert[source]

Bases: bitcoincash.core.serialize.Serializable

classmethod stream_deserialize(f)[source]

Deserialize from a stream

stream_serialize(f)[source]

Serialize to a stream

class bitcoincash.net.CAlert[source]

Bases: bitcoincash.core.serialize.Serializable

classmethod stream_deserialize(f)[source]

Deserialize from a stream

stream_serialize(f)[source]

Serialize to a stream

rpc

Bitcoin Core RPC support

By default this uses the standard library json module. By monkey patching, a different implementation can be used instead, at your own risk:

>>> import simplejson
>>> import bitcoincash.rpc
>>> bitcoincash.rpc.json = simplejson

(simplejson is the externally maintained version of the same module and thus better optimized but perhaps less stable.)

exception bitcoincash.rpc.JSONRPCError[source]

Bases: Exception

JSON-RPC protocol error base class

Subclasses of this class also exist for specific types of errors; the set of all subclasses is by no means complete.

SUBCLS_BY_CODE = {-28: <class 'bitcoincash.rpc.InWarmupError'>, -27: <class 'bitcoincash.rpc.VerifyAlreadyInChainError'>, -26: <class 'bitcoincash.rpc.VerifyRejectedError'>, -25: <class 'bitcoincash.rpc.VerifyError'>, -8: <class 'bitcoincash.rpc.InvalidParameterError'>, -5: <class 'bitcoincash.rpc.InvalidAddressOrKeyError'>, -2: <class 'bitcoincash.rpc.ForbiddenBySafeModeError'>}
exception bitcoincash.rpc.ForbiddenBySafeModeError[source]

Bases: bitcoincash.rpc.JSONRPCError

RPC_ERROR_CODE = -2
exception bitcoincash.rpc.InvalidAddressOrKeyError[source]

Bases: bitcoincash.rpc.JSONRPCError

RPC_ERROR_CODE = -5
exception bitcoincash.rpc.InvalidParameterError[source]

Bases: bitcoincash.rpc.JSONRPCError

RPC_ERROR_CODE = -8
exception bitcoincash.rpc.VerifyError[source]

Bases: bitcoincash.rpc.JSONRPCError

RPC_ERROR_CODE = -25
exception bitcoincash.rpc.VerifyRejectedError[source]

Bases: bitcoincash.rpc.JSONRPCError

RPC_ERROR_CODE = -26
exception bitcoincash.rpc.VerifyAlreadyInChainError[source]

Bases: bitcoincash.rpc.JSONRPCError

RPC_ERROR_CODE = -27
exception bitcoincash.rpc.InWarmupError[source]

Bases: bitcoincash.rpc.JSONRPCError

RPC_ERROR_CODE = -28
class bitcoincash.rpc.RawProxy(service_url=None, service_port=None, btc_conf_file=None, timeout=30, **kwargs)[source]

Bases: bitcoincash.rpc.BaseProxy

Low-level proxy to a bitcoin JSON-RPC service

Unlike Proxy, no conversion is done besides parsing JSON. As far as Python is concerned, you can call any method; JSONRPCError will be raised if the server does not recognize it.

class bitcoincash.rpc.Proxy(service_url=None, service_port=None, btc_conf_file=None, timeout=30, **kwargs)[source]

Bases: bitcoincash.rpc.BaseProxy

Proxy to a bitcoin RPC service

Unlike RawProxy, data is passed as bitcoincash.core objects or packed bytes, rather than JSON or hex strings. Not all methods are implemented yet; you can use call to access missing ones in a forward-compatible way. Assumes Bitcoin Core version >= v0.16.0; older versions mostly work, but there are a few incompatibilities.

Create a proxy object

If service_url is not specified, the username and password are read out of the file btc_conf_file. If btc_conf_file is not specified, ~/.bitcoin/bitcoin.conf or equivalent is used by default. The default port is set according to the chain parameters in use: mainnet, testnet, or regtest.

Usually no arguments to Proxy() are needed; the local bitcoind will be used.

timeout - timeout in seconds before the HTTP interface times out

addnode(node)[source]
addnodeonetry(node)[source]
call(service_name, *args)[source]

Call an RPC method by name and raw (JSON encodable) arguments

dumpprivkey(addr)[source]

Return the private key matching an address

fundrawtransaction(tx, include_watching=False)[source]

Add inputs to a transaction until it has enough in value to meet its out value.

include_watching - Also select inputs which are watch only

Returns dict:

{‘tx’: Resulting tx,
‘fee’: Fee the resulting transaction pays, ‘changepos’: Position of added change output, or -1,

}

generate(numblocks)[source]

DEPRECATED (will be removed in bitcoin-core v0.19)

Mine blocks immediately (before the RPC call returns)

numblocks - How many blocks are generated immediately.

Returns iterable of block hashes generated.

generatetoaddress(numblocks, addr)[source]

Mine blocks immediately (before the RPC call returns) and allocate block reward to passed address. Replaces deprecated “generate(self,numblocks)” method.

numblocks - How many blocks are generated immediately. addr - Address to receive block reward (CBitcoinAddress instance)

Returns iterable of block hashes generated.

getaccountaddress(account=None)[source]

Return the current Bitcoin address for receiving payments to this account.

getbalance(account='*', minconf=1, include_watchonly=False)[source]

Get the balance

account - The selected account. Defaults to “*” for entire wallet. It may be the default account using “”.

minconf - Only include transactions confirmed at least this many times. (default=1)

include_watchonly - Also include balance in watch-only addresses (see ‘importaddress’) (default=False)

getbestblockhash()[source]

Return hash of best (tip) block in longest block chain.

getblock(block_hash)[source]

Get block <block_hash>

Raises IndexError if block_hash is not valid.

getblockcount()[source]

Return the number of blocks in the longest block chain

getblockhash(height)[source]

Return hash of block in best-block-chain at height.

Raises IndexError if height is not valid.

getblockheader(block_hash, verbose=False)[source]

Get block header <block_hash>

verbose - If true a dict is returned with the values returned by
getblockheader that are not in the block header itself (height, nextblockhash, etc.)

Raises IndexError if block_hash is not valid.

getinfo()[source]

Return a JSON object containing various state info

getmininginfo()[source]

Return a JSON object containing mining-related information

getnewaddress(account=None)[source]

Return a new Bitcoin address for receiving payments.

If account is not None, it is added to the address book so payments received with the address will be credited to account.

getrawchangeaddress()[source]

Returns a new Bitcoin address, for receiving change.

This is for use with raw transactions, NOT normal use.

getrawmempool(verbose=False)[source]

Return the mempool

getrawtransaction(txid, verbose=False)[source]

Return transaction with hash txid

Raises IndexError if transaction not found.

verbose - If true a dict is returned instead with additional information on the transaction.

Note that if all txouts are spent and the transaction index is not enabled the transaction may not be available.

getreceivedbyaddress(addr, minconf=1)[source]

Return total amount received by given a (wallet) address

Get the amount received by <address> in transactions with at least [minconf] confirmations.

Works only for addresses in the local wallet; other addresses will always show zero.

addr - The address. (CBitcoinAddress instance)

minconf - Only include transactions confirmed at least this many times. (default=1)

gettransaction(txid)[source]

Get detailed information about in-wallet transaction txid

Raises IndexError if transaction not found in the wallet.

FIXME: Returned data types are not yet converted.

gettxout(outpoint, includemempool=True)[source]

Return details about an unspent transaction output.

Raises IndexError if outpoint is not found or was spent.

includemempool - Include mempool txouts

importaddress(addr, label='', rescan=True)[source]

Adds an address or pubkey to wallet without the associated privkey.

listunspent(minconf=0, maxconf=9999999, addrs=None)[source]

Return unspent transaction outputs in wallet

Outputs will have between minconf and maxconf (inclusive) confirmations, optionally filtered to only include txouts paid to addresses in addrs.

lockunspent(unlock, outpoints)[source]

Lock or unlock outpoints

removenode(node)[source]
sendmany(fromaccount, payments, minconf=1, comment='', subtractfeefromamount=[])[source]

Send amount to given addresses.

payments - dict with {address: amount}

sendrawtransaction(tx, allowhighfees=False)[source]

Submit transaction to local node and network.

allowhighfees - Allow even if fees are unreasonably high.

sendtoaddress(addr, amount, comment='', commentto='', subtractfeefromamount=False)[source]

Send amount to a given address

signrawtransaction(tx, *args)[source]

Sign inputs for transaction

FIXME: implement options

signrawtransactionwithwallet(tx, *args)[source]
Sign inputs for transaction
bicoincore >= 0.17.x

FIXME: implement options

submitblock(block, params=None)[source]

Submit a new block to the network.

params is optional and is currently ignored by bitcoind. See https://en.bitcoin.it/wiki/BIP_0022 for full specification.

unlockwallet(password, timeout=60)[source]

Stores the wallet decryption key in memory for ‘timeout’ seconds.

password - The wallet passphrase.

timeout - The time to keep the decryption key in seconds. (default=60)

validateaddress(address)[source]

Return information about an address

signature

class bitcoincash.signature.DERSignature(r, s, length)[source]

Bases: bitcoincash.core.serialize.ImmutableSerializable

length
r
s
classmethod stream_deserialize(f)[source]

Deserialize from a stream

stream_serialize(f)[source]

Serialize to a stream

signmessage

class bitcoincash.signmessage.BitcoinMessage(message='', magic='Bitcoin Signed Message:n')[source]

Bases: bitcoincash.core.serialize.ImmutableSerializable

magic
message
classmethod stream_deserialize(f)[source]

Deserialize from a stream

stream_serialize(f)[source]

Serialize to a stream

bitcoincash.signmessage.SignMessage(key, message)[source]
bitcoincash.signmessage.VerifyMessage(address, message, sig)[source]

wallet

Wallet-related functionality

Includes things like representing addresses and converting them to/from scriptPubKeys; currently there is no actual wallet support implemented.

exception bitcoincash.wallet.CBitcoinAddressError[source]

Bases: Exception

Raised when an invalid Bitcoin address is encountered

class bitcoincash.wallet.CBitcoinAddress(s)[source]

Bases: bitcoincash.cashaddr.CashAddrData

A Bitcoin address

Initialize from cashaddr-encoded string

Note: subclasses put your initialization routines here, but ignore the argument - that’s handled by __new__(), and .from_bytes() will call __init__() with None in place of the string.

classmethod from_bytes(data, prefix, kind)[source]
classmethod from_scriptPubKey(scriptPubKey)[source]

Convert a scriptPubKey to a CBitcoinAddress

Returns a CBitcoinAddress subclass, either P2SHBitcoinAddress or P2PKHBitcoinAddress. If the scriptPubKey is not recognized CBitcoinAddressError will be raised.

to_scriptHash(*, hashfunc='sha256')[source]

A script hash is the hash of the binary bytes of the locking script (ScriptPubKey), expressed as a hexadecimal string. Like for block and transaction hashes, when converting the big-endian binary hash to a hexadecimal string the least-significant byte appears first, and the most-significant byte last.

This representation of an address is used in the Electrum protocol.

to_scriptPubKey()[source]

Convert an address to a scriptPubKey

class bitcoincash.wallet.P2SHBitcoinAddress(s)[source]

Bases: bitcoincash.wallet.CBitcoinAddress

Initialize from cashaddr-encoded string

Note: subclasses put your initialization routines here, but ignore the argument - that’s handled by __new__(), and .from_bytes() will call __init__() with None in place of the string.

classmethod from_bytes(data, prefix, kind)[source]
classmethod from_redeemScript(redeemScript)[source]

Convert a redeemScript to a P2SH address

Convenience function: equivalent to P2SHBitcoinAddress.from_scriptPubKey(redeemScript.to_p2sh_scriptPubKey())

classmethod from_scriptPubKey(scriptPubKey)[source]

Convert a scriptPubKey to a P2SH address

Raises CBitcoinAddressError if the scriptPubKey isn’t of the correct form.

to_scriptPubKey()[source]

Convert an address to a scriptPubKey

class bitcoincash.wallet.P2PKHBitcoinAddress(s)[source]

Bases: bitcoincash.wallet.CBitcoinAddress

Initialize from cashaddr-encoded string

Note: subclasses put your initialization routines here, but ignore the argument - that’s handled by __new__(), and .from_bytes() will call __init__() with None in place of the string.

classmethod from_bytes(data, prefix, kind)[source]
classmethod from_pubkey(pubkey, accept_invalid=False)[source]

Create a P2PKH bitcoin address from a pubkey

Raises CBitcoinAddressError if pubkey is invalid, unless accept_invalid is True.

The pubkey must be a bytes instance; CECKey instances are not accepted.

classmethod from_scriptPubKey(scriptPubKey, accept_non_canonical_pushdata=True, accept_bare_checksig=True)[source]

Convert a scriptPubKey to a P2PKH address

Raises CBitcoinAddressError if the scriptPubKey isn’t of the correct form.

accept_non_canonical_pushdata - Allow non-canonical pushes (default True)

accept_bare_checksig - Treat bare-checksig as P2PKH scriptPubKeys (default True)

to_scriptPubKey()[source]

Convert an address to a scriptPubKey

class bitcoincash.wallet.CKey(secret, compressed=True)[source]

Bases: object

An encapsulated secp256k1 private key

Attributes:

pub - The corresponding CPubKey for this private key

is_compressed - True if compressed

is_compressed
signECDSA(hash)[source]
signSchnorr(hash)[source]

Create a Schnorr signature

sign_compactECDSA(hash)[source]
exception bitcoincash.wallet.CBitcoinSecretError[source]

Bases: bitcoincash.base58.Base58Error

class bitcoincash.wallet.CBitcoinSecret(s)[source]

Bases: bitcoincash.base58.CBase58Data, bitcoincash.wallet.CKey

A base58-encoded secret key

classmethod from_secret_bytes(secret, compressed=True)[source]

Create a secret key from a 32-byte secret

bitcoincash.wallet.legacy_to_cashaddr(legacy_addr)[source]