There may be a silver lining in the revelation that Donald Trump paid no federal income tax for years or even decades: a comprehensive overhaul of the nation’s loophole-riddled revenue-gathering system.

“I think the opportunities for significant tax reform are much better than anything I’ve seen in years and years,” Sen. Ron Wyden of Oregon told me last week. As the ranking Democrat on the Senate Finance Committee, Wyden will become chairman if Democrats gain control of the Senate next week. Whatever the outcome, he will be a crucial participant in any bipartisan tax legislation.

“Trump’s scheming on his taxes has put a spotlight on a tale of two systems,” Wyden said. “The first is compulsory. You work a shift in a factory, or you’re a cop on a beat, the taxes come out of your paycheck. That’s just how it works.”

“For the most fortunate,” he added, “you hire a battery of experts, and you pay what you want when you want to, or even nothing at all. I think we can all agree the tax code is a dysfunctional mess.”

Rep. Kevin Brady, R-Texas and chairman of the House Ways and Means Committee, which writes tax laws, told me much the same thing. While he didn’t want to comment on Trump and his taxes, he said: “Americans are sick of this broken tax code. It’s so complex. Most people view it as unfair. They’re ready for someone to lead on tax reform and make it fairer and simpler.”

Brady, Speaker Paul Ryan and some of their House Republican colleagues have their own ideas about how to do that, an effort largely overshadowed by Trump, the Republican standard-bearer, whose self-serving tax proposals have been excoriated across the political spectrum for inflating the federal deficit and making the tax code even more favorable to real estate developers than it already is.

In June, House Republicans, led by Ryan, unveiled their so-called Better Way Forward on Tax Reform.

Democrats haven’t issued a similarly sweeping proposal, but in some surprising ways the Republican plan isn’t all that different from earlier reform plans championed by Wyden and other centrist Democrats.

While Hillary Clinton has offered a bevy of specific tax proposals aimed primarily at raising taxes for the very highest earners, they don’t add up to comprehensive reform. That leaves plenty of room for compromise.

House Republicans would reduce the number of tax brackets to three: 33 percent on the highest incomes, 25 percent for the middle range and 12 percent on more modest incomes. The top rate today is just over 39 percent.

The plan wipes out most itemized deductions, including those for state and local taxes and interest expenses, while preserving some yet-to-be-determined form of deductions for charitable contributions and home mortgages. It taxes capital gains, interest and dividends at half the rate of ordinary income. It eliminates the reviled alternative minimum tax, which falls primarily on the upper middle class.

In essence, the proposal would move the United States away from a traditional income tax and more toward a consumption tax, which is intended to encourage savings and investment.

Such an approach inevitably favors the rich, since they own most financial assets and do most of the investing. The centrist Urban-Brookings Tax Policy Center estimates that three-quarters of the tax cuts would benefit the top 1 percent of taxpayers, and that the highest 0.1 percent would get an average tax cut of $1.3 million.

Moreover, House Republicans would abolish the estate tax, which falls almost exclusively on the wealthy.

So how would that square with Clinton’s call to require the rich to pay a greater share of the tax burden?

For one thing, both Democrats and Republicans want to do something to fix the much criticized corporate tax code and would like to produce an immediate revenue windfall by luring back profits now held abroad by U.S. corporations.

The House Republicans’ plan cuts the corporate tax rate to 20 percent from the current 35 percent. It taxes so-called pass-through income from small businesses, partnerships and limited liability companies at a flat 25 percent, as opposed to the current top ordinary income rate of 39.6 percent.

It allows immediate deductions for most business expenses and investments, eliminating the need for complicated depreciation schedules, and does away with the interest deduction.

What effect all this would have on the federal deficit is a matter of continuing debate, since it depends on how much these changes would spur additional economic growth.

The conservative-leaning Tax Foundation estimates that, assuming no additional growth, the plan would cost $2.4 trillion during its first decade. But it also projects the plan would stimulate the economy, generating more tax revenue and cutting the cost to a relatively modest $191 billion over 10 years.

The Tax Policy Center estimated a higher cost of $3.1 trillion over the first decade. Adjusting for expected growth reduces the cost only slightly, to $3 trillion, largely because of higher interest payments on the debt needed to cover the larger deficit.

“At least it has a consistent philosophy, whether you agree with it or not,” said Douglas Holtz-Eakin, an economist who served as director of the Congressional Budget Office and is now president of the American Action Forum, a conservative pro-growth advocacy group. Holtz-Eakin has criticized Trump’s tax proposals as incoherent.

“In my view, the pre-eminent problem facing the United States is low economic growth, now pegged at about 2 percent,” Holtz-Eakin said. “To grow more rapidly over the long term, people need to save and invest those savings. This approach supports saving and investment.”

Leonard E. Burman, director of the Tax Policy Center and a professor at the Syracuse University Maxwell School of Citizenship and Public Affairs, agreed that the plan “is clearly designed to encourage investment,” especially the provision allowing businesses to immediately deduct expenses.

“Even Hillary Clinton has proposed that for small businesses,” Burman told me. “The primary drawback, as we’ve modeled it, is that it would add trillions to the national debt over 10 years.”

Still, “this is genuine reform,” he added, which is “exactly the kind of thing we should be debating in a national election and something the public should be deciding.”

If Clinton is elected president, the Republican plan, as written, would be dead on arrival because it runs squarely into one of her main campaign themes: The rich aren’t paying their fair share. But some tax experts say the Republican plan could be adjusted to include higher rates for the Americans who earn the most.

“In theory it would make it easier to raise the top rates,” Holtz-Eakin said. “That’s the fear of some conservatives.”

Raising some of the rates could achieve many of Clinton’s goals, including increasing taxes on the highest earners and creating an overall increase in revenue, while still embracing the underlying simplicity and pro-growth philosophy of the House Republicans’ plan.

A compromise plan might raise rates for taxpayers earning more than $5 million, as Clinton has proposed; limit the exclusion on capital gains, interest and dividends; cut the corporate rate to 25 percent rather than 20 percent; and keep the estate tax for the wealthiest taxpayers.

Wyden’s last stab at bipartisan tax reform, the Wyden-Coats plan of 2010, which he and Rep. Dan Coats, R-Ind., sponsored, had many of those elements. Like the Republican House plan, it called for just three brackets and lower rates (a top rate of 35 percent, only modestly higher than the House Republicans’ 33 percent). It allowed taxpayers to exclude 35 percent of their capital gains, as opposed to the Republicans’ 50 percent. It lowered the corporate tax rate to 24 percent and eliminated the alternative minimum tax.

Today’s bitterly polarized political environment, of course, makes any compromise extremely difficult. Tea Party Republicans are unlikely to support any legislation that raises rates or revenue. The Democratic left is likely to balk at cuts to capital gains and corporate taxes and more breaks for business investment.

But both Wyden and Brady told me they were open to deal-making, no matter how Tuesday’s election turns out.

“People recognize that the tax code has been hijacked by powerful interests, and both sides see this is so wildly inefficient,” Wyden said. “If I have the opportunity to chair the Senate Finance Committee, I’d like to come out of the gate on Day 1 with something that would be well received as bipartisan. It would be malpractice not to do this.”

Brady said the Republican proposals weren’t etched in stone. “We’re in a very aggressive listening and outreach mode, looking for feedback from families and job creators,” he said.

“We’re going to work with the next president to fix this broken tax code,” he said. “At the end of the day, we know from the Reagan-era tax reform that if we’re going to simplify the tax code and grow the economy, it will require bipartisan support regardless of who is in the White House.”