Package org.bitcoinj.base
The
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
future release.
-
Interface Summary Interface Description Address Interface for addresses, e.g.AddressParser Interface for parsing and validating address strings.AddressParser.Strict Monetary Classes implementing this interface represent a monetary value, such as a Bitcoin or fiat amount.Network Interface for a generic Bitcoin-like cryptocurrency network. -
Class Summary Class Description Base58 Base58 is a way to encode Bitcoin addresses (or arbitrary data) as alphanumeric strings.Bech32 Implementation of the Bech32 encoding.Bech32.Bech32Data Coin Represents a monetary Bitcoin value.DefaultAddressParser Address parser that knows about the address types supported by bitcoinj core and is configurable with additional network types.LegacyAddress A Bitcoin address looks like 1MsScoe2fTJoq4ZPdQgqyhgWeoNamYPevy and is derived from an elliptic curve public key plus a set of network parameters.SegwitAddress Implementation of native segwit addresses.Sha256Hash ASha256Hash
wraps abyte[]
so thatSha256Hash.equals(java.lang.Object)
andSha256Hash.hashCode()
work correctly, allowing it to be used as a key in a map.VarInt A variable-length encoded unsigned integer using Satoshi's encoding (a.k.a. -
Enum Summary Enum Description Bech32.Encoding BitcoinNetwork A convenientenum
representation of a Bitcoin network.LegacyAddress.AddressHeader Address header of legacy P2PKH addresses for standard Bitcoin networks.LegacyAddress.P2SHHeader Address header of legacy P2SH addresses for standard Bitcoin networks.ScriptType Supported Bitcoin script types and their script identifier strings.SegwitAddress.SegwitHrp Human-readable part (HRP) of Segwit addresses for standard Bitcoin networks.