Class BitcoinNetwork
java.lang.Object
com.codename1.crypto.bitcoin.BitcoinNetwork
The parameters that make an address or key belong to one Bitcoin network.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final BitcoinNetworkBitcoin mainnet:1...,3...,bc1....static final BitcoinNetworkRegtest: testnet's encodings except for thebcrtHRP.static final BitcoinNetworkSignet, which shares testnet's encodings.static final BitcoinNetworktestnet3 and testnet4:m.../n...,2...,tb1.... -
Method Summary
Modifier and TypeMethodDescriptionThe Bech32 human-readable part of a SegWit address.intThe BIP-44 coin type: 0 on mainnet, 1 on every test network.getName()The network's name.intThe Base58Check version byte of a P2PKH address.intThe Base58Check version byte of a P2SH address.intThe first byte of a WIF private key.intThe BIP-32 private version bytes (xprv/tprv).intThe BIP-32 public version bytes (xpub/tpub).toString()Returns a string representation of the object.
-
Field Details
-
MAINNET
Bitcoin mainnet:1...,3...,bc1.... -
TESTNET
testnet3 and testnet4:m.../n...,2...,tb1.... -
SIGNET
Signet, which shares testnet's encodings. -
REGTEST
Regtest: testnet's encodings except for thebcrtHRP.
-
-
Method Details
-
getName
The network's name. -
getP2pkhVersion
public int getP2pkhVersion()The Base58Check version byte of a P2PKH address. -
getP2shVersion
public int getP2shVersion()The Base58Check version byte of a P2SH address. -
getBech32Hrp
The Bech32 human-readable part of a SegWit address. -
getWifPrefix
public int getWifPrefix()The first byte of a WIF private key. -
getXpubVersion
public int getXpubVersion()The BIP-32 public version bytes (xpub/tpub). -
getXprvVersion
public int getXprvVersion()The BIP-32 private version bytes (xprv/tprv). -
getCoinType
public int getCoinType()The BIP-44 coin type: 0 on mainnet, 1 on every test network. -
toString
Description copied from class:ObjectReturns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method. The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of: getClass().getName() + '@' + Integer.toHexString(hashCode())
-