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
if (has_bech32_spkman) {
        return OutputType::BECH32;
    }
    // else use m_default_address_type for change
    return m_default_address_type;
}
void CWaet::CommitTransaction(CTransactionRef tx, mapValue_t mapValue, std::vector<std::pair<std::string, std::string>> orderForm)
{
    LOCK(cs_);
    WaetLogPrintf("CommitTransaction:\n%s", tx->ToString()); /* Continued */
    // Add tx to , because if it has change it's also ours,
    // otherwise just for transaction history.
    AddToWaet(tx, TxStateInactive{}, [&](CWaetTx& wtx, bool new_tx) {
        CHECK_NONFATAL(wtx.mapValue.empty());
        CHECK_NONFATAL(wtx.vOrderForm.empty());
        wtx.mapValue = std::move(mapValue);
        wtx.vOrderForm = std::move(orderForm);
        wtx.fTimeReceivedIsTxTime = true;
        wtx.fFromMe = true;
        return true;
    });
    // Notify that old coins are s
    for (const CTxIn& txin : tx->vin) {
        CWaetTx &coin = mapWaet.at(txin.prevout.hash);
        coin.MarkDirty();
        NotifyTransactionChanged(coin.GetHash(), CT_UPDATED);
    }
    // Get the inserted-CWaetTx from mapWaet so that the
    // wtx cached mempool state is updated correctly
    CWaetTx& wtx = mapWaet.at(tx->GetHash());