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.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 |
---|---|
DeterministicKey |
Wallet.currentKey(KeyChain.KeyPurpose purpose)
Returns a key that hasn't been seen in a transaction yet, and which is suitable for displaying in a wallet
user interface as "a convenient key to receive funds on" when the purpose parameter is
KeyChain.KeyPurpose.RECEIVE_FUNDS . |
DeterministicKey |
Wallet.currentReceiveKey()
An alias for calling
Wallet.currentKey(org.bitcoinj.wallet.KeyChain.KeyPurpose) with
KeyChain.KeyPurpose.RECEIVE_FUNDS as the parameter. |
DeterministicKey |
Wallet.freshKey(KeyChain.KeyPurpose purpose)
Returns a key that has not been returned by this method before (fresh).
|
DeterministicKey |
Wallet.freshReceiveKey()
An alias for calling
Wallet.freshKey(org.bitcoinj.wallet.KeyChain.KeyPurpose) with
KeyChain.KeyPurpose.RECEIVE_FUNDS as the parameter. |
DeterministicKey |
Wallet.getKeyByPath(List<ChildNumber> path)
Returns a key for the given HD path, assuming it's already been derived.
|
DeterministicKey |
Wallet.getWatchingKey()
Returns a public-only DeterministicKey that can be used to set up a watching wallet: that is, a wallet that
can import transactions from the block chain just as the normal wallet can, but which cannot spend.
|
Modifier and Type | Method and Description |
---|---|
List<DeterministicKey> |
Wallet.freshKeys(KeyChain.KeyPurpose purpose,
int numberOfKeys)
Returns a key/s that has not been returned by this method before (fresh).
|
Modifier and Type | Method and Description |
---|---|
static Wallet |
Wallet.fromWatchingKey(NetworkParameters params,
DeterministicKey watchKey)
Creates a wallet that tracks payments to and from the HD key hierarchy rooted by the given watching key.
|
static Wallet |
Wallet.fromWatchingKey(NetworkParameters params,
DeterministicKey watchKey,
long creationTimeSeconds)
Creates a wallet that tracks payments to and from the HD key hierarchy rooted by the given watching key.
|
Modifier and Type | Method and Description |
---|---|
void |
Wallet.addFollowingAccountKeys(List<DeterministicKey> followingAccountKeys)
Alias for
addFollowingAccountKeys(followingAccountKeys, (followingAccountKeys.size() + 1) / 2 + 1) |
void |
Wallet.addFollowingAccountKeys(List<DeterministicKey> followingAccountKeys,
int threshold)
Makes given account keys follow the account key of the active keychain.
|
Modifier and Type | Method and Description |
---|---|
static DeterministicKey |
HDKeyDerivation.createMasterPrivateKey(byte[] seed)
Generates a new deterministic key from the given seed, which can be any arbitrary byte array.
|
static DeterministicKey |
HDKeyDerivation.createMasterPrivKeyFromBytes(byte[] privKeyBytes,
byte[] chainCode) |
static DeterministicKey |
HDKeyDerivation.createMasterPubKeyFromBytes(byte[] pubKeyBytes,
byte[] chainCode) |
DeterministicKey |
DeterministicKey.decrypt(KeyCrypter keyCrypter,
org.spongycastle.crypto.params.KeyParameter aesKey) |
DeterministicKey |
DeterministicKey.decrypt(org.spongycastle.crypto.params.KeyParameter aesKey) |
DeterministicKey |
DeterministicKey.derive(int child)
Derives a child at the given index (note: not the "i" value).
|
DeterministicKey |
DeterministicHierarchy.deriveChild(List<ChildNumber> parentPath,
boolean relative,
boolean createParent,
ChildNumber createChildNumber)
Extends the tree by calculating the requested child for the given path.
|
static DeterministicKey |
HDKeyDerivation.deriveChildKey(DeterministicKey parent,
ChildNumber childNumber) |
static DeterministicKey |
HDKeyDerivation.deriveChildKey(DeterministicKey parent,
int childNumber)
Derives a key given the "extended" child number, ie.
|
DeterministicKey |
DeterministicHierarchy.deriveNextChild(ImmutableList<ChildNumber> parentPath,
boolean relative,
boolean createParent,
boolean privateDerivation)
Extends the tree by calculating the next key that hangs off the given parent path.
|
static DeterministicKey |
HDKeyDerivation.deriveThisOrNextChildKey(DeterministicKey parent,
int childNumber)
Derives a key of the "extended" child number, ie.
|
static DeterministicKey |
DeterministicKey.deserialize(DeterministicKey parent,
byte[] serializedKey) |
static DeterministicKey |
DeterministicKey.deserializeB58(DeterministicKey parent,
String base58) |
DeterministicKey |
DeterministicKey.encrypt(KeyCrypter keyCrypter,
org.spongycastle.crypto.params.KeyParameter aesKey) |
DeterministicKey |
DeterministicKey.encrypt(KeyCrypter keyCrypter,
org.spongycastle.crypto.params.KeyParameter aesKey,
DeterministicKey newParent) |
DeterministicKey |
DeterministicHierarchy.get(List<ChildNumber> path,
boolean relativePath,
boolean create)
Returns a key for the given path, optionally creating it.
|
DeterministicKey |
DeterministicKey.getParent() |
DeterministicKey |
DeterministicKey.getPubOnly()
Returns the same key with the private part removed.
|
DeterministicKey |
DeterministicHierarchy.getRootKey()
Returns the root key that the
DeterministicHierarchy was created with. |
Modifier and Type | Method and Description |
---|---|
static DeterministicKey |
HDKeyDerivation.deriveChildKey(DeterministicKey parent,
ChildNumber childNumber) |
static DeterministicKey |
HDKeyDerivation.deriveChildKey(DeterministicKey parent,
int childNumber)
Derives a key given the "extended" child number, ie.
|
static HDKeyDerivation.RawKeyBytes |
HDKeyDerivation.deriveChildKeyBytesFromPrivate(DeterministicKey parent,
ChildNumber childNumber) |
static HDKeyDerivation.RawKeyBytes |
HDKeyDerivation.deriveChildKeyBytesFromPublic(DeterministicKey parent,
ChildNumber childNumber,
HDKeyDerivation.PublicDeriveMode mode) |
static DeterministicKey |
HDKeyDerivation.deriveThisOrNextChildKey(DeterministicKey parent,
int childNumber)
Derives a key of the "extended" child number, ie.
|
static DeterministicKey |
DeterministicKey.deserialize(DeterministicKey parent,
byte[] serializedKey) |
static DeterministicKey |
DeterministicKey.deserializeB58(DeterministicKey parent,
String base58) |
DeterministicKey |
DeterministicKey.encrypt(KeyCrypter keyCrypter,
org.spongycastle.crypto.params.KeyParameter aesKey,
DeterministicKey newParent) |
void |
DeterministicHierarchy.putKey(DeterministicKey key)
Inserts a key into the heirarchy.
|
Constructor and Description |
---|
DeterministicHierarchy(DeterministicKey rootKey)
Constructs a new hierarchy rooted at the given key.
|
DeterministicKey(DeterministicKey keyToClone,
DeterministicKey newParent)
Clones the key
|
DeterministicKey(ImmutableList<ChildNumber> childNumberPath,
byte[] chainCode,
BigInteger priv,
DeterministicKey parent)
Constructs a key from its components.
|
DeterministicKey(ImmutableList<ChildNumber> childNumberPath,
byte[] chainCode,
org.spongycastle.math.ec.ECPoint publicAsPoint,
BigInteger priv,
DeterministicKey parent)
Constructs a key from its components.
|
DeterministicKey(ImmutableList<ChildNumber> childNumberPath,
byte[] chainCode,
KeyCrypter crypter,
org.spongycastle.math.ec.ECPoint pub,
EncryptedData priv,
DeterministicKey parent)
Constructs a key from its components.
|
Modifier and Type | Method and Description |
---|---|
DeterministicKey |
KeyChainGroup.currentKey(KeyChain.KeyPurpose purpose)
Returns a key that hasn't been seen in a transaction yet, and which is suitable for displaying in a wallet
user interface as "a convenient key to receive funds on" when the purpose parameter is
KeyChain.KeyPurpose.RECEIVE_FUNDS . |
DeterministicKey |
DeterministicKeyChain.findKeyFromPubHash(byte[] pubkeyHash) |
DeterministicKey |
DeterministicKeyChain.findKeyFromPubKey(byte[] pubkey) |
DeterministicKey |
KeyChainGroup.freshKey(KeyChain.KeyPurpose purpose)
Returns a key that has not been returned by this method before (fresh).
|
DeterministicKey |
DeterministicKeyChain.getKey(KeyChain.KeyPurpose purpose)
Returns a freshly derived key that has not been returned by this method before.
|
protected DeterministicKey |
DeterministicKeyChain.getKeyByPath(ChildNumber... path)
Returns the deterministic key for the given absolute path in the hierarchy.
|
protected DeterministicKey |
DeterministicKeyChain.getKeyByPath(List<ChildNumber> path)
Returns the deterministic key for the given absolute path in the hierarchy.
|
DeterministicKey |
DeterministicKeyChain.getKeyByPath(List<ChildNumber> path,
boolean create)
Returns the deterministic key for the given absolute path in the hierarchy, optionally creating it
|
DeterministicKey |
DeterministicKeyChain.getWatchingKey()
An alias for
getKeyByPath(DeterministicKeyChain.ACCOUNT_ZERO_PATH).getPubOnly() . |
DeterministicKey |
DeterministicKeyChain.markKeyAsUsed(DeterministicKey k)
Mark the DeterministicKey as used.
|
DeterministicKey |
DeterministicKeyChain.markPubHashAsUsed(byte[] pubkeyHash)
Mark the DeterministicKeys as used, if they match the pubkeyHash
See
DeterministicKeyChain.markKeyAsUsed(DeterministicKey) for more info on this. |
DeterministicKey |
DeterministicKeyChain.markPubKeyAsUsed(byte[] pubkey)
Mark the DeterministicKeys as used, if they match the pubkey
See
DeterministicKeyChain.markKeyAsUsed(DeterministicKey) for more info on this. |
Modifier and Type | Method and Description |
---|---|
List<DeterministicKey> |
KeyChainGroup.freshKeys(KeyChain.KeyPurpose purpose,
int numberOfKeys)
Returns a key/s that have not been returned by this method before (fresh).
|
List<DeterministicKey> |
DeterministicKeyChain.getKeys(KeyChain.KeyPurpose purpose,
int numberOfKeys)
Returns freshly derived key/s that have not been returned by this method before.
|
List<DeterministicKey> |
DeterministicKeyChain.getLeafKeys()
Returns leaf keys issued by this chain (including lookahead zone)
|
Modifier and Type | Method and Description |
---|---|
DeterministicKey |
DeterministicKeyChain.markKeyAsUsed(DeterministicKey k)
Mark the DeterministicKey as used.
|
static DeterministicKeyChain |
DeterministicKeyChain.watch(DeterministicKey accountKey)
Creates a key chain that watches the given account key.
|
static DeterministicKeyChain |
DeterministicKeyChain.watch(DeterministicKey accountKey,
long seedCreationTimeSecs)
Creates a key chain that watches the given account key, and assumes there are no transactions involving it until
the given time (this is an optimisation for chain scanning purposes).
|
static DeterministicKeyChain |
DeterministicKeyChain.watchAndFollow(DeterministicKey watchKey)
Creates a deterministic key chain with the given watch key and that follows some other keychain.
|
Modifier and Type | Method and Description |
---|---|
void |
KeyChainGroup.addFollowingAccountKeys(List<DeterministicKey> followingAccountKeys)
Alias for
addFollowingAccountKeys(followingAccountKeys, (followingAccountKeys.size() + 1) / 2 + 1) |
void |
KeyChainGroup.addFollowingAccountKeys(List<DeterministicKey> followingAccountKeys,
int sigsRequiredToSpend)
Makes given account keys follow the account key of the active keychain.
|
Constructor and Description |
---|
DeterministicKeyChain(DeterministicKey watchingKey) |
DeterministicKeyChain(DeterministicKey watchingKey,
long creationTimeSeconds)
Creates a deterministic key chain that watches the given (public only) root key.
|
KeyChainGroup(NetworkParameters params,
DeterministicKey watchKey)
Creates a keychain group with no basic chain, and an HD chain that is watching the given watching key.
|
KeyChainGroup(NetworkParameters params,
DeterministicKey watchKey,
long creationTimeSecondsSecs)
Creates a keychain group with no basic chain, and an HD chain that is watching the given watching key which
was assumed to be first used at the given UNIX time.
|
Constructor and Description |
---|
KeyChainGroup(NetworkParameters params,
DeterministicSeed seed,
List<DeterministicKey> followingAccountKeys,
int sigsRequiredToSpend)
Creates a keychain group with no basic chain, with an HD chain initialized from the given seed and being followed
by given list of watch keys.
|
Copyright © 2014. All rights reserved.