For 30 years, Texas has been on the winning side of history, getting downright rich off the global trading system that arose after the Cold War. Now, that wealth is about to be taken away in one of the greatest smash-and-grabs in U.S. history.

The Trump administration has drawn plenty of attention for plenty of reasons. But the lynchpin of the Trump era is a tax increase at the border. Called lots of things, it is simply a tax on corporations that import from abroad. The House Republican version is a 20 percent tax that would be the basis of the corporate tax code and pay for, well, everything on the Trump agenda, like the border wall.

It sounds innocuous at first, really, but taxes are a transfer of wealth by a fiat of government. And the wealth has to go from someplace to someplace else. The border tax would transfer an estimated $1 trillion from corporations that import goods and services, namely in the big trading and border states, and Texas is at the top of that list. This wealth would then be divided between government in Washington and legacy manufacturers, largely clustered in the less competitive American Midwest.

The results? The Texas boom would be dealt a serious body blow, felt not just in Laredo and El Paso, but Houston, San Antonio, Dallas, Fort Worth and everywhere in between. Consumers everywhere would face higher prices for everything: gasoline, jeans, food -- unless, frankly, a pair of never-before-witnessed miracles occurs. It is the riskiest gambit with the American economy since the tariffs that triggered the Great Depression.

For nearly 30 years, Texas has amassed huge wealth from international trade. In 1994, for example, Texas conducted just $7 billion in trade with Mexico and its gross state product was just $600 billion per year, according to the Federal Reserve Banks of Dallas and St. Louis. The downtowns of Texas cities were ghost towns, overbuilt and under-utilized in the wake of the savings and loan bust. Then Texans largely engineered the North American Free Trade Agreement, led by George H.W. Bush. And Texas boomed.

At that time up north, the old, mechanical heart of the American economy, the Rustbelt, groaned nearly to a halt, unable to keep up with the Germany and Japan. Soon after, George W. Bush launched U.S. negotiations of the Trans-Pacific Partnership. The economy became more diverse, adding technology and a slew of services and, since the beginning of the century, millions of new arrivals.

With a lower cost of living than other places, a diversified economy and trade, the Texas Miracle -- low unemployment, a cheap standard of living and a diversified economy that includes global trade -- matured in 2008, even as the nation slipped into the Great Recession. Today, Texas is a $1.6 trillion economy, about the size of Germany's economy, and international trade accounts for fully a third of it, according to census figures.

One-third of Texas trade goes back and forth to Mexico, the largest trading partner followed by Canada and then China, according to state figures. Texas has a fairly evenly balanced trade portfolio: Half of Texas' international trade is in the form of exports and the other half is built on imports, whereas the California and Florida economies, for instance, are heavier on imports. Now, many of the biggest American corporations call Texas something by another name: Home.

Raising taxes was once anathema to Republicans. It did, after all, partly cost George H.W. Bush is job. Not so now. There is no hue and cry in Congress about raising taxes when it comes to the border tax, first proposed by President Donald Trump and now being engineered by House Speaker Paul Ryan and, inexplicably, Texas Republican Rep. Kevin Brady, chair of the House Ways and Means Committee.

Recently, according to a Heritage Foundation publication, the East Texas Republican told conservatives, "Our plan restores America as the best place on the planet to create that new job, to build that new plant. That message is why President Trump is now our president." The president has been a little coy about the details of Brady's gambit; he had initially proposed a simple 30 percent tax on imports from Mexico. But he warmed to the idea recently, telling Reuters, "I certainly support a form of tax on the border."

So, here is how it would ostensibly work: The border tax in the House is the entire ball of wax. The current 35 percent corporate tax rate would be abolished and replaced with a seemingly simple 20 percent tax on any imports from anywhere in the world. Instead of just paying for a wall, the border tax will be the basis of the entire corporate tax code altogether. Export? Don't pay. Import? Pay up.

The resulting revenue, estimated at more than $1 trillion over 10 years by the independent, non-profit Tax Foundation*, *could pay for everything Trump has promised. That means paying, in theory, for lower taxes on wealthy individuals, more defense spending and, of course, the $26 billion wall with Mexico or more border agents. But money, like energy and water, is never destroyed. It just changes forms. And hands.

By effectively subsidizing exports at the expense of imports, the theory is that foreign customers will buy more valuable American exports, raising export revenue from the current $2.2 trillion, while imports fall from their current level of about $2.7 trillion. This is great news for two kinds of people: the executives of manufacturing corporations who are backing the border tax and people in the states where they generate income and jobs, namely the Midwest.

There, the heart of Trump's electoral victory, of course, states are far less competitive in trade. Indiana, for instance, exports about ten percent of what Texas ships abroad each year. Its trade-related workforce is miniscule and largely composed of companies with fewer than 500 employees each, according to that state's figures.

The corporations backing the border tax either need to increase the value of their exports abroad or take advantage of consolidating far-flung foreign vendors to minimize importing parts. Eli Lilly of Indianapolis, for example, could stand to boost export sales. Sales to European customers amount to just a quarter of U.S. sales, according to annual reports, while sales to Japanese customers are only about 15 percent as much. Headquartered in Midland, Michigan, Dow Chemical sells about one-third of its products in the United States, another third in Europe, and just as much everywhere else in the world, including the world's fastest-growing economy, China.

