Package | Description |
---|---|
org.bitcoinj.core |
The core package contains classes for network messages like
Block and
Transaction , peer connectivity via PeerGroup ,
and block chain management. |
org.bitcoinj.core.listeners | |
org.bitcoinj.crypto |
The crypto package contains classes that work with key derivation algorithms like scrypt (passwords to AES keys),
BIP 32 hierarchies (chains of keys from a root seed), X.509 utilities for the payment protocol and other general
cryptography tasks.
|
org.bitcoinj.jni | |
org.bitcoinj.params |
Network parameters encapsulate some of the differences between different Bitcoin networks such as the main
network, the testnet, regtest mode, unit testing params and so on.
|
org.bitcoinj.protocols.channels |
Micropayment channels allow for rapid tiny payments to be made to a third party once a channel has been set up, using
some of the advanced features of the Bitcoin protocol.
|
org.bitcoinj.protocols.payments |
The BIP70 payment protocol wraps Bitcoin transactions and adds various useful features like memos, refund addresses
and authentication.
|
org.bitcoinj.wallet |
Classes that support the
Wallet , which knows how to find and save transactions relevant to
a set of keys or scripts, calculate balances, and spend money: the wallet has many features and can be extended
in various ways, please refer to the website for documentation on how to use it. |
Modifier and Type | Class and Description |
---|---|
class |
ProtocolException |
class |
ScriptException |
static class |
VerificationException.BlockVersionOutOfDate |
static class |
VerificationException.CoinbaseHeightMismatch |
static class |
VerificationException.CoinbaseScriptSizeOutOfRange |
static class |
VerificationException.DuplicatedOutPoint |
static class |
VerificationException.EmptyInputsOrOutputs |
static class |
VerificationException.ExcessiveValue |
static class |
VerificationException.LargerThanMaxBlockSize |
static class |
VerificationException.NegativeValueOutput |
static class |
VerificationException.UnexpectedCoinbaseInput |
Modifier and Type | Method and Description |
---|---|
boolean |
AbstractBlockChain.add(Block block)
Processes a received block and tries to add it to the chain.
|
boolean |
BlockChain.add(FilteredBlock block) |
boolean |
AbstractBlockChain.add(FilteredBlock block)
Processes a received block and tries to add it to the chain.
|
protected StoredBlock |
BlockChain.addToBlockStore(StoredBlock storedPrev,
Block blockHeader) |
protected abstract StoredBlock |
AbstractBlockChain.addToBlockStore(StoredBlock storedPrev,
Block block)
Adds/updates the given
Block with the block store. |
protected StoredBlock |
FullPrunedBlockChain.addToBlockStore(StoredBlock storedPrev,
Block block) |
protected StoredBlock |
BlockChain.addToBlockStore(StoredBlock storedPrev,
Block blockHeader,
TransactionOutputChanges txOutChanges) |
protected abstract StoredBlock |
AbstractBlockChain.addToBlockStore(StoredBlock storedPrev,
Block header,
TransactionOutputChanges txOutputChanges)
Adds/updates the given
StoredBlock with the block store. |
protected StoredBlock |
FullPrunedBlockChain.addToBlockStore(StoredBlock storedPrev,
Block header,
TransactionOutputChanges txOutChanges) |
StoredBlock |
StoredBlock.build(Block block)
Creates a new StoredBlock, calculating the additional fields by adding to the values in this block.
|
void |
Transaction.checkCoinBaseHeight(int height)
Check block height is in coinbase input script, for use after BIP 34
enforcement is enabled.
|
abstract void |
NetworkParameters.checkDifficultyTransitions(StoredBlock storedPrev,
Block next,
BlockStore blockStore)
Throws an exception if the block's difficulty is not correct.
|
protected boolean |
Block.checkProofOfWork(boolean throwException)
Returns true if the hash of the block is OK (lower than difficulty target).
|
protected abstract TransactionOutputChanges |
AbstractBlockChain.connectTransactions(int height,
Block block)
Connect each transaction in block.transactions, verifying them as we go and removing spent outputs
If an error is encountered in a transaction, no changes should be made to the underlying BlockStore.
|
protected TransactionOutputChanges |
FullPrunedBlockChain.connectTransactions(int height,
Block block) |
protected abstract TransactionOutputChanges |
AbstractBlockChain.connectTransactions(StoredBlock newBlock)
Load newBlock from BlockStore and connect its transactions, returning changes to the set of unspent transactions.
|
protected TransactionOutputChanges |
FullPrunedBlockChain.connectTransactions(StoredBlock newBlock) |
BigInteger |
Block.getDifficultyTargetAsInteger()
Returns the difficulty target as a 256 bit value that can be compared to a SHA-256 hash.
|
List<Sha256Hash> |
FilteredBlock.getTransactionHashes()
Gets a list of leaf hashes which are contained in the partial merkle tree in this filtered block
|
Sha256Hash |
PartialMerkleTree.getTxnHashAndMerkleRoot(List<Sha256Hash> matchedHashesOut)
Extracts tx hashes that are in this merkle tree
and returns the merkle root of this tree.
|
BigInteger |
Block.getWork()
Returns the work represented by this block.
|
protected void |
Peer.processTransaction(Transaction tx) |
boolean |
FilteredBlock.provideTransaction(Transaction tx)
Provide this FilteredBlock with a transaction which is in its Merkle tree.
|
void |
TransactionInput.verify()
For a connected transaction, runs the script against the connected pubkey and verifies they are correct.
|
void |
Transaction.verify()
Checks the transaction contents for sanity, in ways that can be done in a standalone manner.
|
void |
Block.verify(int height,
EnumSet<Block.VerifyFlag> flags)
Verifies both the header and that the transactions hash to the merkle root.
|
void |
TransactionInput.verify(TransactionOutput output)
Verifies that this input can spend the given output.
|
void |
Block.verifyHeader()
Checks the block data to ensure it follows the rules laid out in the network parameters.
|
void |
Block.verifyTransactions(int height,
EnumSet<Block.VerifyFlag> flags)
Checks the block contents
|
Modifier and Type | Method and Description |
---|---|
void |
NewBestBlockListener.notifyNewBestBlock(StoredBlock block)
Called when a new block on the best chain is seen, after relevant
transactions are extracted and sent to us via either
TransactionReceivedInBlockListener#receiveFromBlock(org.bitcoinj.core.Transaction, org.bitcoinj.core.StoredBlock, org.bitcoinj.core.BlockChain.NewBlockType, int relativityOffset)
or TransactionReceivedInBlockListener#notifyTransactionIsInBlock(org.bitcoinj.core.Sha256Hash, org.bitcoinj.core.StoredBlock, org.bitcoinj.core.BlockChain.NewBlockType, int) . |
void |
AbstractBlockChainListener.notifyNewBestBlock(StoredBlock block)
Deprecated.
|
boolean |
TransactionReceivedInBlockListener.notifyTransactionIsInBlock(Sha256Hash txHash,
StoredBlock block,
AbstractBlockChain.NewBlockType blockType,
int relativityOffset)
Called by the
BlockChain when we receive a new FilteredBlock that contains the given
transaction hash in its merkle tree. |
boolean |
AbstractBlockChainListener.notifyTransactionIsInBlock(Sha256Hash txHash,
StoredBlock block,
AbstractBlockChain.NewBlockType blockType,
int relativityOffset)
Deprecated.
|
void |
TransactionReceivedInBlockListener.receiveFromBlock(Transaction tx,
StoredBlock block,
AbstractBlockChain.NewBlockType blockType,
int relativityOffset)
Called by the
BlockChain when we receive a new block that contains a relevant transaction. |
void |
AbstractBlockChainListener.receiveFromBlock(Transaction tx,
StoredBlock block,
AbstractBlockChain.NewBlockType blockType,
int relativityOffset)
Deprecated.
|
void |
AbstractBlockChainListener.reorganize(StoredBlock splitPoint,
List<StoredBlock> oldBlocks,
List<StoredBlock> newBlocks)
Deprecated.
|
void |
ReorganizeListener.reorganize(StoredBlock splitPoint,
List<StoredBlock> oldBlocks,
List<StoredBlock> newBlocks)
Called by the
BlockChain when the best chain
(representing total work done) has changed. |
Modifier and Type | Method and Description |
---|---|
static TransactionSignature |
TransactionSignature.decodeFromBitcoin(byte[] bytes,
boolean requireCanonicalEncoding)
Deprecated.
use
#decodeFromBitcoin(byte[], boolean, boolean instead}. |
static TransactionSignature |
TransactionSignature.decodeFromBitcoin(byte[] bytes,
boolean requireCanonicalEncoding,
boolean requireCanonicalSValue)
Returns a decoded signature.
|
Modifier and Type | Method and Description |
---|---|
void |
NativeBlockChainListener.notifyNewBestBlock(StoredBlock block) |
boolean |
NativeBlockChainListener.notifyTransactionIsInBlock(Sha256Hash txHash,
StoredBlock block,
AbstractBlockChain.NewBlockType blockType,
int relativityOffset) |
void |
NativeBlockChainListener.receiveFromBlock(Transaction tx,
StoredBlock block,
AbstractBlockChain.NewBlockType blockType,
int relativityOffset) |
void |
NativeBlockChainListener.reorganize(StoredBlock splitPoint,
List<StoredBlock> oldBlocks,
List<StoredBlock> newBlocks) |
Modifier and Type | Method and Description |
---|---|
void |
AbstractBitcoinNetParams.checkDifficultyTransitions(StoredBlock storedPrev,
Block nextBlock,
BlockStore blockStore) |
void |
TestNet3Params.checkDifficultyTransitions(StoredBlock storedPrev,
Block nextBlock,
BlockStore blockStore) |
Modifier and Type | Method and Description |
---|---|
PaymentChannelServerState |
StoredServerChannel.getOrCreateState(Wallet wallet,
TransactionBroadcaster broadcaster)
Gets the canonical
PaymentChannelServerState object for this channel, either by returning an existing one
or by creating a new one. |
boolean |
PaymentChannelServerState.incrementPayment(Coin refundSize,
byte[] signatureBytes)
Called when the client provides us with a new signature and wishes to increment total payment by size.
|
ListenableFuture<PaymentChannelServerState> |
PaymentChannelServerState.provideContract(Transaction contract)
Called when the client provides the multi-sig contract.
|
void |
PaymentChannelV1ClientState.provideRefundSignature(byte[] theirSignature,
org.spongycastle.crypto.params.KeyParameter userKey)
When the servers signature for the refund transaction is received, call this to verify it and sign the
complete refund ourselves.
|
byte[] |
PaymentChannelV1ServerState.provideRefundTransaction(Transaction refundTx,
byte[] clientMultiSigPubKey)
Called when the client provides the refund transaction.
|
Constructor and Description |
---|
PaymentChannelClientState(Wallet wallet,
ECKey myKey,
ECKey serverKey,
Coin value,
long expiryTimeInSeconds)
Creates a state object for a payment channel client.
|
PaymentChannelV1ClientState(Wallet wallet,
ECKey myKey,
ECKey serverMultisigKey,
Coin value,
long expiryTimeInSeconds)
Creates a state object for a payment channel client.
|
PaymentChannelV2ClientState(Wallet wallet,
ECKey myKey,
ECKey serverMultisigKey,
Coin value,
long expiryTimeInSeconds) |
Modifier and Type | Method and Description |
---|---|
ListenableFuture<PaymentProtocol.Ack> |
PaymentSession.sendPayment(List<Transaction> txns,
Address refundAddr,
String memo)
Generates a Payment message and sends the payment to the merchant who sent the PaymentRequest.
|
Modifier and Type | Method and Description |
---|---|
void |
Wallet.commitTx(Transaction tx)
Updates the wallet with the given transaction: puts it into the pending pool, sets the spent flags and runs
the onCoinsSent/onCoinsReceived event listener.
|
boolean |
Wallet.maybeCommitTx(Transaction tx)
Calls
Wallet.commitTx(org.bitcoinj.core.Transaction) if tx is not already in the pending pool |
void |
Wallet.notifyNewBestBlock(StoredBlock block)
Called by the
BlockChain when a new block on the best chain is seen, AFTER relevant wallet
transactions are extracted and sent to us UNLESS the new block caused a re-org, in which case this will
not be called (the Wallet.reorganize(StoredBlock, java.util.List, java.util.List) method will
call this one in that case). |
boolean |
Wallet.notifyTransactionIsInBlock(Sha256Hash txHash,
StoredBlock block,
AbstractBlockChain.NewBlockType blockType,
int relativityOffset)
Called by the
BlockChain when we receive a new filtered block that contains a transactions previously
received by a call to Wallet.receivePending(org.bitcoinj.core.Transaction, java.util.List<org.bitcoinj.core.Transaction>, boolean) . |
void |
Wallet.receiveFromBlock(Transaction tx,
StoredBlock block,
AbstractBlockChain.NewBlockType blockType,
int relativityOffset)
Called by the
BlockChain when we receive a new block that sends coins to one of our addresses or
spends coins from one of our addresses (note that a single transaction can do both). |
void |
Wallet.receivePending(Transaction tx,
List<Transaction> dependencies)
Called when we have found a transaction (via network broadcast or otherwise) that is relevant to this wallet
and want to record it.
|
void |
Wallet.receivePending(Transaction tx,
List<Transaction> dependencies,
boolean overrideIsRelevant)
Called when we have found a transaction (via network broadcast or otherwise) that is relevant to this wallet
and want to record it.
|
void |
Wallet.reorganize(StoredBlock splitPoint,
List<StoredBlock> oldBlocks,
List<StoredBlock> newBlocks)
Don't call this directly.
|
Copyright © 2016. All rights reserved.