This patch modifies the internal Descriptor
class to optionally construct and use an “expansion cache”. Such a cache is a byte array that encodes all information necessary to expand a Descriptor
a second time without access to private keys, and without the need to perform expensive BIP32 derivations. For all currently defined descriptors, the cache simply contains a concatenation of all public keys used.
This is motivated by the goal of importing a descriptor into the wallet and using it as a replacement for the keypool, where it would be impossible to expand descriptors if they use hardened derivation.