public static class KeyChainGroup.Builder
extends java.lang.Object
KeyChainGroup. Use KeyChainGroup.builder(NetworkParameters) to acquire an instance.| Modifier and Type | Method and Description |
|---|---|
KeyChainGroup.Builder |
addChain(DeterministicKeyChain chain)
Add a single chain.
|
KeyChainGroup |
build() |
KeyChainGroup.Builder |
chains(java.util.List<DeterministicKeyChain> chains)
Add multiple chains.
|
KeyChainGroup.Builder |
fromRandom(Script.ScriptType outputScriptType)
Add chain from a random source.
|
KeyChainGroup.Builder |
fromSeed(DeterministicSeed seed,
Script.ScriptType outputScriptType)
Add chain from a given seed.
|
KeyChainGroup.Builder |
lookaheadSize(int lookaheadSize)
Set a custom lookahead size for all deterministic chains
|
KeyChainGroup.Builder |
lookaheadThreshold(int lookaheadThreshold)
Set a custom lookahead threshold for all deterministic chains
|
public KeyChainGroup.Builder fromRandom(Script.ScriptType outputScriptType)
Add chain from a random source.
In the case of P2PKH, just a P2PKH chain is created and activated which is then the default chain for fresh addresses. It can be upgraded to P2WPKH later.
In the case of P2WPKH, both a P2PKH and a P2WPKH chain are created and activated, the latter being the default chain. This behaviour will likely be changed with bitcoinj 0.16 such that only a P2WPKH chain is created and activated.
outputScriptType - type of addresses (aka output scripts) to generate for receivingpublic KeyChainGroup.Builder fromSeed(DeterministicSeed seed, Script.ScriptType outputScriptType)
Add chain from a given seed.
In the case of P2PKH, just a P2PKH chain is created and activated which is then the default chain for fresh addresses. It can be upgraded to P2WPKH later.
In the case of P2WPKH, both a P2PKH and a P2WPKH chain are created and activated, the latter being the default chain. This behaviour will likely be changed with bitcoinj 0.16 such that only a P2WPKH chain is created and activated.
seed - deterministic seed to derive all keys fromoutputScriptType - type of addresses (aka output scripts) to generate for receivingpublic KeyChainGroup.Builder addChain(DeterministicKeyChain chain)
chain - to addpublic KeyChainGroup.Builder chains(java.util.List<DeterministicKeyChain> chains)
chains - to addpublic KeyChainGroup.Builder lookaheadSize(int lookaheadSize)
lookaheadSize - lookahead sizepublic KeyChainGroup.Builder lookaheadThreshold(int lookaheadThreshold)
lookaheadThreshold - lookahead thresholdpublic KeyChainGroup build()