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.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.net.discovery |
Classes that know how to discover peers in the P2P network using DNS, IRC or DNS via Tor (orchid).
|
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.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. |
org.bitcoinj.wallet.listeners |
Modifier and Type | Field and Description |
---|---|
static Comparator<ECKey> |
ECKey.AGE_COMPARATOR
Sorts oldest keys first, newest last.
|
static Comparator<ECKey> |
ECKey.PUBKEY_COMPARATOR
Compares pub key bytes using
UnsignedBytes.lexicographicalComparator() |
Modifier and Type | Method and Description |
---|---|
ECKey |
ECKey.decompress()
Returns a copy of this key, but with the public point represented in uncompressed form.
|
ECKey |
ECKey.decrypt(KeyCrypter keyCrypter,
org.spongycastle.crypto.params.KeyParameter aesKey)
Create a decrypted private key with the keyCrypter and AES key supplied.
|
ECKey |
ECKey.decrypt(org.spongycastle.crypto.params.KeyParameter aesKey)
Create a decrypted private key with AES key.
|
ECKey |
ECKey.encrypt(KeyCrypter keyCrypter,
org.spongycastle.crypto.params.KeyParameter aesKey)
Create an encrypted private key with the keyCrypter and the AES key supplied.
|
static ECKey |
ECKey.fromASN1(byte[] asn1privkey)
Construct an ECKey from an ASN.1 encoded private key.
|
static ECKey |
ECKey.fromEncrypted(EncryptedData encryptedPrivateKey,
KeyCrypter crypter,
byte[] pubKey)
Constructs a key that has an encrypted private component.
|
static ECKey |
ECKey.fromPrivate(BigInteger privKey)
Creates an ECKey given the private key only.
|
static ECKey |
ECKey.fromPrivate(BigInteger privKey,
boolean compressed)
Creates an ECKey given the private key only.
|
static ECKey |
ECKey.fromPrivate(byte[] privKeyBytes)
Creates an ECKey given the private key only.
|
static ECKey |
ECKey.fromPrivate(byte[] privKeyBytes,
boolean compressed)
Creates an ECKey given the private key only.
|
static ECKey |
ECKey.fromPrivateAndPrecalculatedPublic(BigInteger priv,
org.spongycastle.math.ec.ECPoint pub)
Creates an ECKey that simply trusts the caller to ensure that point is really the result of multiplying the
generator point by the private key.
|
static ECKey |
ECKey.fromPrivateAndPrecalculatedPublic(byte[] priv,
byte[] pub)
Creates an ECKey that simply trusts the caller to ensure that point is really the result of multiplying the
generator point by the private key.
|
static ECKey |
ECKey.fromPublicOnly(byte[] pub)
Creates an ECKey that cannot be used for signing, only verifying signatures, from the given encoded point.
|
static ECKey |
ECKey.fromPublicOnly(org.spongycastle.math.ec.ECPoint pub)
Creates an ECKey that cannot be used for signing, only verifying signatures, from the given point.
|
ECKey |
TransactionOutPoint.getConnectedKey(KeyBag keyBag)
Returns the ECKey identified in the connected output, for either pay-to-address scripts or pay-to-key scripts.
|
ECKey |
DumpedPrivateKey.getKey()
Returns an ECKey created from this encoded private key.
|
ECKey |
ECKey.maybeDecrypt(org.spongycastle.crypto.params.KeyParameter aesKey)
Creates decrypted private key if needed.
|
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.
|
static ECKey |
ECKey.signedMessageToKey(String message,
String signatureBase64)
Given an arbitrary piece of text and a Bitcoin-format message signature encoded in base64, returns an ECKey
containing the public key that was used to sign it.
|
Modifier and Type | Method and Description |
---|---|
TransactionOutput |
Transaction.addOutput(Coin value,
ECKey pubkey)
Creates an output that pays to the given pubkey directly (no address) with the given value, adds it to this
transaction, and returns the new output.
|
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.
|
TransactionInput |
Transaction.addSignedInput(TransactionOutput output,
ECKey signingKey)
Adds an input that points to the given output and contains a valid signature for it, calculated using the
signing key.
|
TransactionInput |
Transaction.addSignedInput(TransactionOutput output,
ECKey signingKey,
Transaction.SigHash sigHash,
boolean anyoneCanPay)
Adds an input that points to the given output and contains a valid signature for it, calculated using the
signing key.
|
TransactionSignature |
Transaction.calculateSignature(int inputIndex,
ECKey key,
byte[] redeemScript,
Transaction.SigHash hashType,
boolean anyoneCanPay)
Calculates a signature that is valid for being inserted into the input at the given position.
|
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 boolean |
ECKey.encryptionIsReversible(ECKey originalKey,
ECKey encryptedKey,
KeyCrypter keyCrypter,
org.spongycastle.crypto.params.KeyParameter aesKey)
Check that it is possible to decrypt the key with the keyCrypter and that the original key is returned.
|
void |
BloomFilter.insert(ECKey key)
Inserts the given key and equivalent hashed form (for the address).
|
Constructor and Description |
---|
TransactionOutput(NetworkParameters params,
Transaction parent,
Coin value,
ECKey to)
Creates an output that sends 'value' to the given public key using a simple CHECKSIG script (no addresses).
|
Modifier and Type | Class and Description |
---|---|
class |
DeterministicKey
A deterministic key is a node in a
DeterministicHierarchy . |
Modifier and Type | Field and Description |
---|---|
static Comparator<ECKey> |
DeterministicKey.CHILDNUM_ORDER
Sorts deterministic keys in the order of their child number.
|
Modifier and Type | Method and Description |
---|---|
ECKey |
BIP38PrivateKey.decrypt(String passphrase) |
Modifier and Type | Method and Description |
---|---|
void |
NativeWalletEventListener.onKeysAdded(List<ECKey> keys) |
void |
NativeKeyChainEventListener.onKeysAdded(List<ECKey> keys) |
Modifier and Type | Field and Description |
---|---|
ECKey |
HttpDiscovery.Details.pubkey |
Constructor and Description |
---|
Details(ECKey pubkey,
URI uri) |
HttpDiscovery(NetworkParameters params,
URI uri,
ECKey pubkey)
Constructs a discovery object that will read data from the given HTTP[S] URI and, if a public key is provided,
will check the signature using that key.
|
Modifier and Type | Field and Description |
---|---|
protected ECKey |
PaymentChannelV2ServerState.clientKey |
protected ECKey |
PaymentChannelV1ServerState.clientKey |
protected ECKey |
PaymentChannelServerState.serverKey |
Modifier and Type | Method and Description |
---|---|
protected ECKey |
PaymentChannelV2ServerState.getClientKey() |
protected abstract ECKey |
PaymentChannelServerState.getClientKey() |
protected ECKey |
PaymentChannelV1ServerState.getClientKey() |
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. |
PaymentChannelClientConnection(InetSocketAddress server,
int timeoutSeconds,
Wallet wallet,
ECKey myKey,
Coin maxValue,
String serverId)
Attempts to open a new connection to and open a payment channel with the given host and port, blocking until the
connection is open.
|
PaymentChannelClientConnection(InetSocketAddress server,
int timeoutSeconds,
Wallet wallet,
ECKey myKey,
Coin maxValue,
String serverId,
long timeWindow,
org.spongycastle.crypto.params.KeyParameter userKeySetup)
Attempts to open a new connection to and open a payment channel with the given host and port, blocking until the
connection is open.
|
PaymentChannelClientConnection(InetSocketAddress server,
int timeoutSeconds,
Wallet wallet,
ECKey myKey,
Coin maxValue,
String serverId,
long timeWindow,
org.spongycastle.crypto.params.KeyParameter userKeySetup,
PaymentChannelClient.VersionSelector versionSelector)
Attempts to open a new connection to and open a payment channel with the given host and port, blocking until the
connection is open.
|
PaymentChannelClientConnection(InetSocketAddress server,
int timeoutSeconds,
Wallet wallet,
ECKey myKey,
Coin maxValue,
String serverId,
PaymentChannelClient.VersionSelector versionSelector)
Attempts to open a new connection to and open a payment channel with the given host and port, blocking until the
connection is open.
|
PaymentChannelClientState(Wallet wallet,
ECKey myKey,
ECKey serverKey,
Coin value,
long expiryTimeInSeconds)
Creates a state object for a payment channel client.
|
PaymentChannelServerState(TransactionBroadcaster broadcaster,
Wallet wallet,
ECKey serverKey,
long minExpireTime)
Creates a new state object to track the server side of a payment channel.
|
PaymentChannelV1ClientState(Wallet wallet,
ECKey myKey,
ECKey serverMultisigKey,
Coin value,
long expiryTimeInSeconds)
Creates a state object for a payment channel client.
|
PaymentChannelV1ServerState(TransactionBroadcaster broadcaster,
Wallet wallet,
ECKey serverKey,
long minExpireTime)
Creates a new state object to track the server side of a payment channel.
|
PaymentChannelV2ClientState(Wallet wallet,
ECKey myKey,
ECKey serverMultisigKey,
Coin value,
long expiryTimeInSeconds) |
PaymentChannelV2ServerState(TransactionBroadcaster broadcaster,
Wallet wallet,
ECKey serverKey,
long minExpireTime) |
Modifier and Type | Method and Description |
---|---|
List<ECKey> |
Script.getPubKeys()
Returns a list of the keys required by this script, assuming a multi-sig script.
|
Modifier and Type | Method and Description |
---|---|
static Script |
ScriptBuilder.createCLTVPaymentChannelOutput(BigInteger time,
ECKey from,
ECKey to) |
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,
ECKey pubKey)
Creates a scriptSig that can redeem a pay-to-address output.
|
static Script |
ScriptBuilder.createOutputScript(ECKey key)
Creates a scriptPubKey that encodes payment to the given raw public key.
|
int |
Script.getNumberOfBytesRequiredToSpend(ECKey pubKey,
Script redeemScript)
Returns number of bytes required to spend this script.
|
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 |
---|---|
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 byte[] |
Script.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.createP2SHOutputScript(int threshold,
List<ECKey> pubkeys)
Creates a P2SH output script with given public keys and threshold.
|
static Script |
ScriptBuilder.createRedeemScript(int threshold,
List<ECKey> pubkeys)
Creates redeem script with given public keys and threshold.
|
Modifier and Type | Field and Description |
---|---|
ECKey |
CustomTransactionSigner.SignatureAndKey.pubKey |
Constructor and Description |
---|
SignatureAndKey(ECKey.ECDSASignature sig,
ECKey pubKey) |
Modifier and Type | Field and Description |
---|---|
List<ECKey> |
RedeemData.keys |
Modifier and Type | Method and Description |
---|---|
ECKey |
KeyBag.findKeyFromPubHash(byte[] pubkeyHash)
Locates a keypair from the keychain given the hash of the public key.
|
ECKey |
DecryptingKeyBag.findKeyFromPubHash(byte[] pubkeyHash) |
ECKey |
BasicKeyChain.findKeyFromPubHash(byte[] pubkeyHash) |
ECKey |
KeyChainGroup.findKeyFromPubHash(byte[] pubkeyHash) |
ECKey |
Wallet.findKeyFromPubHash(byte[] pubkeyHash)
Locates a keypair from the basicKeyChain given the hash of the public key.
|
ECKey |
KeyBag.findKeyFromPubKey(byte[] pubkey)
Locates a keypair from the keychain given the raw public key bytes.
|
ECKey |
DecryptingKeyBag.findKeyFromPubKey(byte[] pubkey) |
ECKey |
BasicKeyChain.findKeyFromPubKey(byte[] pubkey) |
ECKey |
KeyChainGroup.findKeyFromPubKey(byte[] pubkey) |
ECKey |
Wallet.findKeyFromPubKey(byte[] pubkey)
Locates a keypair from the basicKeyChain given the raw public key bytes.
|
ECKey |
BasicKeyChain.findOldestKeyAfter(long timeSecs)
Returns the first ECKey created after the given UNIX time, or null if there is none.
|
ECKey |
RedeemData.getFullKey()
Returns the first key that has private bytes
|
ECKey |
BasicKeyChain.getKey(KeyChain.KeyPurpose ignored) |
ECKey |
KeyChain.getKey(KeyChain.KeyPurpose purpose)
Obtains a key intended for the given purpose.
|
Modifier and Type | Method and Description |
---|---|
List<ECKey> |
BasicKeyChain.findKeysBefore(long timeSecs)
Returns a list of all ECKeys created after the given UNIX time.
|
List<ECKey> |
KeyChainGroup.getImportedKeys()
Returns a list of the non-deterministic keys that have been imported into the wallet, or the empty list if none.
|
List<ECKey> |
Wallet.getImportedKeys()
Returns a list of the non-deterministic keys that have been imported into the wallet, or the empty list if none.
|
List<ECKey> |
Wallet.getIssuedReceiveKeys()
Returns only the keys that have been issued by
Wallet.freshReceiveKey() , Wallet.freshReceiveAddress() ,
Wallet.currentReceiveKey() or Wallet.currentReceiveAddress() . |
List<ECKey> |
DeterministicKeyChain.getIssuedReceiveKeys()
Returns only the external keys that have been issued by this chain, lookahead not included.
|
List<ECKey> |
BasicKeyChain.getKeys()
Returns a copy of the list of keys that this chain is managing.
|
List<ECKey> |
BasicKeyChain.getKeys(KeyChain.KeyPurpose purpose,
int numberOfKeys) |
List<? extends ECKey> |
KeyChain.getKeys(KeyChain.KeyPurpose purpose,
int numberOfKeys)
Obtains a number of key/s intended for the given purpose.
|
Modifier and Type | Method and Description |
---|---|
boolean |
Wallet.addKey(ECKey key)
Deprecated.
|
boolean |
BasicKeyChain.hasKey(ECKey key) |
boolean |
KeyChainGroup.hasKey(ECKey key) |
boolean |
Wallet.hasKey(ECKey key)
Returns true if the given key is in the wallet, false otherwise.
|
boolean |
DeterministicKeyChain.hasKey(ECKey key) |
boolean |
KeyChain.hasKey(ECKey key)
Returns true if the given key is in the chain.
|
void |
BasicKeyChain.importKey(ECKey key)
Imports a key to the key chain.
|
boolean |
Wallet.importKey(ECKey key)
Imports the given ECKey to the wallet.
|
int |
BasicKeyChain.importKeys(ECKey... keys) |
int |
KeyChainGroup.importKeys(ECKey... keys)
Imports the given keys into the basic chain, creating it if necessary.
|
boolean |
Wallet.isKeyRotating(ECKey key)
Returns whether the keys creation time is before the key rotation time, if one was set.
|
static RedeemData |
RedeemData.of(ECKey key,
Script program)
Creates RedeemData for pay-to-address or pay-to-pubkey input.
|
boolean |
KeyChainGroup.removeImportedKey(ECKey key)
Removes a key that was imported into the basic key chain.
|
boolean |
BasicKeyChain.removeKey(ECKey key)
Removes the given key from the keychain.
|
boolean |
Wallet.removeKey(ECKey key)
Removes the given key from the basicKeyChain.
|
static SendRequest |
SendRequest.to(NetworkParameters params,
ECKey destination,
Coin value)
Creates a new SendRequest to the given pubkey for the given value.
|
static SendRequest |
SendRequest.toCLTVPaymentChannel(NetworkParameters params,
BigInteger time,
ECKey from,
ECKey to,
Coin value) |
static SendRequest |
SendRequest.toCLTVPaymentChannel(NetworkParameters params,
Date releaseTime,
ECKey from,
ECKey to,
Coin value) |
static SendRequest |
SendRequest.toCLTVPaymentChannel(NetworkParameters params,
int releaseBlock,
ECKey from,
ECKey to,
Coin value) |
Modifier and Type | Method and Description |
---|---|
int |
Wallet.addKeys(List<ECKey> keys)
Deprecated.
|
static Wallet |
Wallet.fromKeys(NetworkParameters params,
List<ECKey> keys)
Creates a wallet containing a given set of keys.
|
int |
BasicKeyChain.importKeys(List<? extends ECKey> keys) |
int |
KeyChainGroup.importKeys(List<ECKey> keys)
Imports the given keys into the basic chain, creating it if necessary.
|
int |
Wallet.importKeys(List<ECKey> keys)
Imports the given keys to the wallet.
|
int |
Wallet.importKeysAndEncrypt(List<ECKey> keys,
CharSequence password)
Takes a list of keys and a password, then encrypts and imports them in one step using the current keycrypter.
|
int |
KeyChainGroup.importKeysAndEncrypt(List<ECKey> keys,
org.spongycastle.crypto.params.KeyParameter aesKey)
Imports the given unencrypted keys into the basic chain, encrypting them along the way with the given key.
|
int |
Wallet.importKeysAndEncrypt(List<ECKey> keys,
org.spongycastle.crypto.params.KeyParameter aesKey)
Takes a list of keys and an AES key, then encrypts and imports them in one step using the current keycrypter.
|
static RedeemData |
RedeemData.of(List<ECKey> keys,
Script redeemScript) |
Modifier and Type | Method and Description |
---|---|
void |
KeyChainEventListener.onKeysAdded(List<ECKey> keys)
Called whenever a new key is added to the key chain, whether that be via an explicit addition or due to some
other automatic derivation.
|
void |
AbstractWalletEventListener.onKeysAdded(List<ECKey> keys)
Deprecated.
|
void |
AbstractKeyChainEventListener.onKeysAdded(List<ECKey> keys) |
Copyright © 2016. All rights reserved.