Currently, the multisig descriptor constructions are limited to 16 keys only possibly because of template parsing reasons. Under p2sh context, such scripts would be invalid anyway because of 520-byte rule, but we can support up to 20 keys for CHECKMULTISIG in witness script context. 


NO,
    UNHARDENED,
    HARDENED,
};
class BIP32PubkeyProvider final : public PubkeyProvider
{
    
    CExtPubKey m_root_extkey;
    KeyPath m_path;
    DeriveType m_derive;
    
    
    CExtPubKey m_cached_xpub;
    bool GetExtKey(const SigningProvider& arg, CExtKey& ret) const
    {
        CKey key;
        if (!arg.GetKey(m_root_extkey.pubkey.GetID(), key)) return false;
        ret.nDepth = m_root_extkey.nDepth;
        std::copy(m_root_extkey.vchFingerprint, m_root_extkey.vchFingerprint + sizeof(ret.vchFingerprint), ret.vchFingerprint);
        ret.nChild = m_root_extkey.nChild;
        ret.chaincode = m_root_extkey.chaincode;
        ret.key = key;
        return true;
    }
    
    bool GetDerivedExtKey(const SigningProvider& arg, CExtKey& xprv) const