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. 


{
        std::string sub;
        if (!m_provider->ToNormalizedString(arg, sub, priv)) return false;
        
        
        
        if (sub[0] == '[') {
            sub = sub.substr(9);
            ret = "[" + OriginString() + std::move(sub);
        } else {
            ret = "[" + OriginString() + "]" + std::move(sub);
        }
        return true;
    }
    bool GetPrivKey(int pos, const SigningProvider& arg, CKey& key) const override
    {
        return m_provider->GetPrivKey(pos, arg, key);
    }
};
class ConstPubkeyProvider final : public PubkeyProvider
{
    CPubKey m_pubkey;
public:
    ConstPubkeyProvider(uint32_t exp_index, const CPubKey& pubkey) : PubkeyProvider(exp_index), m_pubkey(pubkey) {}