Package org.bitcoinj.base
The
base
package provides foundational 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 and
slf4j-api
Temporary exception: In the 0.17 release, we are allowing some dependencies on other packages, e.g. to
NetworkParameters
or to Guava provided that those references are in deprecated methods.
This smooths migration by allowing users to, for example, replace import org.bitcoinj.core.Address
with
import org.bitcoinj.base.Address
as first step of conversion and then remove usages of the deprecated methods
of Address
in a second step.
The base package makes bitcoinj more modular as it breaks circular dependencies between existing packages and provides
a "zero-dependency" foundation for the other packages. In a future release base
will be
split into a separate JAR/module (tentatively bitcoinj-base
.)
-
Interface Summary Interface Description Address Interface for addresses, e.g.AddressParser Functional interface for address parsing.AddressParser.AddressParserProvider Interface implemented by custom address parser providers.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 Bech32 decoded data in 5-bit byte format.Coin Represents a monetary Bitcoin value.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 Enumeration of known Bech32 encoding format types: Bech32 and Bech32m.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.