One of the most controversial—and ill-conceived—changes in the new federal tax law passed last month is a $10,000 cap on the deduction that households can claim for tax payments to state and local governments. The provision—which primarily penalizes residents of blue states—has prompted officials in some of the areas most affected by the cap to consider new tax credit programs that would, in essence, transform now nondeductible state and local tax payments into deductible charitable contributions to state and local government organizations. Such a credit program, if well crafted, would stand on solid legal ground and moreover would represent an effective state response to a destructive new federal tax law.

Let’s consider how such a charitable credit program might work.

Imagine a city—let’s call it Springfield—that funds its schools, parks, police and fire departments, and other public services through local property taxes. Springfield could set up a Springfield Schools Fund, a Springfield Parks Fund, a Springfield First Responders Fund, and so on to support various branches of the city government. For every dollar that a resident voluntarily donates to such a fund, she would qualify for a tax credit that would reduce her property tax liability by 80 cents.

Why would residents donate to these funds? For one thing, the menu of options would allow residents to exercise more choice over where their own dollars go. Experimental research by economists at the University of Texas and elsewhere indicates that Americans are more willing to make voluntary donations to the government when they can direct their money to a particular function.

The program also could yield a potentially significant federal tax benefit for some residents. Consider the case of a taxpayer who itemizes her deductions on her federal tax returns and runs up against the new $10,000 cap on the SALT deduction. In New Jersey, where three towns already have announced plans for charitable credit programs, the average SALT deduction claimed on itemized returns in tax year 2015 was more than $17,000. In California, which is considering a statewide program along these lines, the average SALT deduction for an itemizer was more than $18,000. For a household in the 37 percent federal income tax bracket that has hit the $10,000 cap already, a $100 donation to the Springfield Schools Fund or one of the other funds would yield two tax benefits: a credit against local property taxes worth $80 and an otherwise unavailable federal income tax deduction worth $37. All in all, the $100 donation would yield $117 in tax benefits—a return on investment that would certainly encourage some residents to participate.

All the while, the hypothetical city of Springfield would stand to benefit in at least three ways. First, the program would generate more money for city services because the city would be exchanging a credit of only $80 for every $100 it takes in. Second, by giving its residents an opportunity to claim a federal tax benefit, Springfield makes itself a more attractive place to live. Third, by allowing its residents to have more of a say as to where their dollars go, the city potentially promotes greater interest and involvement in civic life.

Importantly, the $37 federal tax benefit in the example above assumes that the donation would be deductible as a charitable contribution. Fortunately, the IRS has provided guidance on this precise subject. More than 30 states already have established charitable credit programs that support private school vouchers, food pantries, and various other causes. In 2011, the IRS released a memo stating that taxpayers can deduct donations to these credit programs as charitable contributions rather than as payments of state taxes.

The program also could yield a potentially significant federal tax benefit for some residents.

The IRS memo rested on several decades of judicial precedent and administrative rulings. A taxpayer generally cannot deduct a charitable contribution to the extent that she receives valuable benefits as a quid pro quo. So, for example, if a taxpayer donated $100 to the opera and received tickets worth $80 in return, the taxpayer could deduct only $20, not the full $100. But federal courts consistently have said that a tax benefit does not constitute a quid pro quo: A taxpayer who donates $100 and receives a state or local tax credit worth $80 still can deduct the full $100 on her federal tax returns. The position of the IRS is also supported by logic: If the tax benefits of a charitable contribution constituted a quid pro quo that defeated a deduction, then no one could ever claim a deduction for charitable contributions because the deduction is itself a tax benefit.

Some states, such as Arizona and South Carolina, have pressed this logic to its limit and allowed credits of 100 cents on the dollar for contributions to school voucher programs. In other words, taxpayers there can make a $100 contribution to a state-approved voucher program, take a $100 credit against state taxes, and claim a federal tax deduction worth up to $37. Our own view is that credits should be set at less than 100 cents on the dollar so that donors don’t simply view their contributions as a pure payment of taxes. And with credits less than 100 percent, state and local governments share in some of the federal tax benefits that these programs generate, bolstering their ability to support public goods.

There are other good reasons—apart from the federal tax benefits—for states and localities to set up credit programs like the hypothetical Springfield arrangement described above. In a 1998 law review article, Saul Levmore of the University of Chicago argued that allowing taxpayers to exercise choice over where their dollars go could reduce the risk that political processes will be captured by special interests. And in a 2012 article, law professors Yair Listokin of Yale and David Schizer of Columbia argued that allowing taxpayers to direct their dollars to specific causes could improve tax compliance and enhance civic pride.

New charitable credit programs enacted in response to the recent tax legislation could offer an opportunity to test out these theories. To be sure, if the Springfield Parks Fund receives a flood of contributions, then the city might decide to distribute less to the parks department from the city’s general account. But the city also might consider the flow of contributions to the Parks Fund as an indication that residents want more parks-related spending. State and local officials can—and we think should—take stock of the valuable information conveyed by citizens’ donation decisions.

If taxpayers make more donations to state and local civic institutions and deduct them as charitable contributions, that will, of course, mean less revenue for the federal government. The Joint Committee on Taxation estimates that the $10,000 cap on SALT—along with a number of other smaller changes to the itemized deduction rules—would raise more than $600 billion over the next decade. If taxpayers can skirt that cap, then the already costly Republican-backed tax legislation will blow an even larger hole in the deficit.

Ultimately, though, this reality should not stop state and local governments from implementing credit programs. President Trump and Republicans in Congress chose to pass a tax bill that would transfer hundreds of billions of dollars to multinational corporations and their shareholders while making it harder for states and localities to raise revenue for education, public safety, and other essential needs. It is entirely appropriate for state and local governments to push back against this attack. Congress could plug the revenue gap quite easily by limiting just a few of the new tax breaks for corporations, pass-through business owners, and multimillion-dollar estates.

State and local governments fund education, police and fire protection, health care, and a range of other critical public services. Those who rely on such services should not have to bear the brunt of an ill-considered federal tax law. One of the few positive consequences of an otherwise atrocious bill may be to spark creative approaches to state and local public finance that would yield civic benefits as well as federal tax savings.