(Fortune Magazine) -- As Congress wrestles with another bailout bill to try to contain the financial contagion, there's a potential killer bug out there whose next movement can't be predicted: the Credit Default Swap.

In just over a decade these privately traded derivatives contracts have ballooned from nothing into a $54.6 trillion market. CDS are the fastest-growing major type of financial derivatives. More important, they've played a critical role in the unfolding financial crisis. First, by ostensibly providing "insurance" on risky mortgage bonds, they encouraged and enabled reckless behavior during the housing bubble.

"If CDS had been taken out of play, companies would've said, 'I can't get this [risk] off my books,'" says Michael Greenberger, a University of Maryland law professor and former director of trading and markets at the Commodity Futures Trading Commission. "If they couldn't keep passing the risk down the line, those guys would've been stopped in their tracks. The ultimate assurance for issuing all this stuff was, 'It's insured.'"

Second, terror at the potential for a financial Ebola virus radiating out from a failing institution and infecting dozens or hundreds of other companies - all linked to one another by CDS and other instruments - was a major reason that regulators stepped in to bail out Bear Stearns and buy out AIG (AIG, Fortune 500), whose calamitous descent itself was triggered by losses on its CDS contracts (see "Hank's Last Stand").

And the fear of a CDS catastrophe still haunts the markets. For starters, nobody knows how federal intervention might ripple through this chain of contracts. And meanwhile, as we'll see, two fundamental aspects of the CDS market - that it is unregulated, and that almost nothing is disclosed publicly - may be about to change. That adds even more uncertainty to the equation.

"The big problem is that here are all these public companies - banks and corporations - and no one really knows what exposure they've got from the CDS contracts," says Frank Partnoy, a law professor at the University of San Diego and former Morgan Stanley derivatives salesman who has been writing about the dangers of CDS and their ilk for a decade. "The really scary part is that we don't have a clue." Chris Wolf, a co-manager of Cogo Wolf, a hedge fund of funds, compares them to one of the great mysteries of astrophysics: "This has become essentially the dark matter of the financial universe."

***

AT FIRST GLANCE, credit default swaps don't look all that scary. A CDS is just a contract: The "buyer" plunks down something that resembles a premium, and the "seller" agrees to make a specific payment if a particular event, such as a bond default, occurs. Used soberly, CDS offer concrete benefits: If you're holding bonds and you're worried that the issuer won't be able to pay, buying CDS should cover your loss. "CDS serve a very useful function of allowing financial markets to efficiently transfer credit risk," argues Sunil Hirani, the CEO of Creditex, one of a handful of marketplaces that trade the contracts.

Because they're contracts rather than securities or insurance, CDS are easy to create: Often deals are done in a one-minute phone conversation or an instant message. Many technical aspects of CDS, such as the typical five-year term, have been standardized by the International Swaps and Derivatives Association (ISDA). That only accelerates the process. You strike your deal, fill out some forms, and you've got yourself a $5 million - or a $100 million - contract.

And as long as someone is willing to take the other side of the proposition, a CDS can cover just about anything, making it the Wall Street equivalent of those notorious Lloyds of London policies covering Liberace's hands and other esoterica. It has even become possible to purchase a CDS that would pay out if the U.S. government defaults. (Trust us when we say that if the government goes under, trying to collect will be the least of your worries.)

You can guess how Wall Street cowboys responded to the opportunity to make deals that (1) can be struck in a minute, (2) require little or no cash upfront, and (3) can cover anything. Yee-haw! You can almost picture Slim Pickens in Dr. Strangelove climbing onto the H-bomb before it's released from the B-52. And indeed, the volume of CDS has exploded with nuclear force, nearly doubling every year since 2001 to reach a recent peak of $62 trillion at the end of 2007, before receding to $54.6 trillion as of June 30, according to ISDA.

