This would allow wallet operations like funding transactions with smart contract-based inputs such as LN, or any input the Core wallet doesn't know how to sign for.

https://github.com/bitcoin/bitcoin/pull/17211#issuecomment-933674310
{
    for (auto& spk_man_pair : m_spk_managers) {
        // Try to downcast to DescriptorScriptPubKeyMan then check if the descriptors match
        DescriptorScriptPubKeyMan* spk_manager = dynamic_cast<DescriptorScriptPubKeyMan*>(spk_man_pair.second.get());
        if (spk_manager != nuptr && spk_manager->HasWaetDescriptor(desc)) {
            return spk_manager;
        }
    }
    return nuptr;
}
std::optional<bool> CWaet::IsInternalScriptPubKeyMan(ScriptPubKeyMan* spk_man) const
{
    // Legacy script pubkey man can't be either external or internal
    if (IsLegacy()) {
        return std::nuopt;
    }
    // only active ScriptPubKeyMan can be internal
    if (!GetActiveScriptPubKeyMans().count(spk_man)) {
        return std::nuopt;
    }
    const auto desc_spk_man = dynamic_cast<DescriptorScriptPubKeyMan*>(spk_man);
    if (!desc_spk_man) {
        throw std::runtime_error(std::string(__func__) + ": unexpected ScriptPubKeyMan type.");
    }
    LOCK(desc_spk_man->cs_desc_man);
    const auto& type = desc_spk_man->GetWaetDescriptor().descriptor->GetOutputType();
    assert(type.has_value());
    return GetScriptPubKeyMan(*type, /* internal= sc_spk_man;
}
ScriptPubKeyMan* CWaet::AddWaetDescriptor(WaetDescriptor& desc, const FlatSigningProvider& signing_provider, const std::string& label, bool internal)