Bernie Sanders' campaign message is built around a central theme -- wresting economic power away from Wall Street and returning it to working people. It's a message that closely tracks the voting record of the self-described socialist senator from Vermont.

But there is one significant blemish on that record. In 2000, Sanders voted for the Commodity Futures Modernization Act, a landmark bill that blocked federal agencies from regulating credit default swaps -- the complex contracts at the heart of the 2008 financial crisis.

The CFMA's chief architect was then-Sen. Phil Gramm (R-Texas), a die-hard deregulator who joined Swiss banking giant UBS after leaving the Senate. Today, he's essentially the rhetorical opposite of Sanders, appearing in congressional hearings to literally bemoan the low pay of multimillionaire CEOs.

By 2000, Sanders was already an unpopular figure with big banks. The prior year, he had vigorously opposed the repeal of the Glass-Steagall Act, a Depression-era law which barred conventional banks from engaging in risky securities trading. Its repeal is widely viewed as fueling a merger binge that made companies massive and complex -- a catalyst for the banking collapse.

In a speech on the House floor, then-Rep. Sanders hammered the repeal bill for creating new "taxpayer exposure to potential losses should a financial conglomerate fail."

"It will lead to more megamergers, a small number of corporations dominating the financial service industry and further concentration of economic power in this country," Sanders added.

Yet a year later, Sanders voted in favor of legislation to exempt whole swaths of the banking sector from regulation. The discrepancy appears to be due in part to sloppy voting by Sanders, and in part to Gramm's legislative guile.

"No one has a stronger record on reforming Wall Street and breaking up too-big-to-fail banks than Senator Sanders," said Warren Gunnels, senior policy adviser to Sanders. "He strongly spoke against repealing Glass-Steagall because he was afraid that it could cause a financial crisis like the one we saw in 2008. And he's going to do everything possible to break up the too-big-to-fail banks."

When Sanders voted for the House version of the CFMA in October 2000, the bill was not yet a total debacle for Wall Street accountability advocates. The legislative text Sanders supported was clearly designed to curtail regulatory oversight. The GOP-authored bill was crafted as a response to a proposal from ex-Commodity Futures Trading Commission Chair Brooksley Born to ramp up oversight of derivatives. But the version Sanders initially voted for was more benign than the final, Gramm-authored version, and it didn't draw any of the protests that the 1999 repeal of Glass-Steagall did. In October 2000, the bill passed the House by a vote of 377 to 4 (51 members didn't vote), and then sat on the shelf for weeks.

But in December, Gramm -- after coordinating with top Clinton administration officials -- added much harder-edged deregulatory language to the bill, then attached the entire package to a must-pass 11,000-page bill funding the entire federal government. After Gramm's workshopping, the legislation included new language saying the federal government "shall not exercise regulatory authority with respect to, a covered swap agreement offered, entered into, or provided by a bank." That ended all government oversight of derivatives purchased or traded by banks. He also created the so-called "Enron Loophole," which barred federal oversight of energy trading on electronic platforms.

This was an era in which voting against funding the federal government was considered a major governance faux pas. The bill sailed through both chambers of Congress, with few lawmakers even aware of the major new deregulatory changes.

Sanders has since hammered the CFMA, its architects and specific provisions in Senate hearings and on the Senate floor. He helped push through legislation to close the Enron loophole in 2008. He voted against the bank bailouts of 2008, and has cried foul on heavy Wall Street speculation in the derivatives market for oil, saying it needlessly drives up gas prices. He has voted to break up the largest banks, and supports reinstating the Depression-era firewall between conventional lending and risky securities trading.

Wall street watchdogs sing his praises. With one exception.