Package | Description |
---|---|
org.bitcoinj.core |
The core package contains classes for network messages like
Block and
Transaction , peer connectivity via PeerGroup ,
block chain management and the Wallet class. |
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.testing |
Various utilities for writing unit tests: also useful for testing your own code and apps that build on top of
bitcoinj.
|
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 |
protected Map<Sha256Hash,Transaction> |
Wallet.transactions |
Modifier and Type | Method and Description |
---|---|
static Sha256Hash |
Sha256Hash.create(byte[] contents)
Calculates the (one-time) hash of contents and returns it as a new wrapped hash.
|
static Sha256Hash |
Sha256Hash.createDouble(byte[] contents)
Calculates the hash of the hash of the contents.
|
Sha256Hash |
Sha256Hash.duplicate() |
Sha256Hash |
CheckpointManager.getDataHash()
Returns a hash of the concatenated checkpoint data.
|
Sha256Hash |
TransactionOutPoint.getHash()
Returns the hash of the transaction this outpoint references/spends/is connected to.
|
Sha256Hash |
Transaction.getHash()
Returns the transaction hash as you see them in the block explorer.
|
Sha256Hash |
StoredUndoableBlock.getHash()
Get the hash of the represented block
|
Sha256Hash |
StoredTransactionOutput.getHash()
The hash of the transaction which holds this output
|
Sha256Hash |
PrunedException.getHash() |
Sha256Hash |
Message.getHash()
This method is a NOP for all classes except Block and Transaction.
|
Sha256Hash |
FilteredBlock.getHash()
Gets the hash of the block represented in this Filtered Block
|
Sha256Hash |
Block.getHash()
Returns the hash of the block (which for a valid, solved block should be
below the target).
|
Sha256Hash |
GetDataMessage.getHashOf(int i) |
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.
|
Sha256Hash |
Block.getMerkleRoot()
Returns the merkle root in big endian form, calculating it from transactions if necessary.
|
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 |
PartialMerkleTree.getTxnHashAndMerkleRoot(List<Sha256Hash> matchedHashes)
Extracts tx hashes that are in this merkle tree
and returns the merkle root of this tree.
|
static Sha256Hash |
Sha256Hash.hashFileContents(File f)
Returns a hash of the given files contents.
|
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.
|
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> |
Wallet.getTransactionPool(WalletTransaction.Pool pool)
Returns transactions from a specific pool.
|
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)
Adds an input directly, with no checking that it's valid.
|
void |
GetDataMessage.addTransaction(Sha256Hash hash) |
int |
Sha256Hash.compareTo(Sha256Hash o) |
protected ECKey.ECDSASignature |
ECKey.doSign(Sha256Hash input,
BigInteger privateKeyForSigning) |
Transaction |
MemoryPool.get(Sha256Hash hash)
Returns the
Transaction for the given hash if we have downloaded it, or null if that hash is unknown or
we only saw advertisements for it yet or it has been downloaded but garbage collected due to nowhere else
holding a reference to it. |
ListenableFuture<Block> |
Peer.getBlock(Sha256Hash blockHash)
Asks the connected peer for the block of the given hash, and returns a future representing the answer.
|
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 |
FullPrunedBlockChain.getStoredBlockInCurrentScope(Sha256Hash hash) |
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)
|
Transaction |
Wallet.getTransaction(Sha256Hash hash)
Returns a transaction object given its hash, if it exists in this wallet, or null otherwise.
|
boolean |
AbstractBlockChain.isOrphan(Sha256Hash block)
Returns true if the given block is currently in the orphan blocks list.
|
boolean |
MemoryPool.maybeWasSeen(Sha256Hash hash)
Returns true if the TX identified by hash has been seen before (ie, in an inv).
|
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 |
BlockChainListener.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) |
int |
MemoryPool.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.
|
void |
MemoryPool.seen(Sha256Hash hash,
PeerAddress byPeer)
Called by peers when they see a transaction advertised in an "inv" message.
|
void |
Wallet.setLastBlockSeenHash(Sha256Hash lastBlockSeenHash) |
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.
|
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> matchedHashes)
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) |
StoredTransactionOutput(Sha256Hash hash,
long index,
Coin value,
int height,
boolean isCoinbase,
byte[] scriptBytes)
Creates a stored transaction output
|
StoredTransactionOutput(Sha256Hash hash,
TransactionOutput out,
int height,
boolean isCoinbase) |
StoredUndoableBlock(Sha256Hash hash,
List<Transaction> transactions) |
StoredUndoableBlock(Sha256Hash hash,
TransactionOutputChanges txOutChanges) |
TransactionOutPoint(NetworkParameters params,
long index,
Sha256Hash hash) |
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 |
---|---|
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 |
---|---|
abstract void |
ServerConnectionEventHandler.channelOpen(Sha256Hash channelId)
Triggered when the channel is opened and application messages/payments can begin
|
void |
PaymentChannelServer.ServerConnection.channelOpen(Sha256Hash contractHash)
Triggered when the channel is opened and 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). |
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,
long timeWindow,
IPaymentChannelClient.ClientConnection conn)
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 LinkedHashMap<Sha256Hash,StoredBlock> |
SPVBlockStore.blockCache |
protected LinkedHashMap<Sha256Hash,Object> |
SPVBlockStore.notFoundCache |
Modifier and Type | Method and Description |
---|---|
static Sha256Hash |
WalletProtobufSerializer.byteStringToHash(com.google.protobuf.ByteString bs) |
Modifier and Type | Method and Description |
---|---|
StoredBlock |
SPVBlockStore.get(Sha256Hash hash) |
StoredBlock |
PostgresFullPrunedBlockStore.get(Sha256Hash hash) |
StoredBlock |
MemoryFullPrunedBlockStore.get(Sha256Hash hash) |
StoredBlock |
MemoryBlockStore.get(Sha256Hash hash) |
StoredBlock |
H2FullPrunedBlockStore.get(Sha256Hash hash) |
StoredBlock |
BlockStore.get(Sha256Hash hash)
Returns the StoredBlock given a hash.
|
StoredBlock |
PostgresFullPrunedBlockStore.get(Sha256Hash hash,
boolean wasUndoableOnly) |
StoredBlock |
H2FullPrunedBlockStore.get(Sha256Hash hash,
boolean wasUndoableOnly) |
StoredBlock |
PostgresFullPrunedBlockStore.getOnceUndoableStoredBlock(Sha256Hash hash) |
StoredBlock |
MemoryFullPrunedBlockStore.getOnceUndoableStoredBlock(Sha256Hash hash) |
StoredBlock |
H2FullPrunedBlockStore.getOnceUndoableStoredBlock(Sha256Hash hash) |
StoredBlock |
FullPrunedBlockStore.getOnceUndoableStoredBlock(Sha256Hash hash)
Returns the StoredBlock that was added as a StoredUndoableBlock given a hash.
|
StoredTransactionOutput |
PostgresFullPrunedBlockStore.getTransactionOutput(Sha256Hash hash,
long index) |
StoredTransactionOutput |
MemoryFullPrunedBlockStore.getTransactionOutput(Sha256Hash hash,
long index) |
StoredTransactionOutput |
H2FullPrunedBlockStore.getTransactionOutput(Sha256Hash hash,
long index) |
StoredTransactionOutput |
FullPrunedBlockStore.getTransactionOutput(Sha256Hash hash,
long index)
Gets a
StoredTransactionOutput with the given hash and index, or null if none is found |
StoredUndoableBlock |
PostgresFullPrunedBlockStore.getUndoBlock(Sha256Hash hash) |
StoredUndoableBlock |
MemoryFullPrunedBlockStore.getUndoBlock(Sha256Hash hash) |
StoredUndoableBlock |
H2FullPrunedBlockStore.getUndoBlock(Sha256Hash hash) |
StoredUndoableBlock |
FullPrunedBlockStore.getUndoBlock(Sha256Hash hash)
Returns a
StoredUndoableBlock whose block.getHash() method will be equal to the parameter. |
static com.google.protobuf.ByteString |
WalletProtobufSerializer.hashToByteString(Sha256Hash hash) |
boolean |
PostgresFullPrunedBlockStore.hasUnspentOutputs(Sha256Hash hash,
int numOutputs) |
boolean |
MemoryFullPrunedBlockStore.hasUnspentOutputs(Sha256Hash hash,
int numOutputs) |
boolean |
H2FullPrunedBlockStore.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 | Method and Description |
---|---|
protected CustomTransactionSigner.SignatureAndKey |
KeyChainTransactionSigner.getSignature(Sha256Hash sighash,
List<ChildNumber> derivationPath) |
Copyright © 2014. All rights reserved.