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.jni | |
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.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 | Method and Description |
---|---|
Script |
TransactionOutput.getScriptPubKey() |
Script |
TransactionInput.getScriptSig()
Returns the script that is fed to the referenced output (scriptPubKey) script in order to satisfy it: usually
contains signatures and maybe keys, but can contain arbitrary data if the output script accepts it.
|
Modifier and Type | Method and Description |
---|---|
List<Script> |
Wallet.getWatchedScripts()
Returns a snapshot of the watched scripts.
|
Modifier and Type | Method and Description |
---|---|
TransactionInput |
Transaction.addInput(Sha256Hash spendTxHash,
long outputIndex,
Script script)
Adds an input directly, with no checking that it's valid.
|
TransactionOutput |
Transaction.addOutput(Coin value,
Script script)
Creates an output that pays to the given script.
|
TransactionInput |
Transaction.addSignedInput(TransactionOutPoint prevOut,
Script scriptPubKey,
ECKey sigKey)
Same as
Transaction.addSignedInput(TransactionOutPoint, org.bitcoinj.script.Script, ECKey, org.bitcoinj.core.Transaction.SigHash, boolean)
but defaults to Transaction.SigHash.ALL and "false" for the anyoneCanPay flag. |
TransactionInput |
Transaction.addSignedInput(TransactionOutPoint prevOut,
Script scriptPubKey,
ECKey sigKey,
Transaction.SigHash sigHash,
boolean anyoneCanPay)
Adds a new and fully signed input for the given parameters.
|
TransactionSignature |
Transaction.calculateSignature(int inputIndex,
ECKey key,
Script redeemScript,
Transaction.SigHash hashType,
boolean anyoneCanPay)
Calculates a signature that is valid for being inserted into the input at the given position.
|
static Address |
Address.fromP2SHScript(NetworkParameters params,
Script scriptPubKey)
Returns an Address that represents the script hash extracted from the given scriptPubKey
|
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.
|
boolean |
Wallet.isWatchedScript(Script script)
Returns true if this wallet is watching transactions for outputs with the script.
|
boolean |
TransactionBag.isWatchedScript(Script script)
Returns true if this wallet is watching transactions for outputs with the script.
|
void |
TransactionInput.setScriptSig(Script scriptSig)
Set the given program as the scriptSig that is supposed to satisfy the connected output script.
|
Modifier and Type | Method and Description |
---|---|
int |
Wallet.addWatchedScripts(List<Script> scripts)
Adds the given output scripts to the wallet to be watched.
|
void |
WalletEventListener.onScriptsAdded(Wallet wallet,
List<Script> scripts)
Called whenever a new watched script is added to the wallet.
|
void |
AbstractWalletEventListener.onScriptsAdded(Wallet wallet,
List<Script> scripts) |
protected void |
Wallet.queueOnScriptsAdded(List<Script> scripts) |
Modifier and Type | Method and Description |
---|---|
void |
NativeWalletEventListener.onScriptsAdded(Wallet wallet,
List<Script> scripts) |
Modifier and Type | Method and Description |
---|---|
Script |
ScriptBuilder.build()
Creates a new immutable Script based on the state of the builder.
|
Script |
Script.createEmptyInputScript(ECKey key,
Script redeemScript)
Creates an incomplete scriptSig that, once filled with signatures, can redeem output containing this scriptPubKey.
|
static Script |
ScriptBuilder.createInputScript(TransactionSignature signature)
Creates a scriptSig that can redeem a pay-to-pubkey output.
|
static Script |
ScriptBuilder.createInputScript(TransactionSignature signature,
ECKey pubKey)
Creates a scriptSig that can redeem a pay-to-address output.
|
static Script |
ScriptBuilder.createMultiSigInputScript(List<TransactionSignature> signatures)
Create a program that satisfies an OP_CHECKMULTISIG program.
|
static Script |
ScriptBuilder.createMultiSigInputScript(TransactionSignature... signatures)
Create a program that satisfies an OP_CHECKMULTISIG program.
|
static Script |
ScriptBuilder.createMultiSigInputScriptBytes(List<byte[]> signatures)
Create a program that satisfies an OP_CHECKMULTISIG program, using pre-encoded signatures.
|
static Script |
ScriptBuilder.createMultiSigInputScriptBytes(List<byte[]> signatures,
byte[] multisigProgramBytes)
Create a program that satisfies an OP_CHECKMULTISIG program, using pre-encoded signatures.
|
static Script |
ScriptBuilder.createMultiSigOutputScript(int threshold,
List<ECKey> pubkeys)
Creates a program that requires at least N of the given keys to sign, using OP_CHECKMULTISIG.
|
static Script |
ScriptBuilder.createOutputScript(Address to)
Creates a scriptPubKey that encodes payment to the given address.
|
static Script |
ScriptBuilder.createOutputScript(ECKey key)
Creates a scriptPubKey that encodes payment to the given raw public key.
|
static Script |
ScriptBuilder.createP2SHMultiSigInputScript(List<TransactionSignature> signatures,
Script multisigProgram)
Create a program that satisfies a pay-to-script hashed OP_CHECKMULTISIG program.
|
static Script |
ScriptBuilder.createP2SHOutputScript(byte[] hash)
Creates a scriptPubKey that sends to the given script hash.
|
static Script |
ScriptBuilder.createP2SHOutputScript(int threshold,
List<ECKey> pubkeys)
Creates a P2SH output script with given public keys and threshold.
|
static Script |
ScriptBuilder.createP2SHOutputScript(Script redeemScript)
Creates a scriptPubKey for the given redeem script.
|
static Script |
ScriptBuilder.createRedeemScript(int threshold,
List<ECKey> pubkeys)
Creates redeem script with given public keys and threshold.
|
Script |
Script.getScriptSigWithSignature(Script scriptSig,
byte[] sigBytes,
int index)
Returns a copy of the given scriptSig with the signature inserted in the given position.
|
static Script |
ScriptBuilder.updateScriptWithSignature(Script scriptSig,
byte[] signature,
int targetIndex,
int sigsPrefixCount,
int sigsSuffixCount)
Returns a copy of the given scriptSig with the signature inserted in the given position.
|
Modifier and Type | Method and Description |
---|---|
void |
Script.correctlySpends(Transaction txContainingThis,
long scriptSigIndex,
Script scriptPubKey)
Verifies that this script (interpreted as a scriptSig) correctly spends the given scriptPubKey, enabling all
validation rules.
|
void |
Script.correctlySpends(Transaction txContainingThis,
long scriptSigIndex,
Script scriptPubKey,
Set<Script.VerifyFlag> verifyFlags)
Verifies that this script (interpreted as a scriptSig) correctly spends the given scriptPubKey.
|
Script |
Script.createEmptyInputScript(ECKey key,
Script redeemScript)
Creates an incomplete scriptSig that, once filled with signatures, can redeem output containing this scriptPubKey.
|
static Script |
ScriptBuilder.createP2SHMultiSigInputScript(List<TransactionSignature> signatures,
Script multisigProgram)
Create a program that satisfies a pay-to-script hashed OP_CHECKMULTISIG program.
|
static Script |
ScriptBuilder.createP2SHOutputScript(Script redeemScript)
Creates a scriptPubKey for the given redeem script.
|
static void |
Script.executeScript(Transaction txContainingThis,
long index,
Script script,
LinkedList<byte[]> stack,
boolean enforceNullDummy)
Exposes the script interpreter.
|
int |
Script.getNumberOfBytesRequiredToSpend(ECKey pubKey,
Script redeemScript)
Returns number of bytes required to spend this script.
|
Script |
Script.getScriptSigWithSignature(Script scriptSig,
byte[] sigBytes,
int index)
Returns a copy of the given scriptSig with the signature inserted in the given position.
|
static Script |
ScriptBuilder.updateScriptWithSignature(Script scriptSig,
byte[] signature,
int targetIndex,
int sigsPrefixCount,
int sigsSuffixCount)
Returns a copy of the given scriptSig with the signature inserted in the given position.
|
Constructor and Description |
---|
ScriptBuilder(Script template)
Creates a fresh ScriptBuilder with the given program as the starting point.
|
Modifier and Type | Field and Description |
---|---|
Map<Script,List<ChildNumber>> |
TransactionSigner.ProposedTransaction.keyPaths
HD key paths used for each input to derive a signing key.
|
Modifier and Type | Field and Description |
---|---|
Script |
RedeemData.redeemScript |
Modifier and Type | Method and Description |
---|---|
static RedeemData |
RedeemData.of(ECKey key,
Script program)
Creates RedeemData for pay-to-address or pay-to-pubkey input.
|
static RedeemData |
RedeemData.of(List<ECKey> keys,
Script redeemScript) |
Copyright © 2014. All rights reserved.