BIP32 paths can be subsets/superset of each other.
BIP32 paths can be subsets/superset of each other.
If all elements in a path p
is included in a path
P
, (i.e. p
is a subset of P
), p.diff(P)
is the elements from P
that is not in p
.
// equal paths m/44'/1' diff m/44'/1' == Some(BIP32Path.empty) // diffable path m/44'/0'/0' diff m/44'/0'/0'/0/2 = Some(m/0/2) m/44'/0'/0'/1 diff m/44'/0'/0'/1/2 = Some(m/2) // this is longer than other m/44'/1' diff m/44' == None // any fields are unequal along the way m/44'/1' diff m/43'/2' == None m/44'/1'/0 diff m/44'/2'/1 == None
Given a index, creates a HD address
Represents a BIP44 change chain