State of the wallet.
This is a product type introduced by fty::defprod.
The state of the wallet includes a BIP 32 key tree.
The key tree will always include: the purpose key (44') just under the root key; the Ethereum mainnet coin type key (60') just under that; the default account key (0') just under that; the external chain key (0) just under that; and 0 or more address keys just under that. In rare cases, some address key may be missing (when their derivation fails); see BIP 32 for details. Thus, every key in the tree is identified by a path of the following form:
m / 44' / 60' / 0' / 0 / address_index
The state of the wallet also includes the number of address keys derived so far. More precisely, this is the number of address keys attempted to derive so far, since in rare cases key derivation may fail (see BIP 32).
Because of this rare eventuality, this additional state component (the number of addresses) is not always redundant with the key tree, i.e. it cannot always be derived from the key tree. For example, the user may have attempted to derive 10 address keys, with indices 0 to 9, all of which were successful except for the one with index 9. Then the key tree would have 9 address keys (with indices 0 to 8), and no key for index 9. However, the additional state component for the number of addresses would be 10 in this case, and not 9. In this way, the next address key derivation attempt can be made at index 10, and not again at index 9 (which would fail again).
This fixtype captures the basic structure of the state of the wallet. Additional constraints, including the ones outlined above, are expressed by the well-formedness predicate stat-wfp.