Package org.bitcoinj.crypto
Class ChildNumber
java.lang.Object
org.bitcoinj.crypto.ChildNumber
- All Implemented Interfaces:
- Comparable<ChildNumber>
This is just a wrapper for the i (child number) as per BIP 32 with a boolean getter for the most significant bit
 and a getter for the actual 0-based child number. A List of these forms a path through a
 DeterministicHierarchy. This class is immutable.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intThe bit that's set in the child number to indicate whether this key is "hardened".static final ChildNumberstatic final ChildNumberstatic final ChildNumberstatic final ChildNumber
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionintcompareTo(ChildNumber other) booleanintgetI()Returns the uint32 encoded form of the path element, including the most significant bit.inthashCode()inti()Returns the uint32 encoded form of the path element, including the most significant bit.booleanintnum()Returns the child number without the hardening bit set (i.e.toString()
- 
Field Details- 
HARDENED_BITpublic static final int HARDENED_BITThe bit that's set in the child number to indicate whether this key is "hardened". Given a hardened key, it is not possible to derive a child public key if you know only the hardened public key. With a non-hardened key this is possible, so you can derive trees of public keys given only a public parent, but the downside is that it's possible to leak private keys if you disclose a parent public key and a child private key (elliptic curve maths allows you to work upwards).- See Also:
 
- 
ZERO
- 
ZERO_HARDENED
- 
ONE
- 
ONE_HARDENED
 
- 
- 
Constructor Details- 
ChildNumberpublic ChildNumber(int childNumber, boolean isHardened) 
- 
ChildNumberpublic ChildNumber(int i) 
 
- 
- 
Method Details- 
getIpublic int getI()Returns the uint32 encoded form of the path element, including the most significant bit.
- 
ipublic int i()Returns the uint32 encoded form of the path element, including the most significant bit.
- 
isHardenedpublic boolean isHardened()
- 
numpublic int num()Returns the child number without the hardening bit set (i.e. index in that part of the tree).
- 
toString
- 
equals
- 
hashCodepublic int hashCode()
- 
compareTo- Specified by:
- compareToin interface- Comparable<ChildNumber>
 
 
-