Package org.bitcoinj.core
The core package contains classes for network messages like
Block
and
Transaction
, peer connectivity via PeerGroup
,
and block chain management.
If what you're doing can be described as basic bitcoin tasks, the code is probably found here.
To learn more please consult the documentation on the website.-
Interface Summary Interface Description PeerFilterProvider An interface which provides the information required to properly filter data downloaded from Peers.TransactionBag This interface is used to abstract theWallet
and theTransaction
TransactionBroadcast.ProgressCallback An interface for receiving progress information on the propagation of the tx, from 0.0 to 1.0TransactionBroadcaster A general interface which declares the ability to broadcast transactions.TransactionConfidence.Listener A confidence listener is informed when the level ofTransactionConfidence
is updated by something, like for example aWallet
.UTXOProvider A UTXOProvider encapsulates functionality for returning unspent transaction outputs, for use by the wallet or other code that crafts spends. -
Class Summary Class Description AbstractBlockChain An AbstractBlockChain holds a series ofBlock
objects, links them together, and knows how to verify that the chain follows the rules of theNetworkParameters
for this chain.AddressMessage AddressV1Message Represents an "addr" message on the P2P network, which contains broadcast IP addresses of other peers.AddressV2Message Represents an "addrv2" message on the P2P network, which contains broadcast IP addresses of other peers.BitcoinSerializer Methods to serialize and de-serialize messages to the Bitcoin network format as defined in the protocol specification.BitcoinSerializer.BitcoinPacketHeader Block A block is a group of transactions, and is one of the fundamental data structures of the Bitcoin system.BlockChain A BlockChain implements the simplified payment verification mode of the Bitcoin protocol.BlockLocator Represents Block Locator in GetBlocks and GetHeaders messagesBloomFilter A Bloom filter is a probabilistic data structure which can be sent to another client so that it can avoid sending us transactions that aren't relevant to our set of keys.CheckpointManager Vends hard-codedStoredBlock
s for blocks throughout the chain.ChildMessage Represents a Message type that can be contained within another Message.Context The Context object holds various objects and pieces of configuration that are scoped to a specific instantiation of bitcoinj for a specific network.EmptyMessage Parent class for header only messages that don't have a payload.FeeFilterMessage Represents an "feefilter" message on the P2P network, which instructs a peer to filter transaction invs for transactions that fall below the feerate provided.FilteredBlock A FilteredBlock is used to relay a block with its transactions filtered using aBloomFilter
.FullPrunedBlockChain A FullPrunedBlockChain works in conjunction with aFullPrunedBlockStore
to verify all the rules of the Bitcoin system, with the downside being a large cost in system resources.GetAddrMessage Represents the "getaddr" P2P protocol message, which requests networkAddressMessage
s from a peer.GetBlocksMessage Represents the "getblocks" P2P network message, which requests the hashes of the parts of the block chain we're missing.GetDataMessage Represents the "getdata" P2P network message, which requests the contents of blocks or transactions given their hashes.GetHeadersMessage The "getheaders" command is structurally identical to "getblocks", but has different meaning.HeadersMessage A protocol message that contains a repeated series of block headers, sent in response to the "getheaders" command.InventoryItem InventoryMessage Represents the "inv" P2P network message.ListMessage Abstract superclass of classes with list based payload, ie InventoryMessage and GetDataMessage.LockTime Wrapper for transaction lock time, specified either as a block heightLockTime.HeightLock
or as a timestampLockTime.TimeLock
(in seconds since epoch).LockTime.HeightLock ALockTime
instance that contains a block height.LockTime.TimeLock ALockTime
instance that contains a timestamp.MemoryPoolMessage The "mempool" message asks a remote peer to announce all transactions in its memory pool, possibly restricted by any Bloom filter set on the connection.Message A Message is a data structure that can be serialized/deserialized using the Bitcoin serialization format.MessageSerializer Generic interface for classes which serialize/deserialize messages.NetworkParameters NetworkParameters contains the data needed for working with an instantiation of a Bitcoin chain.NotFoundMessage Sent by a peer when a getdata request doesn't find the requested data in the mempool.PartialMerkleTree A data structure that contains proofs of block inclusion for one or more transactions, in an efficient manner.Peer A Peer handles the high level communication with a Bitcoin node, extending aPeerSocketHandler
which handles low-level message (de)serialization.PeerAddress A PeerAddress holds an IP address and port number representing the network location of a peer in the Bitcoin P2P network.PeerGroup Runs a set of connections to the P2P network, brings up connections to replace disconnected nodes and manages the interaction between them all.PeerSocketHandler Handles high-level message (de)serialization for peers, acting as the bridge between theorg.bitcoinj.net
classes andPeer
.Ping See BIP31 for details.Pong See BIP31 for details.RejectMessage A message sent by nodes when a message we sent was rejected (ie a transaction had too little fee/was invalid/etc).SendAddrV2Message Represents thesendaddrv2
P2P protocol message, which indicates that a node can understand and prefers to receiveaddrv2
messages instead ofaddr
messages.SendHeadersMessage A new message, "sendheaders", which indicates that a node prefers to receive new block announcements via a "headers" message rather than an "inv".StoredBlock Wraps aBlock
object with extra data that can be derived from the block chain but is slow or inconvenient to calculate.StoredUndoableBlock Contains minimal data necessary to disconnect/connect the transactions in the stored block at will.Transaction A transaction represents the movement of coins from some addresses to some other addresses.TransactionBroadcast Represents a single transaction broadcast that we are performing.TransactionConfidence A TransactionConfidence object tracks data you can use to make a confidence decision about a transaction.TransactionConfidence.Factory TransactionInput A transfer of coins from one address to another creates a transaction in which the outputs can be claimed by the recipient in the input of another transaction.TransactionOutPoint This message is a reference or pointer to an output of a different transaction.TransactionOutput A TransactionOutput message contains a scriptPubKey that controls who is able to spend its value.TransactionOutputChanges TransactionOutputChanges represents a delta to the set of unspent outputs.TransactionWitness TxConfidenceTable Tracks transactions that are being announced across the network.UnknownMessage Instances of this class are not safe for use by multiple threads.Utils A collection of various utility methods that are helpful for working with the Bitcoin protocol.UTXO A UTXO message contains the information necessary to check a spending transaction.VersionAck The verack message, sent by a client accepting the version message they received from their peer.VersionMessage A VersionMessage holds information exchanged during connection setup with another peer. -
Enum Summary Enum Description AbstractBlockChain.NewBlockType Indicates whether new Block was on the best chain or notBlock.VerifyFlag Flags used to control which elements of block validation are done on received blocks.BloomFilter.BloomUpdate The BLOOM_UPDATE_* constants control when the bloom filter is auto-updated by the peer using it as a filter, either never, for all outputs or only for P2PK outputs (default)InventoryItem.Type NetworkParameters.ProtocolVersion PeerGroup.FilterRecalculateMode RejectMessage.RejectCode Transaction.Purpose This enum describes the underlying reason the transaction was created.Transaction.SigHash These constants are a part of a scriptSig signature on the inputs.TransactionConfidence.ConfidenceType Describes the state of the transaction in general terms.TransactionConfidence.Listener.ChangeReason An enum that describes why a transaction confidence listener is being invoked (i.e.TransactionConfidence.Source Information about where the transaction was first seen (network, sent direct from peer, created by ourselves).TransactionInput.ConnectionResult TransactionInput.ConnectMode -
Exception Summary Exception Description InsufficientMoneyException Thrown to indicate that you don't have enough money available to perform the requested operation.PeerException Thrown when a problem occurs in communicating with a peer, and we should retry.ProtocolException PrunedException PrunedException is thrown in cases where a fully verifying node has deleted (pruned) old block data that turned out to be necessary for handling a re-org.RejectedTransactionException This exception is used by the TransactionBroadcast class to indicate that a broadcast Transaction has been rejected by the network, for example because it violates a protocol rule.UTXOProviderException VerificationException VerificationException.BlockVersionOutOfDate VerificationException.CoinbaseHeightMismatch VerificationException.CoinbaseScriptSizeOutOfRange VerificationException.DuplicatedOutPoint VerificationException.EmptyInputsOrOutputs VerificationException.ExcessiveValue VerificationException.LargerThanMaxBlockSize VerificationException.NegativeValueOutput VerificationException.NoncanonicalSignature VerificationException.UnexpectedCoinbaseInput