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.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.script |
Classes for working with and executing Bitcoin script programs, as embedded in inputs and outputs.
|
org.bitcoinj.signers |
Transaction signers know how to calculate signatures over transactions in different contexts, for example, using
local private keys or fetching them from remote servers.
|
org.bitcoinj.store |
Block stores persist blockchain data downloaded from remote peers.
|
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 | Field and Description |
---|---|
protected Sha256Hash |
CheckpointManager.dataHash |
Sha256Hash |
InventoryItem.hash |
protected Sha256Hash |
GetBlocksMessage.stopHash |
static Sha256Hash |
Sha256Hash.ZERO_HASH |
Modifier and Type | Field and Description |
---|---|
protected Map<Integer,Sha256Hash> |
NetworkParameters.checkpoints |
protected List<Sha256Hash> |
GetBlocksMessage.locator |
Modifier and Type | Method and Description |
---|---|
static Sha256Hash |
Sha256Hash.create(byte[] contents)
Deprecated.
|
static Sha256Hash |
Sha256Hash.createDouble(byte[] contents)
Deprecated.
|
Sha256Hash |
CheckpointManager.getDataHash()
Returns a hash of the concatenated checkpoint data.
|
Sha256Hash |
Transaction.getHash()
Returns the transaction hash as you see them in the block explorer.
|
Sha256Hash |
Message.getHash()
This method is a NOP for all classes except Block and Transaction.
|
Sha256Hash |
StoredUndoableBlock.getHash()
Get the hash of the represented block
|
Sha256Hash |
TransactionOutPoint.getHash()
Returns the hash of the transaction this outpoint references/spends/is connected to.
|
Sha256Hash |
Block.getHash()
Returns the hash of the block (which for a valid, solved block should be
below the target).
|
Sha256Hash |
FilteredBlock.getHash()
Gets the hash of the block represented in this Filtered Block
|
Sha256Hash |
PrunedException.getHash() |
Sha256Hash |
UTXO.getHash()
The hash of the transaction which holds this output.
|
Sha256Hash |
GetDataMessage.getHashOf(int i) |
Sha256Hash |
Block.getMerkleRoot()
Returns the merkle root in big endian form, calculating it from transactions if necessary.
|
Sha256Hash |
TransactionOutput.getParentTransactionHash()
Returns the transaction hash that owns this output.
|
Sha256Hash |
Block.getPrevBlockHash()
Returns the hash of the previous block in the chain, as defined by the block header.
|
Sha256Hash |
RejectMessage.getRejectedObjectHash()
Provides the hash of the rejected object (if getRejectedMessage() is either "tx" or "block"), otherwise null.
|
Sha256Hash |
GetBlocksMessage.getStopHash() |
Sha256Hash |
TransactionConfidence.getTransactionHash() |
Sha256Hash |
PartialMerkleTree.getTxnHashAndMerkleRoot(List<Sha256Hash> matchedHashesOut)
Extracts tx hashes that are in this merkle tree
and returns the merkle root of this tree.
|
Sha256Hash |
Transaction.hashForSignature(int inputIndex,
byte[] connectedScript,
byte sigHashType)
This is required for signatures which use a sigHashType which cannot be represented using SigHash and anyoneCanPay
See transaction c99c49da4c38af669dea436d3e73780dfdb6c1ecf9958baa52960e8baee30e73, which has sigHashType 0
|
Sha256Hash |
Transaction.hashForSignature(int inputIndex,
byte[] redeemScript,
Transaction.SigHash type,
boolean anyoneCanPay)
Calculates a signature hash, that is, a hash of a simplified form of the transaction.
|
Sha256Hash |
Transaction.hashForSignature(int inputIndex,
Script redeemScript,
Transaction.SigHash type,
boolean anyoneCanPay)
Calculates a signature hash, that is, a hash of a simplified form of the transaction.
|
static Sha256Hash |
Sha256Hash.of(byte[] contents)
Creates a new instance containing the calculated (one-time) hash of the given bytes.
|
static Sha256Hash |
Sha256Hash.of(File file)
Creates a new instance containing the calculated (one-time) hash of the given file's contents.
|
protected Sha256Hash |
Message.readHash() |
static Sha256Hash |
Sha256Hash.twiceOf(byte[] contents)
Creates a new instance containing the hash of the calculated hash of the given bytes.
|
static Sha256Hash |
Sha256Hash.wrap(byte[] rawHashBytes)
Creates a new instance that wraps the given hash value.
|
static Sha256Hash |
Sha256Hash.wrap(String hexString)
Creates a new instance that wraps the given hash value (represented as a hex string).
|
static Sha256Hash |
Sha256Hash.wrapReversed(byte[] rawHashBytes)
Creates a new instance that wraps the given hash value, but with byte order reversed.
|
Modifier and Type | Method and Description |
---|---|
Set<Sha256Hash> |
AbstractBlockChain.drainOrphanBlocks()
Returns the hashes of the currently stored orphan blocks and then deletes them from this objects storage.
|
Map<Sha256Hash,Integer> |
Transaction.getAppearsInHashes()
Returns a map of block [hashes] which contain the transaction mapped to relativity counters, or null if this
transaction doesn't have that data because it's not stored in the wallet or because it has never appeared in a
block.
|
Map<Sha256Hash,Transaction> |
FilteredBlock.getAssociatedTransactions()
Gets the set of transactions which were provided using provideTransaction() which match in getTransactionHashes()
|
List<Sha256Hash> |
GetBlocksMessage.getLocator() |
List<Sha256Hash> |
FilteredBlock.getTransactionHashes()
Gets a list of leaf hashes which are contained in the partial merkle tree in this filtered block
|
Map<Sha256Hash,Transaction> |
TransactionBag.getTransactionPool(WalletTransaction.Pool pool)
Returns transactions from a specific pool.
|
Modifier and Type | Method and Description |
---|---|
void |
GetDataMessage.addBlock(Sha256Hash hash) |
void |
Transaction.addBlockAppearance(Sha256Hash blockHash,
int relativityOffset) |
void |
GetDataMessage.addFilteredBlock(Sha256Hash hash) |
TransactionInput |
Transaction.addInput(Sha256Hash spendTxHash,
long outputIndex,
Script script)
Creates and adds an input to this transaction, with no checking that it's valid.
|
void |
GetDataMessage.addTransaction(Sha256Hash hash) |
int |
Sha256Hash.compareTo(Sha256Hash other) |
protected ECKey.ECDSASignature |
ECKey.doSign(Sha256Hash input,
BigInteger privateKeyForSigning) |
TransactionConfidence |
TxConfidenceTable.get(Sha256Hash hash)
Returns the
TransactionConfidence for the given hash if we have downloaded it, or null if that tx hash
is unknown to the system at this time. |
ListenableFuture<Block> |
Peer.getBlock(Sha256Hash blockHash)
Asks the connected peer for the block of the given hash, and returns a future representing the answer.
|
TransactionConfidence |
TxConfidenceTable.getOrCreate(Sha256Hash hash)
Returns the
TransactionConfidence for the given hash if we have downloaded it, or null if that tx hash
is unknown to the system at this time. |
Block |
AbstractBlockChain.getOrphanRoot(Sha256Hash from)
An orphan block is one that does not connect to the chain anywhere (ie we can't find its parent, therefore
it's an orphan).
|
ListenableFuture<Transaction> |
Peer.getPeerMempoolTransaction(Sha256Hash hash)
Asks the connected peer for the given transaction from its memory pool.
|
protected StoredBlock |
BlockChain.getStoredBlockInCurrentScope(Sha256Hash hash) |
protected abstract StoredBlock |
AbstractBlockChain.getStoredBlockInCurrentScope(Sha256Hash hash)
For a standard BlockChain, this should return blockStore.get(hash),
for a FullPrunedBlockChain blockStore.getOnceUndoableStoredBlock(hash)
|
protected StoredBlock |
FullPrunedBlockChain.getStoredBlockInCurrentScope(Sha256Hash hash) |
boolean |
AbstractBlockChain.isOrphan(Sha256Hash block)
Returns true if the given block is currently in the orphan blocks list.
|
int |
TxConfidenceTable.numBroadcastPeers(Sha256Hash txHash)
Returns the number of peers that have seen the given hash recently.
|
boolean |
NetworkParameters.passesCheckpoint(int height,
Sha256Hash hash)
Returns true if the block height is either not a checkpoint, or is a checkpoint and the hash matches.
|
static ECKey |
ECKey.recoverFromSignature(int recId,
ECKey.ECDSASignature sig,
Sha256Hash message,
boolean compressed)
Given the components of a signature and a selector value, recover and return the public key
that generated the signature according to the algorithm in SEC1v2 section 4.1.6.
|
TransactionConfidence |
TxConfidenceTable.seen(Sha256Hash hash,
PeerAddress byPeer)
Called by peers when they see a transaction advertised in an "inv" message.
|
ECKey.ECDSASignature |
ECKey.sign(Sha256Hash input)
Signs the given hash and returns the R and S components as BigIntegers.
|
ECKey.ECDSASignature |
ECKey.sign(Sha256Hash input,
org.spongycastle.crypto.params.KeyParameter aesKey)
Signs the given hash and returns the R and S components as BigIntegers.
|
boolean |
ECKey.verify(Sha256Hash sigHash,
ECKey.ECDSASignature signature)
Verifies the given R/S pair (signature) against a hash using the public key.
|
void |
ECKey.verifyOrThrow(Sha256Hash sigHash,
ECKey.ECDSASignature signature)
Verifies the given R/S pair (signature) against a hash using the public key, and throws an exception
if the signature doesn't match
|
Modifier and Type | Method and Description |
---|---|
static PartialMerkleTree |
PartialMerkleTree.buildFromLeaves(NetworkParameters params,
byte[] includeBits,
List<Sha256Hash> allLeafHashes)
Calculates a PMT given the list of leaf hashes and which leaves need to be included.
|
TransactionInput.ConnectionResult |
TransactionInput.connect(Map<Sha256Hash,Transaction> transactions,
TransactionInput.ConnectMode mode)
Connects this input to the relevant output of the referenced transaction if it's in the given map.
|
Sha256Hash |
PartialMerkleTree.getTxnHashAndMerkleRoot(List<Sha256Hash> matchedHashesOut)
Extracts tx hashes that are in this merkle tree
and returns the merkle root of this tree.
|
Constructor and Description |
---|
Block(NetworkParameters params,
long version,
Sha256Hash prevBlockHash,
Sha256Hash merkleRoot,
long time,
long difficultyTarget,
long nonce,
List<Transaction> transactions)
Construct a block initialized with all the given fields.
|
GetBlocksMessage(NetworkParameters params,
List<Sha256Hash> locator,
Sha256Hash stopHash) |
GetHeadersMessage(NetworkParameters params,
List<Sha256Hash> locator,
Sha256Hash stopHash) |
InventoryItem(InventoryItem.Type type,
Sha256Hash hash) |
PrunedException(Sha256Hash hash) |
RejectMessage(NetworkParameters params,
RejectMessage.RejectCode code,
Sha256Hash hash,
String message,
String reason)
Constructs a reject message that fingers the object with the given hash as rejected for the given reason.
|
StoredUndoableBlock(Sha256Hash hash,
List<Transaction> transactions) |
StoredUndoableBlock(Sha256Hash hash,
TransactionOutputChanges txOutChanges) |
TransactionConfidence(Sha256Hash hash) |
TransactionOutPoint(NetworkParameters params,
long index,
Sha256Hash hash) |
UTXO(Sha256Hash hash,
long index,
Coin value,
int height,
boolean coinbase,
Script script)
Creates a stored transaction output.
|
UTXO(Sha256Hash hash,
long index,
Coin value,
int height,
boolean coinbase,
Script script,
String address)
Creates a stored transaction output.
|
UTXOsMessage(NetworkParameters params,
List<TransactionOutput> outputs,
long[] heights,
Sha256Hash chainHead,
long height)
Provide an array of output objects, with nulls indicating that the output was missing.
|
Constructor and Description |
---|
GetBlocksMessage(NetworkParameters params,
List<Sha256Hash> locator,
Sha256Hash stopHash) |
GetHeadersMessage(NetworkParameters params,
List<Sha256Hash> locator,
Sha256Hash stopHash) |
PartialMerkleTree(NetworkParameters params,
byte[] bits,
List<Sha256Hash> hashes,
int origTxCount)
Constructs a new PMT with the given bit set (little endian) and the raw list of hashes including internal hashes,
taking ownership of the list.
|
Modifier and Type | Method and Description |
---|---|
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.
|
Modifier and Type | Method and Description |
---|---|
ECKey.ECDSASignature |
DeterministicKey.sign(Sha256Hash input,
org.spongycastle.crypto.params.KeyParameter aesKey) |
Modifier and Type | Method and Description |
---|---|
void |
NativePaymentChannelServerConnectionEventHandler.channelOpen(Sha256Hash channelId) |
boolean |
NativeBlockChainListener.notifyTransactionIsInBlock(Sha256Hash txHash,
StoredBlock block,
AbstractBlockChain.NewBlockType blockType,
int relativityOffset) |
Modifier and Type | Method and Description |
---|---|
Multimap<Sha256Hash,org.bitcoinj.protocols.channels.StoredClientChannel> |
StoredPaymentChannelClientStates.getChannelMap()
Get a copy of all
StoredClientChannel s |
Map<Sha256Hash,StoredServerChannel> |
StoredPaymentChannelServerStates.getChannelMap()
Get a copy of all
StoredServerChannel s |
Modifier and Type | Method and Description |
---|---|
void |
PaymentChannelServer.ServerConnection.channelOpen(Sha256Hash contractHash)
Triggered when the channel is opened and payments can begin
|
abstract void |
ServerConnectionEventHandler.channelOpen(Sha256Hash channelId)
Triggered when the channel is opened and application messages/payments can begin
|
Coin |
StoredPaymentChannelClientStates.getBalanceForServer(Sha256Hash id)
Returns the outstanding amount of money sent back to us for all channels to this server added together.
|
StoredServerChannel |
StoredPaymentChannelServerStates.getChannel(Sha256Hash id)
Gets the
StoredServerChannel with the given channel id (ie contract transaction hash). |
org.bitcoinj.protocols.channels.StoredClientChannel |
StoredPaymentChannelClientStates.getChannel(Sha256Hash id,
Sha256Hash contractHash)
Finds a channel with the given id and contract hash and returns it, or returns null.
|
long |
StoredPaymentChannelClientStates.getSecondsUntilExpiry(Sha256Hash id)
Returns the number of seconds from now until this servers next channel will expire, or zero if no unexpired
channels found.
|
void |
PaymentChannelClientState.storeChannelInWallet(Sha256Hash id)
Stores this channel's state in the wallet as a part of a
StoredPaymentChannelClientStates wallet
extension and keeps it up-to-date each time payment is incremented. |
Constructor and Description |
---|
PaymentChannelClient(Wallet wallet,
ECKey myKey,
Coin maxValue,
Sha256Hash serverId,
IPaymentChannelClient.ClientConnection conn)
Constructs a new channel manager which waits for
PaymentChannelClient.connectionOpen() before acting. |
PaymentChannelClient(Wallet wallet,
ECKey myKey,
Coin maxValue,
Sha256Hash serverId,
IPaymentChannelClient.ClientConnection conn,
PaymentChannelClient.VersionSelector versionSelector)
Constructs a new channel manager which waits for
PaymentChannelClient.connectionOpen() before acting. |
PaymentChannelClient(Wallet wallet,
ECKey myKey,
Coin maxValue,
Sha256Hash serverId,
long timeWindow,
org.spongycastle.crypto.params.KeyParameter userKeySetup,
IPaymentChannelClient.ClientConnection conn)
Constructs a new channel manager which waits for
PaymentChannelClient.connectionOpen() before acting. |
PaymentChannelClient(Wallet wallet,
ECKey myKey,
Coin maxValue,
Sha256Hash serverId,
long timeWindow,
org.spongycastle.crypto.params.KeyParameter userKeySetup,
IPaymentChannelClient.ClientConnection conn,
PaymentChannelClient.VersionSelector versionSelector)
Constructs a new channel manager which waits for
PaymentChannelClient.connectionOpen() before acting. |
Modifier and Type | Method and Description |
---|---|
int |
Script.getSigInsertionIndex(Sha256Hash hash,
ECKey signingKey)
Returns the index where a signature by the key should be inserted.
|
Modifier and Type | Method and Description |
---|---|
protected abstract CustomTransactionSigner.SignatureAndKey |
CustomTransactionSigner.getSignature(Sha256Hash sighash,
List<ChildNumber> derivationPath) |
Modifier and Type | Field and Description |
---|---|
protected Sha256Hash |
LevelDBFullPrunedBlockStore.chainHeadHash |
protected Sha256Hash |
DatabaseFullPrunedBlockStore.chainHeadHash |
protected Sha256Hash |
LevelDBFullPrunedBlockStore.verifiedChainHeadHash |
protected Sha256Hash |
DatabaseFullPrunedBlockStore.verifiedChainHeadHash |
Modifier and Type | Field and Description |
---|---|
protected LinkedHashMap<Sha256Hash,StoredBlock> |
SPVBlockStore.blockCache |
protected LinkedHashMap<Sha256Hash,Object> |
SPVBlockStore.notFoundCache |
Modifier and Type | Method and Description |
---|---|
StoredBlock |
SPVBlockStore.get(Sha256Hash hash) |
StoredBlock |
MemoryFullPrunedBlockStore.get(Sha256Hash hash) |
StoredBlock |
LevelDBFullPrunedBlockStore.get(Sha256Hash hash) |
StoredBlock |
LevelDBBlockStore.get(Sha256Hash hash) |
StoredBlock |
BlockStore.get(Sha256Hash hash)
Returns the StoredBlock given a hash.
|
StoredBlock |
DatabaseFullPrunedBlockStore.get(Sha256Hash hash) |
StoredBlock |
MemoryBlockStore.get(Sha256Hash hash) |
StoredBlock |
LevelDBFullPrunedBlockStore.get(Sha256Hash hash,
boolean wasUndoableOnly) |
StoredBlock |
DatabaseFullPrunedBlockStore.get(Sha256Hash hash,
boolean wasUndoableOnly) |
StoredBlock |
MemoryFullPrunedBlockStore.getOnceUndoableStoredBlock(Sha256Hash hash) |
StoredBlock |
LevelDBFullPrunedBlockStore.getOnceUndoableStoredBlock(Sha256Hash hash) |
StoredBlock |
DatabaseFullPrunedBlockStore.getOnceUndoableStoredBlock(Sha256Hash hash) |
StoredBlock |
FullPrunedBlockStore.getOnceUndoableStoredBlock(Sha256Hash hash)
Returns the StoredBlock that was added as a StoredUndoableBlock given a hash.
|
UTXO |
MemoryFullPrunedBlockStore.getTransactionOutput(Sha256Hash hash,
long index) |
UTXO |
LevelDBFullPrunedBlockStore.getTransactionOutput(Sha256Hash hash,
long index) |
UTXO |
DatabaseFullPrunedBlockStore.getTransactionOutput(Sha256Hash hash,
long index) |
UTXO |
FullPrunedBlockStore.getTransactionOutput(Sha256Hash hash,
long index)
Gets a
UTXO with the given hash and index, or null if none is found |
StoredUndoableBlock |
MemoryFullPrunedBlockStore.getUndoBlock(Sha256Hash hash) |
StoredUndoableBlock |
LevelDBFullPrunedBlockStore.getUndoBlock(Sha256Hash hash) |
StoredUndoableBlock |
DatabaseFullPrunedBlockStore.getUndoBlock(Sha256Hash hash) |
StoredUndoableBlock |
FullPrunedBlockStore.getUndoBlock(Sha256Hash hash)
Returns a
StoredUndoableBlock whose block.getHash() method will be equal to the parameter. |
boolean |
MemoryFullPrunedBlockStore.hasUnspentOutputs(Sha256Hash hash,
int numOutputs) |
boolean |
LevelDBFullPrunedBlockStore.hasUnspentOutputs(Sha256Hash hash,
int numOutputs) |
boolean |
DatabaseFullPrunedBlockStore.hasUnspentOutputs(Sha256Hash hash,
int numOutputs) |
boolean |
FullPrunedBlockStore.hasUnspentOutputs(Sha256Hash hash,
int numOutputs)
True if this store has any unspent outputs from a transaction with a hash equal to the first parameter
|
Modifier and Type | Field and Description |
---|---|
protected Map<Sha256Hash,Transaction> |
Wallet.transactions |
Modifier and Type | Method and Description |
---|---|
static Sha256Hash |
WalletProtobufSerializer.byteStringToHash(com.google.protobuf.ByteString bs) |
Sha256Hash |
Wallet.getLastBlockSeenHash()
Returns the hash of the last seen best-chain block, or null if the wallet is too old to store this data.
|
Modifier and Type | Method and Description |
---|---|
Map<Sha256Hash,Transaction> |
Wallet.getTransactionPool(WalletTransaction.Pool pool)
Returns transactions from a specific pool.
|
Modifier and Type | Method and Description |
---|---|
Transaction |
Wallet.getTransaction(Sha256Hash hash)
Returns a transaction object given its hash, if it exists in this wallet, or null otherwise.
|
static com.google.protobuf.ByteString |
WalletProtobufSerializer.hashToByteString(Sha256Hash hash) |
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) . |
boolean |
Wallet.poolContainsTxHash(WalletTransaction.Pool pool,
Sha256Hash txHash) |
void |
Wallet.setLastBlockSeenHash(Sha256Hash lastBlockSeenHash) |
Copyright © 2016. All rights reserved.