Package org.bitcoinj.wallet
Interface KeyChainGroupStructure
-
public interface KeyChainGroupStructure
Defines a structure for hierarchical deterministic wallets.Use
BIP32
for BIP-32 wallets andBIP43
for BIP-43-family wallets.bitcoinj BIP-32 wallets use
DeterministicKeyChain.ACCOUNT_ZERO_PATH
forScriptType.P2PKH
andDeterministicKeyChain.ACCOUNT_ONE_PATH
forScriptType.P2WPKH
BIP-43-family wallets structured via
KeyChainGroupStructure
will always use account number zero. Currently, only BIP-44 (P2PKH) and BIP-84 (P2WPKH) are supported.
-
-
Field Summary
Fields Modifier and Type Field Description static KeyChainGroupStructure
BIP32
Original bitcoinjKeyChainGroupStructure
implementation.static KeyChainGroupStructure
BIP43
KeyChainGroupStructure
implementation for BIP-43 family structures.static KeyChainGroupStructure
DEFAULT
Deprecated.UseBIP32
for BIP-32
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description static ChildNumber
account(int accountIndex)
Return path component for an accountdefault HDPath
accountPathFor(ScriptType outputScriptType)
Deprecated.HDPath
accountPathFor(ScriptType outputScriptType, Network network)
Map desired output script type and network to an account pathdefault HDPath
accountPathFor(ScriptType outputScriptType, NetworkParameters networkParameters)
Map desired output script type and network to an account pathstatic ChildNumber
coinType(Network network)
Return coin type path component for a network idstatic HDPath
purpose(ScriptType scriptType)
Return the (root) path containing "purpose" for the specified scriptType
-
-
-
Field Detail
-
BIP32
static final KeyChainGroupStructure BIP32
Original bitcoinjKeyChainGroupStructure
implementation. Based on BIP32 "Wallet structure". For this structurenetwork
is ignored
-
BIP43
static final KeyChainGroupStructure BIP43
KeyChainGroupStructure
implementation for BIP-43 family structures. Currently, BIP-44 and BIP-84 are supported. Account number is hard-coded to zero.
-
DEFAULT
@Deprecated static final KeyChainGroupStructure DEFAULT
Deprecated.UseBIP32
for BIP-32DefaultKeyChainGroupStructure
implementation. Alias forBIP32
-
-
Method Detail
-
accountPathFor
@Deprecated default HDPath accountPathFor(ScriptType outputScriptType)
Deprecated.Map desired output script type to an account path. Default to MainNet, BIP-32 Keychains use the same path for MainNet and TestNet- Parameters:
outputScriptType
- the script/address type- Returns:
- account path
-
accountPathFor
HDPath accountPathFor(ScriptType outputScriptType, Network network)
Map desired output script type and network to an account path- Parameters:
outputScriptType
- output script type (purpose)network
- network/coin type- Returns:
- The HD Path: purpose / coinType / accountIndex
-
accountPathFor
default HDPath accountPathFor(ScriptType outputScriptType, NetworkParameters networkParameters)
Map desired output script type and network to an account path- Parameters:
outputScriptType
- output script type (purpose)networkParameters
- network/coin type- Returns:
- The HD Path: purpose / coinType / accountIndex
-
purpose
static HDPath purpose(ScriptType scriptType)
Return the (root) path containing "purpose" for the specified scriptType- Parameters:
scriptType
- script/address type- Returns:
- An HDPath with a BIP44 "purpose" entry
-
coinType
static ChildNumber coinType(Network network)
Return coin type path component for a network id- Parameters:
network
- network id string, eg.BitcoinNetwork.ID_MAINNET
-
account
static ChildNumber account(int accountIndex)
Return path component for an account- Parameters:
accountIndex
- account index- Returns:
- A hardened path component
-
-