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.testing |
Various utilities for writing unit tests: also useful for testing your own code and apps that build on top of
bitcoinj.
|
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 |
---|---|
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.
|
ECKey |
Wallet.findKeyFromPubHash(byte[] pubkeyHash)
Locates a keypair from the basicKeyChain given the hash of the public key.
|
ECKey |
Wallet.findKeyFromPubKey(byte[] pubkey)
Locates a keypair from the basicKeyChain given the raw public key bytes.
|
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 |
---|---|
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.
|
Modifier and Type | Method and Description |
---|---|
boolean |
Wallet.addKey(ECKey key)
Deprecated.
|
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.
|
boolean |
Wallet.hasKey(ECKey key)
Returns true if the given key is in the wallet, false otherwise.
|
boolean |
Wallet.importKey(ECKey key)
Imports the given ECKey to the wallet.
|
void |
BloomFilter.insert(ECKey key)
Inserts the given key and equivalent hashed form (for the address).
|
boolean |
Wallet.isKeyRotating(ECKey key)
Returns whether the keys creation time is before the key rotation time, if one was set.
|
boolean |
Wallet.removeKey(ECKey key)
Removes the given key from the basicKeyChain.
|
static Wallet.SendRequest |
Wallet.SendRequest.to(NetworkParameters params,
ECKey destination,
Coin value)
Creates a new SendRequest to the given pubkey for the given value.
|
Modifier and Type | Method and Description |
---|---|
int |
Wallet.addKeys(List<ECKey> keys)
Deprecated.
|
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 |
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.
|
void |
AbstractWalletEventListener.onKeysAdded(List<ECKey> keys) |
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 | Method and Description |
---|---|
ECKey |
BIP38PrivateKey.decrypt(String passphrase) |
Modifier and Type | Method and Description |
---|---|
void |
NativeWalletEventListener.onKeysAdded(List<ECKey> keys) |
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. |
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)
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 serverMultisigKey,
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.
|
Modifier and Type | Method and Description |
---|---|
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 |
---|---|
protected ECKey |
TestWithNetworkConnections.key |
protected ECKey |
TestWithWallet.myKey |
Modifier and Type | Method and Description |
---|---|
static Transaction |
FakeTxBuilder.createFakeTx(NetworkParameters params,
Coin value,
ECKey to)
Create a fake TX of sufficient realism to exercise the unit tests.
|
protected Transaction |
TestWithWallet.sendMoneyToWallet(Wallet wallet,
Coin value,
ECKey toPubKey,
AbstractBlockChain.NewBlockType type) |
Modifier and Type | Field and Description |
---|---|
List<ECKey> |
RedeemData.keys |
Modifier and Type | Method and Description |
---|---|
ECKey |
KeyChainGroup.findKeyFromPubHash(byte[] pubkeyHash) |
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.findKeyFromPubKey(byte[] pubkey) |
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 |
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 |
KeyChain.getKey(KeyChain.KeyPurpose purpose)
Obtains a key intended for the given purpose.
|
ECKey |
BasicKeyChain.getKey(KeyChain.KeyPurpose ignored) |
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> |
BasicKeyChain.getKeys()
Returns a copy of the list of keys that this chain is managing.
|
List<? extends ECKey> |
KeyChain.getKeys(KeyChain.KeyPurpose purpose,
int numberOfKeys)
Obtains a number of key/s intended for the given purpose.
|
List<ECKey> |
BasicKeyChain.getKeys(KeyChain.KeyPurpose purpose,
int numberOfKeys) |
Modifier and Type | Method and Description |
---|---|
boolean |
KeyChainGroup.hasKey(ECKey key) |
boolean |
KeyChain.hasKey(ECKey key)
Returns true if the given key is in the chain.
|
boolean |
DeterministicKeyChain.hasKey(ECKey key) |
boolean |
BasicKeyChain.hasKey(ECKey key) |
void |
BasicKeyChain.importKey(ECKey key)
Imports a key to the key chain.
|
int |
KeyChainGroup.importKeys(ECKey... keys)
Imports the given keys into the basic chain, creating it if necessary.
|
int |
BasicKeyChain.importKeys(ECKey... keys) |
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.
|
Modifier and Type | Method and Description |
---|---|
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 |
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.
|
static RedeemData |
RedeemData.of(List<ECKey> keys,
Script redeemScript) |
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 |
AbstractKeyChainEventListener.onKeysAdded(List<ECKey> keys) |
Copyright © 2014. All rights reserved.