General Electric of Connecticut supports the tax. It may not need to boost exports as much as capitalize on lowering its reliance on imports. In recent years, GE has pursued vertical integration, bringing some parts suppliers in-house.

Yet what amounts to an export subsidy for these companies has to come from somewhere. And it will come right out of the big trading states: Texas, California, Florida and New York, as well as the smaller border states of New Mexico and Arizona. All told, the big four alone account for more than $2 trillion in trade, according to U.S. Census figures. California and Florida, in particular, import far more than they export, so their exposure to the tax, relatively speaking, is bigger.

But Texas' import stake is not chump change: It totals nearly a quarter of a billion dollars yearly. These imports include computer equipment, televisions and furniture for consumers, as well as wiring harnesses, heavy equipment, tractors, trailers, cars, appliances, electrical equipment and aircraft parts for industry. But the biggest of all imports? Oil. Texas has just begun to export oil. It imports far more crude oil, including Mexican heavy, for refining.

And the money has to come from somebody. Valero, Marathon Petroleum, Exxon Mobil and Phillips 66 aren't just some of the biggest companies in Texas. They are the top refining companies in the country, processing crude from around the world. Oil companies might avoid some of the border tax if the Trump administration succeeds in cooking the books, convincing the government not to count goods brought in for resale abroad (in this case, exported gasoline) as imports but merely as exports. But that is hardly a done, let alone kosher, bit of accounting. And the speculation in the industry now is that it can expect to take a large financial hit.

It's unclear that an accounting trick would even help companies like Toyota in Dallas, its manufacturing plant in San Antonio, or General Motor's plant in Arlington. After all, foreign parts go into cars to be sold here in the United States. That would boost the price of those cars. It would also increase the prices on imported goods at retailers, including Walmart, Best Buy and Gap, all of which oppose the new tax. Tom Thumb, after all, cannot re-ship Mexican avocadoes to stores it doesn't have in countries where it doesn't operate.

The other somebody who will have to pay for the tax is the American consumer. For it to work out, Trump's gamble requires two miracles. First, no foreign nation retaliates. Second, the dollar increases in value more than the tax, that is, more than 20 percent. That way, consumers' money is worth the same.

The prospects are cloudy for more than 2,000 foreign companies doing business in Texas, according to state data. They just might want to go home. And companies that sell to BAE systems, CEMEX, Citgo, Hyundai, Pearson and similar companies might have to stay home. The outlook is chancy for at least half the 3 million Texans who work in international trade, of one stripe or another.

For Texans, in general, the best odds that the border tax will work out for them are 50-50, making the border tax feel a lot less like policy and a lot more like rolling the dice. House Republicans claim that consumers won't feel a thing because the dollar will rise in value, making exports pricier and imports more affordable again. It's a nice theory with just one flaw.

It defies history.

The United States has never bet its entire corporate tax code on such a theory. The border tax is not a value-added tax, as its defenders like to claim, charged at the point of sale. And the last time the federal government imposed average tariffs this high was in the 1920s, which led the Republican Congress to double down with the Smoot-Haley Act in 1930, helping to plunge the globe into the Great Depression.

There is a coincidence of history here, however. Protectionism then, like now, went hand-in-hand with cracking down on Mexicans and the relationship with Mexico. As many as 1 million Mexicans, including Americans of Mexican descent, were sent packing south to make room for an anticipated surge of American-born farm workers who never materialized, as prices fell and fields went fallow. Morality aside, today's crackdown comes with a hefty price tag.

About 1.7 million undocumented immigrants make their homes in Texas, and most adults arrived more than a decade ago. After subtracting expenses for health care, education, police and social services -- and before adding an economic multiplier factor -- undocumented immigrants generate about $144.7 billion in economic output, according to research by the Perryman Group, a Waco economic analysis firm.

Immigrants in Texas account for nearly half or more of the state's construction laborers, farm workers, cooks, painters, cleaners and welders. Removing the spending power of undocumented immigrants alone would have a larger economic impact, according to Commerce Department figures, than wiping all of the Austin metropolitan area off the map.

All of this may explain the sudden hesitation of a few Texas Republicans. After lining up with Trump the candidate, Texas Rep. Will Hurd has broken sharply with Trump the president over the border wall. So has Republican Sen. John Cornyn, the Senate majority whip, who has said it "makes absolutely no sense."

As for the border tax, Cornyn has said, "It's time to look for other options." The Koch brothers and Steve Forbes have weighed in against the border tax. And the governor and lieutenant governor here in Austin? Not a word from the former, and the latter simply downplayed it as, well, Trump being Trump again.

Certainly, the international trading system has shown its flaws and injustices. But even if the border tax is the wrong remedy of dangerous economics, it is supremely shrewd politics. Trump and Congress are set to reward the region that really put them in power, the Midwest. And maybe it's a kind of a revenge by a region that just couldn't keep up with a global economy.

But it is one thing for sure: one of the largest transfers of wealth in American history. And history has a surprise. For once, Texas might be on the wrong end of it.

Richard Parker is the author of Lone Star Nation: How Texas Will Transform America and the lecturer of practice in journalism at Texas State University. He lives in Austin and is a frequent columnist for The Dallas Morning News. Twitter: @richardparkertx