FORTUNE -- In a climate-controlled warehouse in Harrisonburg, Va., 1,103 computer servers, each equipped with 24 hard drives, are piled in 120 stacks awaiting a federal judge's decision about what to do with them. Together, they store more than 25 petabytes (25 million gigabytes) of information. That's enough space to store 50 Libraries of Congress, 13.3 years of HDTV video, or "approximately half of all the entire written works of mankind, from the beginning of recorded history, in all languages," according to Carpathia Hosting, the company that owns the hardware.
For several years Carpathia leased the servers to a company called Megaupload, which deployed another 700 or so servers in the Netherlands and France. At one time Megaupload alone accounted for 4% of the globe's entire Internet traffic and was the 13th-most-visited site on the web, according to the government, with more daily visitors than Netflix (nflx), AOL (aol), or the New York Times.
Until recently Megaupload was one of a number of lucrative, businesses known as cyberlockers, which are the latest generation of operations created in the image of the original Napster -- the pioneering file-sharing service that launched in 1999 and was shut down by court order in 2001. In January an Alexandria, Va., federal grand jury charged Megaupload and seven top officials with a racketeering conspiracy focused on aiding and abetting criminal copyright infringement. The government alleges that the defendants, led by Kim Dotcom, a.k.a. Kim Schmitz, a.k.a. Kim Tim Jim Vestor, made $175 million from a business built on facilitating the illegal distribution of at least $500 million worth of copyrighted movies, music, television shows, books, images, videogames, and software.*
Cyberlockers -- others include Rapidshare and Hotfile -- make money by selling both advertisements and premium subscriptions. The subscriptions enable users to download or stream files more quickly than free users can.
They work like this: Users upload files to "lockers," though the lockers typically have no locks. ("Uploading" means copying a file from the user's own computer onto the cyberlocker company's website, where the file is stored on one of the company's servers.) Most uploaders then publish the name of the file and its locker URL on public blogs or "link farms," from which anyone in the world can download or stream the materials stored there, using a search engine to find the link. In pending civil litigation against Megaupload's rival Hotfile, a movie industry statistician whose surveys have been accepted by many courts found that more than 90% of that service's downloads were infringing.
In a click-through agreement that appears to serve as a fig leaf, cyberlockers require their users to agree not to upload infringing materials. Nevertheless, most cyberlockers seem to encourage users to do just that. Until they started getting hit with civil copyright suits, many cyberlockers offered cash bounties to users based on, for instance, the number of times other people downloaded whatever the users uploaded -- $15 to $25, say, per every 1,000 downloads. Such paid users were called "affiliates." One Megaupload affiliate uploaded 16,950 files to the site over six years, the government says, generating more than 34 million page views. (Since the Megaupload indictment, many cyberlockers have altered their practices.)
The lead attorney for Kim Dotcom and Megaupload, Ira Rothken of San Francisco, says that Megaupload was a "cloud storage" business whose technology was "nearly identical" to that used by such legitimate businesses as Dropbox, Microsoft (msft) SkyDrive, and Google Drive. "Megaupload appears to be the perfect example of something protected under the Sony doctrine," Rothken says, referring to the landmark 1984 U.S. Supreme Court case Sony Corp. of America v. Universal City Studios. In that case, the court found that Sony, in selling its Betamax videotape recorders, could not be held liable for the fact that some customers might use them to infringe copyrights.
To a layperson, calling Megaupload "cloud storage" might sound absurd. At the time of the raid, 91% of Megaupload's 66.6 million registered users had never stored anything there, according to the indictment; they just downloaded or streamed what other people stored. In addition, legitimate cloud storage services have different features and business models -- for instance, limiting the number of downloads per day; having password-protected lockers; not paying people to upload popular files -- that render their systems poorly suited for mass distribution of copyrighted materials.
Yet under existing law, Rothken is making an infuriatingly defensible contention. The fact that Megaupload could have easily been designed in ways that discouraged infringement is legally irrelevant. Unlike a lawn mower manufacturer, which is held liable for injuries caused by its products if they could have been cheaply avoided by a safer design, tech companies have no comparable duty to minimize the damage their products cause to copyright holders.
We started down this path with the Sony ruling Rothken referred to, in which the Supreme Court chose not to apply ordinary tort principles when assessing a manufacturer's liability to copyright holders damaged by its products. Instead, importing a doctrine from patent law, it ruled that the seller of a product would be immune from suit as long as the product was "merely ... capable of substantial noninfringing uses." And as Rothken says, Megaupload is surely capable of substantial noninfringing uses, like backup storage.
Which raises a question: How can that still be the law? How can it be that 11 years after the court-ordered shutdown of Napster, nine after that of its first cousin Aimster, six after those of offspring Kazaa, Grokster, and Streamcast (blessed, in the last two cases, by a unanimous U.S. Supreme Court), and two after LimeWire's -- that there can be any lingering doubt about the illegality of overwhelmingly infringing sites like Megaupload? Each of those predecessor businesses was technically capable of noninfringing uses.
True, but the Supreme Court has never retreated from, or even tweaked, the broad wording of the Sony Betamax ruling, which is now revered in tech circles as the Magna Carta of the technology age. That's because almost every new technology is dual use -- capable of being put to both legal and illegal purposes. Startup entrepreneurs and investors want bright legal lines that ensure that if they market an innovative technology, they won't be held liable for the illegal uses that some consumers will put it to.
And everyone wants them to have that protection. No one wants those archetypal Palo Alto high school kids launching businesses from their parents' garages to be litigated into oblivion before they can even show us the amazing new things they were trying to create.
So courts always paid lip service to Sony even as they found ways to close down Napster and its progeny. They bobbed and weaved, criticizing unique technical features of each service that tended to betray the owners' intent to induce copyright infringement, which was usually corroborated by smoking-gun e-mails and excessively candid marketing materials.
The rulings, in turn, simply challenged software programmers to come back and try again, coding around whatever telltale technological feature that had been flagged as offensive in the previous case. The grand quest was to produce an automated, "copyright agnostic" system that would, in practice, facilitate users' infringements while insulating the operators from culpability inside a buffer zone of plausible deniability. This objective was articulated in 2001 by attorney Fred Von Lohmann, then a visiting researcher with the Berkeley Center for Law and Technology, in an open letter to developers advising them how to build judge-proof, post-Napster file-sharing operations. "Can you plausibly deny knowing what your end users are up to?" he urged developers to ask themselves. Von Lohmann then became a staff attorney for the Electronic Frontier Foundation, a leading digital-rights nonprofit, which posted his letter on its site. Since 2010 he's been a senior copyright counsel at Google (goog).
With cyberlockers, programmers have now come close to realizing this ignoble goal. They are the simplest, most colossal, most profitable piracy bazaars the world has ever known, and yet, under the letter of our current laws, they might be lawful.
In 1998 copyright holders thought they would never face this situation. That year, when Congress enacted the Digital Millennium Copyright Act, they thought they had won a compromise they could live with. The DMCA adapted the Betamax principles to online commerce as it then existed -- though that was before the explosion in user-generated content that we now call Web 2.0. The law provided a legal safe harbor to good-faith web operators who followed a regimen of promptly taking down infringing works when made aware of them by copyright holders. On the other hand, copyright holders thought, the safe harbor would be denied to bad-faith operators who ignored what Congress called "red flags" -- signs that their sites had become havens of infringement.
But courts, by and large, haven't construed the law that way. Instead, they've found that the DMCA limits copyright holders, even when confronted with a business built on pervasive infringement, to futile, Whack-A-Mole notice-and-takedown remedies in which they must target each offending file, one at a time. Nothing in the DMCA prevents each file that's been removed from being restored five minutes later by another user. It's "a teaspoon solution to an ocean problem," as University of Chicago Law School professor Randal Picker once put it.
In 2010 copyright holders turned to Congress for relief. Recognizing that a frontal assault on the DMCA was, by then, politically out of the question, they focused instead on remedies against "foreign rogue sites" -- sites based outside the country, as most cyberlockers are, and "dedicated" to facilitating infringement. The foreign sites were a problem that the DMCA did not specifically address.
By then, it wasn't just copyright holders who were up in arms. American manufacturers were livid that their products were being massively counterfeited abroad and then sold to Americans on websites pretending to be legitimate distributors or discounters. Americans were led to the counterfeiters by search engines, like Google and Bing, which auctioned off the manufacturers' trademarks to the highest bidder as paid-search keywords.
"If the Internet is going to be a pillar of 21st-century society," says Rick Cotton, executive vice president and general counsel of NBC Universal and chairman of the Chamber of Commerce's Coalition Against Counterfeiting and Piracy, "it can't be a land without law. When one talks about freedom, one has to ask: 'Is lawless activity the same as freedom?' We've answered that question in the real world. I'm not free in the real world to reach across the table and punch you in the nose. Is there a right to operate unfettered a website regardless of whether it's lawless or not? Ultimately, I think there's only one answer to that question."
For two years Congress held discussions and public hearings on online piracy and counterfeiting, introducing, over time, three different bills. With each reworking, however, the bill got broader and potentially more dangerous, and the last one introduced, by the House Judiciary Committee in October 2011, was the now notorious Stop Online Piracy Act, or SOPA. Its most controversial provision -- based on a proposal made by AT&T (t) to the White House intellectual-property enforcement coordinator in March 2010 -- would have permitted the Justice Department to ask a federal judge to order Internet service providers like AT&T and Verizon (vz) to obstruct their users from reaching foreign infringing sites by means of a process known as domain-name-system (DNS) filtering. Other provisions would have required search engines to stop pointing to sites that a court had declared to be dedicated to infringement, and would have required payment processors, like PayPal, and ad networks, like Google's AdSense, to stop doing business with such sites. (Private copyright holders could also seek court orders, but only vis-à-vis payment processors and ad networks.)
At that point, a hive of technology companies, tech-supported nonprofits, tech-savvy individuals, and ordinary, concerned technology users (i.e., everybody else) sat up and took notice. Legitimate questions were raised about cybersecurity, efficacy, the First Amendment, and due process. Those were interlaced with histrionics and falsehoods. Bill sponsors suddenly found themselves being flamed mercilessly as "Internet killers" who were going to "break the Internet."
The House chairman introduced significant amendments and finally stripped out the DNS blocking provisions altogether. But the angry hive could not be appeased, and the spectacular SOPA "blackout" protest of Jan. 18 went forward anyway. The hive's networked power obliterated the old-fashioned, bipartisan legislative coalition, notwithstanding its support from such once-mighty interests as the Chamber of Commerce, the AFL-CIO, Hollywood, the recording industry, the publishing industry, and the combined ranks of all other copyright-dependent trades and guilds. Thousands of blogs and websites -- including Google, the globe's most visited site -- turned themselves into political billboards, petitions, and engines for inundating Congress with e-mails and phone calls. "Imagine a world without free knowledge," Wikipedia warned. Puzzled parents suddenly found themselves being asked by their frightened children, "Where do you stand on SOPA?" Bill sponsors dropped both versions and ran for the hills.
The hive did not exist when the Betamax case was decided a generation ago, nor even when the DMCA was passed in 1998. But those foundational legal rules of the road helped make the hive possible, and the hive was not about to let anyone tinker with them now.
"I'm sorry, Dave," the hive was telling us. "I'm afraid that's something I cannot allow to happen."
"In a world of bits," says Charles Nesson, a Harvard Law School professor and co-founder of the Berkman Center for Internet and Society at Harvard Law School, "copyright is a contaminant of a great many of them."
This isn't the way copyright law used to be taught.
"Think of cyberspace," Nesson continues, and "imagine the issue of freedom in that space -- your ability to use the bits without fear of litigation." Three kinds of bits fill this space, he explains. The first are "totally free" in that "you can use them without fear." The second are clearly copyrighted, he says, and you can buy the right to use those at, say, Amazon (amzn) or iTunes. "Then there's a contaminated, mid-bunch of bits," he continues. "You can't be sure you can use them for free, but you also can't figure out how to use them with any clear-cut permission. That's contamination rendering a whole part of the cyberworld out of bounds for free people."
For traditional copyright lawyers, the transformation of copyright law in the public's perception -- from noble curator of the springs of creativity to, as in professor Nesson's view, a "contaminant" that vexes the lives of free people -- has been dizzying.
By enabling the nearly costless distribution of perfect copies of music, books, and movies, digital technologies intensified a behavioral enigma that always lay at the heart of copyright law. These works are what economists call public goods. Once someone publicly sings a song, it's impossible to keep others from singing it, and the fact that they will won't prevent the songwriter from continuing to sing his song. Thomas Jefferson famously captured these intoxicating facets of public goods more memorably than anyone else: "He who receives an idea from me, receives instruction himself without lessening mine; as he who lights his taper at mine, receives light without darkening me."
The problem, which the framers of the Constitution recognized, was that if no one could own songs at all, there would be less incentive to create them. Accordingly, "to promote the progress of science" they gave Congress the power to secure "for limited times to authors ... the exclusive right to their ... writings."
In the 1970s and 1980s many people who went into the field of copyright thought of themselves as fighting to help authors, musicians, and artists -- and therefore as being on the side of the angels. By the 1990s, however, many who entered the field came from tech backgrounds and saw copyright as a constraint to progress. New technologies would benefit copyright holders once they adapted to them, these voices argued, but the entertainment industry was irrationally clinging to outdated business models -- which copyright law doesn't protect. The archetypal example was the Betamax itself. About a decade after the studios failed to kill the VCR in its cradle, their revenue from home video sales and rentals surpassed their box-office income.
In academia today, says Paul Goldstein, a copyright scholar at Stanford Law School, "those who favor free use outnumber by at least an order of magnitude, probably a couple orders of magnitude, those of us who take a more [protective] view."
The most influential proselytizer for a freer approach has been Harvard law professor Lawrence Lessig, who joined the Berkman Center in 1997 as its first faculty hire. In 2000 he moved to Stanford, where he founded Berkman's sister institution, the Center for Internet and Society at Stanford. In early 1999, Lessig filed a case challenging the constitutionality of a 1998 law that extended copyright terms by 20 years -- to life of the author plus 70 years in the case of individuals, or 95 years in the case of corporations. The bill was intended to harmonize U.S. laws with those of the European Community. Under a 1993 directive, Europe would honor U.S. copyright holders' rights only to the extent that the U.S. granted reciprocal protections to European copyright holders. Thus, if Congress failed to extend the U.S. copyright term, American rights holders would leave an enormous amount of money on the table.
The then Register of Copyrights, Marybeth Peters, was emotionally torn about the bill, she recalls in an interview, because it meant "freezing the public domain for 20 years." But in the end she endorsed it, persuaded by the argument that the U.S. was a large net exporter of copyrighted works and the extension would help America's balance of trade.
In his constitutional challenge, Lessig argued that the law represented the entertainment industry's greedy attempt to extend copyright terms perpetually, in violation of the "limited terms" language of the Constitution. There was no disputing that the period of protection had grown greatly since 1790, when the first Congress provided a term of just 14 years, renewable for another 14 years if the author survived the first term. A popular notion also arose among opponents of the extension that the law had been rammed through Congress by the Disney Co. (dis) in an attempt to keep its exclusive rights to the character Mickey Mouse, whose first movie, Steamboat Willie, made in 1928, would have come off copyright in 2003 but for the extension. (Disney fought for the extension, but its officers have denied that Mickey Mouse was the motivation, and some scholars say the contention never made sense. "Mickey is protected in perpetuity by trademark law," says Stanford's Goldstein. "It wasn't that.")
Though Lessig's argument lost before every judicial tribunal that heard it -- including the Supreme Court in 2003, by a 7-2 vote -- it was a thundering success in the court of public opinion.
"The attack on copyright term extension was a turning point," says Goldstein. "Copyright was demonized in a way that it had not been before. It was hard to find a car in Silicon Valley that didn't have a bumper sticker that read FREE MICKEY. I think it's really unfortunate."
For proponents of freer access, the bloated term of copyright became Exhibit A in proving that copyright law had been hijacked by greedy Hollywood executives, to the detriment of the public's interest in free access. These advocates maintained that they were advancing a more balanced view of copyright, and they labeled those who disagreed with them copyright "absolutists," "extremists," or "maximalists."
Yet for copyrighted works posted online -- increasingly the only medium that mattered -- the theoretical term of copyright was a cruel joke. Due to rampant piracy, there was no term of copyright online. Even if copyright terms were pared back to what they'd been in George Washington's time, filmmakers and authors and songwriters would still be getting robbed. (For more on this, see One filmmaker's fight against the cyberlockers)
Odder still, the proponents of "balanced" copyright seemed to oppose any form of copyright enforcement whatever undertaken to protect online works. Julie Samuels, a staff attorney at the Electronic Frontier Foundation, acknowledges in an interview that it is hard for her to give an example of a situation in which she would favor enforcement of copyrights online. "I don't think [content] companies need to protect themselves," she says. "They're better off working to offer new business models that will allow consumers to get content efficiently -- what they want when they want it. People are willing to pay. Look at iTunes, Spotify, and Netflix."
The balanced copyright message is espoused in absolute good faith by countless public-spirited individuals. Yet it's also a message that strikes a chord with people who simply want to download music and movies for free, as well as with tech companies that want to sell those people devices to do it. "Infringers have long found eloquent, if somewhat cynical, ways to justify piracy in the name of progress," Columbia Law School professor Jane Ginsburg has written.
Megaupload founder Kim Dotcom, 38, is no Shawn Fanning. Unlike the 18-year-old naif who founded Napster for fun, Dotcom is a bon-vivant former playboy with a criminal record. He received $42 million from his Megaupload operations in 2010 alone, according to the indictment.
The burly, baby-faced, 6-foot-6 amateur racecar driver and champion Modern Warfare 3 player was convicted in Germany of computer hacking offenses in 1998, insider trading in 2002, and embezzlement in 2003.
In 2005 he founded Megaupload. He set it up in Hong Kong, though Dotcom is a dual citizen of Germany and Finland and a permanent resident of New Zealand. When arrested on Jan. 19, he was living at a leased $24 million estate (with a domestic staff of 50) near Auckland, New Zealand, and he owned a nearby $3.3 million mansion too.
The U.S. government is now seeking forfeiture of both homes; about $67 million seized from Dotcom's, his co-defendants', and his company's bank accounts; an assortment of jewelry, artwork, and Jet Skis; and at least 25 of his automobiles, including a Rolls-Royce, a Lamborghini, a Maserati, two vintage Cadillacs, and 16 Mercedeses. The vanity plates on three of the cars read GUILTY, EVIL, and GOD.
Have these facts engendered any sense of public outrage?
Oh, yes. Against the prosecutors.
The Electronic Frontier Foundation has filed papers criticizing the government for having, through its shutdown of the site, deprived innocent third parties of access to their files. It also suggests that the seizure violated the First Amendment: "The government here has seized an entire business devoted to publishing," it writes, "and effectively suppressed all of the expressive content hosted on it."
It's made those arguments even though Megaupload always disavowed any responsibility for users' lost files. In fact, unless users bought its premium service, Megaupload permanently deleted any file that went 90 days without being downloaded by someone -- or just 21 days for unregistered users.
Anthony Falzone, who heads the Stanford Center for Internet and Society's Fair Use Project, also has many concerns about the prosecution. "The government's indictment is not just pushing the existing boundaries of copyright law on the civil liability side, but morphing it into criminal liability in some pretty aggressive ways," he says in an interview. He cites the fact that secondary infringement -- inducing infringement by others, which is the main charge against Megaupload -- is a judge-made concept, and "there's a big question whether violation of judge-made civil law can support criminal liability."
Falzone also believes Megaupload might be protected by the DMCA: "From what I can tell, it looks like Megaupload did what it was supposed to do in terms of notice and takedown."
Megaupload's DMCA compliance will lie at the heart of its defense. In late February, after Dotcom was released on bail, he gave a televised interview to John Campbell on New Zealand's Campbell Live. Dotcom explained, "We have spent millions of dollars on legal advice over the last few years, and our legal advisers have always told us that we are secure -- that we are protected by the DMCA." (Dotcom is not represented just by attorney Rothken. Since April the top-flight litigation firm of Quinn Emanuel Urquhart & Sullivan -- which is also Google's preferred outside copyright counsel -- has been representing him too. At the time of Dotcom's arrest, he was being represented by Bob Bennett, who was President Bill Clinton's lawyer in the Paula Jones case, though Bennett has since withdrawn.)
Whether Megaupload really did comply with the DMCA is sharply contested. To qualify for the DMCA's safe harbor, Internet companies must terminate users who are repeat infringers, and the government says Megaupload didn't. According to the indictment, for instance, it failed to terminate the account of one user despite repeated requests from a movie studio, including 85 takedown notices relating to 57 feature films that were being posted on at least 200 publicly available links.
In any case, those questions may be moot because it's not clear that the unusual crime charged -- aiding and abetting criminal copyright infringement -- is even extraditable under New Zealand's treaty with the U.S. As Falzone says, charging "secondary copyright infringement" as a crime is unprecedented in the U.S. and appears to be so in New Zealand too. As a consequence, the outcome of Dotcom's extradition hearing, now scheduled for August, is anyone's guess.
In January, when he was explaining to Fortune why the Coalition Against Counterfeiting and Piracy supported the bills that would have empowered American companies to attack foreign rogue sites on a sitewide basis, as opposed to a file-by-file basis, its chairman, Rick Cotton of NBC Universal, offered this hypothetical: "In the real world, suppose Macy's opens up a department in its store, which it calls Stolen Goods," he said. "For them to say, 'Well, that's only 50% of our business. Fifty percent is completely legal' -- well, that's laughable. You're not allowed to commit crimes."
Yet under the Betamax ruling and the DMCA, Cotton's hypothetical actually understates the outlandishness of the situation online today. Even assuming that 90% of the activity on Megaupload was illegal, many top-flight lawyers and probably most law professors would insist that there's nothing anybody could or should have done beyond filing another pointless DMCA notice.
Which brings us, in a way, to Jack Valenti, the late former head of the Motion Picture Association of America. Notwithstanding Valenti's death five years ago, copyright's critics still invoke him frequently, often because of a notoriously foolish statement he made before Congress in 1982. "The VCR is to the American film producer," he said, "as the Boston Strangler is to the woman home alone." This is a favorite laugh line for copyright's skeptics.
And, yes, Valenti couldn't have been more wrong about the Betamax device.
But if he'd been talking about the Betamax ruling, on the other hand, and the unlikely place to which it would lead us 30 years later, he'd have nailed it.
*Fortune's publisher, Time Inc., is owned by Time Warner (twx), which is composed largely of copyright-based businesses.
This story is from the July 23, 2012 issue of Fortune.