base package provides fundamental types for bitcoinj. These types must have
minimal dependencies. The criteria for allowed dependencies for
base types are:
- No dependencies on other packages of bitcoinj
- No API dependencies on external libraries other than the core JDK
- Implementation dependencies on Guava are allowed for now (but should be avoided as much as possible)
Temporary exception: In the 0.17 release, we are allowing some dependencies on other packages, e.g. to
NetworkParameters provided that those references are in deprecated methods. This will
smooth migration by allowing users to, for example, replace
import org.bitcoinj.base.Address with
import org.bitcoinj.core.Address as first step of conversion and remove usages of the deprecated methods in
a second step.
The base package will help us make bitcoinj more modular as we will use it to break circular dependencies
between existing packages. We are also considering splitting
base into a separate JAR/module in a
Interface Summary Interface Description AddressInterface for addresses, e.g. AddressParserInterface for parsing and validating address strings. AddressParser.Strict MonetaryClasses implementing this interface represent a monetary value, such as a Bitcoin or fiat amount. NetworkInterface for a generic Bitcoin-like cryptocurrency network.
Class Summary Class Description Base58Base58 is a way to encode Bitcoin addresses (or arbitrary data) as alphanumeric strings. Bech32Implementation of the Bech32 encoding. Bech32.Bech32Data CoinRepresents a monetary Bitcoin value. DefaultAddressParserAddress parser that knows about the address types supported by bitcoinj core and is configurable with additional network types. LegacyAddressA Bitcoin address looks like 1MsScoe2fTJoq4ZPdQgqyhgWeoNamYPevy and is derived from an elliptic curve public key plus a set of network parameters. SegwitAddressImplementation of native segwit addresses. Sha256Hash VarIntA variable-length encoded unsigned integer using Satoshi's encoding (a.k.a.
Enum Summary Enum Description Bech32.Encoding BitcoinNetworkA convenient
enumrepresentation of a Bitcoin network.
LegacyAddress.AddressHeaderAddress header of legacy P2PKH addresses for standard Bitcoin networks. LegacyAddress.P2SHHeaderAddress header of legacy P2SH addresses for standard Bitcoin networks. ScriptTypeSupported Bitcoin script types and their script identifier strings. SegwitAddress.SegwitHrpHuman-readable part (HRP) of Segwit addresses for standard Bitcoin networks.