Package org.bitcoinj.wallet
Class DeterministicKeyChain.Builder<T extends DeterministicKeyChain.Builder<T>>
java.lang.Object
org.bitcoinj.wallet.DeterministicKeyChain.Builder<T>
- Enclosing class:
- DeterministicKeyChain
public static class DeterministicKeyChain.Builder<T extends DeterministicKeyChain.Builder<T>>
extends Object
-
Field Summary
Modifier and TypeFieldDescriptionprotected HDPath
protected int
protected Instant
protected byte[]
protected ScriptType
protected String
protected SecureRandom
protected DeterministicSeed
protected DeterministicKey
protected DeterministicKey
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaccountPath
(List<ChildNumber> accountPath) Use an account path other than the defaultDeterministicKeyChain.ACCOUNT_ZERO_PATH
.build()
entropy
(byte[] entropy, long creationTimeSecs) Deprecated.Creates a deterministic key chain starting from the given entropy.protected String
outputScriptType
(ScriptType outputScriptType) passphrase
(String passphrase) The passphrase to use with the generated mnemonic, or null if you would like to use the default empty string.random
(SecureRandom random) Generates a new key chain with 128 bits of entropy selected randomly from the givenSecureRandom
object.random
(SecureRandom random, int bits) Generates a new key chain with entropy selected randomly from the givenSecureRandom
object and of the requested size in bits.seed
(DeterministicSeed seed) Creates a deterministic key chain starting from the given seed.protected T
self()
spend
(DeterministicKey accountKey) Creates a key chain that can spend from the given account key.watch
(DeterministicKey accountKey) Creates a key chain that watches the given account key.
-
Field Details
-
random
-
bits
protected int bits -
passphrase
-
creationTime
-
entropy
protected byte[] entropy -
seed
-
outputScriptType
-
watchingKey
-
spendingKey
-
accountPath
-
-
Constructor Details
-
Builder
protected Builder()
-
-
Method Details
-
self
-
entropy
Creates a deterministic key chain starting from the given entropy. All keys yielded by this chain will be the same if the starting entropy is the same. You should provide the creation time for the chain: this lets us know from what part of the chain we can expect to see derived keys appear.- Parameters:
entropy
- entropy to create the chain withcreationTime
- creation time for the chain
-
entropy
Deprecated. -
seed
Creates a deterministic key chain starting from the given seed. All keys yielded by this chain will be the same if the starting seed is the same. -
random
Generates a new key chain with entropy selected randomly from the givenSecureRandom
object and of the requested size in bits. The derived seed is further protected with a user selected passphrase (see BIP 39).- Parameters:
random
- the random number generator - use new SecureRandom().bits
- The number of bits of entropy to use when generating entropy. Either 128 (default), 192 or 256.
-
random
Generates a new key chain with 128 bits of entropy selected randomly from the givenSecureRandom
object. The derived seed is further protected with a user selected passphrase (see BIP 39).- Parameters:
random
- the random number generator - use new SecureRandom().
-
watch
Creates a key chain that watches the given account key. -
spend
Creates a key chain that can spend from the given account key. -
outputScriptType
-
passphrase
The passphrase to use with the generated mnemonic, or null if you would like to use the default empty string. Currently must be the empty string. -
accountPath
Use an account path other than the defaultDeterministicKeyChain.ACCOUNT_ZERO_PATH
. -
build
-
getPassphrase
-
entropy(byte[], Instant)