Take that gargantuan number with a grain of salt. It refers to the face value of all outstanding contracts. But many players in the market hold offsetting positions. So if, in theory, every entity that owns CDS had to settle its contracts tomorrow and "netted" all its positions against each other, a much smaller amount of money would change hands. But even a tiny fraction of that $54.6 trillion would still be a daunting sum.

The credit freeze and then the Bear disaster explain the drop in outstanding CDS contracts during the first half of the year - and the market has only worsened since. CDS contracts on widely held debt, such as General Motors' (GM, Fortune 500), continue to be actively bought and sold. But traders say almost no new contracts are being written on any but the most liquid debt issues right now, in part because nobody wants to put money at risk and because nobody knows what Washington will do and how that will affect the market. ("There's nothing to do but watch Bernanke on TV," one trader told Fortune during the week when the Fed chairman was going before Congress to push the mortgage bailout.) So, after nearly a decade of exponential growth, the CDS market is poised for its first sustained contraction.

***

ONE REASON THE MARKET TOOK OFF is that you don't have to own a bond to buy a CDS on it - anyone can place a bet on whether a bond will fail. Indeed the majority of CDS now consists of bets on other people's debt. That's why it's possible for the market to be so big: The $54.6 trillion in CDS contracts completely dwarfs total corporate debt, which the Securities Industry and Financial Markets Association puts at $6.2 trillion, and the $10 trillion it counts in all forms of asset-backed debt.

"It's sort of like I think you're a bad driver and you're going to crash your car," says Greenberger, formerly of the CFTC. "So I go to an insurance company and get collision insurance on your car because I think it'll crash and I'll collect on it." That's precisely what the biggest winners in the subprime debacle did. Hedge fund star John Paulson of Paulson & Co., for example, made $15 billion in 2007, largely by using CDS to bet that other investors' subprime mortgage bonds would default.

So what started out as a vehicle for hedging ended up giving investors a cheap, easy way to wager on almost any event in the credit markets. In effect, credit default swaps became the world's largest casino. As Christopher Whalen, a managing director of Institutional Risk Analytics, observes, "To be generous, you could call it an unregulated, uncapitalized insurance market. But really, you would call it a gaming contract."

There is at least one key difference between casino gambling and CDS trading: Gambling has strict government regulation. The federal government has long shied away from any oversight of CDS. The CFTC floated the idea of taking an oversight role in the late '90s, only to find itself opposed by Federal Reserve chairman Alan Greenspan and others. Then, in 2000, Congress, with the support of Greenspan and Treasury Secretary Lawrence Summers, passed a bill prohibiting all federal and most state regulation of CDS and other derivatives. In a press release at the time, co-sponsor Senator Phil Gramm - most recently in the news when he stepped down as John McCain's campaign co-chair this summer after calling people who talk about a recession "whiners" - crowed that the new law "protects financial institutions from over-regulation ... and it guarantees that the United States will maintain its global dominance of financial markets." (The authors of the legislation were so bent on warding off regulation that they had the bill specify that it would "supersede and preempt the application of any state or local law that prohibits gaming ...") Not everyone was as sanguine as Gramm. In 2003 Warren Buffett famously called derivatives "financial weapons of mass destruction."

***

THERE'S ANOTHER BIG difference between trading CDS and casino gambling. When you put $10 on black 22, you're pretty sure the casino will pay off if you win. The CDS market offers no such assurance. One reason the market grew so quickly was that hedge funds poured in, sensing easy money. And not just big, well-established hedge funds but a lot of upstarts. So in some cases, giant financial institutions were counting on collecting money from institutions only slightly more solvent than your average minimart. The danger, of course, is that if a hedge fund suddenly has to pay off on a lot of CDS, it will simply go out of business. "People have been insuring risks that they can't insure," says Peter Schiff, the president of Euro Pacific Capital and author of Crash Proof, which predicted doom for Fannie and Freddie, among other things. "Let's say you're writing fire insurance policies, and every time you get the [premium], you spend it. You just assume that no houses are going to burn down. And all of a sudden there's a huge fire and they all burn down. What do you do? You just close up shop."