Updated

FBI agents found the mastermind behind a black market online bazaar, called the Silk Road, in the science fiction section of a small branch of the San Francisco public library, chatting online.

A hidden website operated by a San Francisco man using an alias from "The Princess Bride" became a vast online black market with more than $1 billion in transactions for illegal drugs and services, according to court papers made public Wednesday.

A criminal complaint in New York accused Ross William Ulbricht of being the mastermind and charged him with narcotics trafficking, computer hacking and money laundering. A separate indictment in Maryland accused him in a failed murder-for-hire scheme.

The website, Silk Road, allowed users to anonymously browse through nearly 13,000 listings under categories like "Cannabis," ''Psychedelics" and "Stimulants" before making purchases using the electronic currency Bitcoin. One listing for heroin promised buyers "all rock, no powder, vacuum sealed and stealth shipping," and had a community forum below where one person commented, "Quality is superb."

The website, whose other categories included "Erotica" and "Fireworks," protected users with an encryption technique called onion routing, designed to make it "practically impossible to physically locate the computers hosting or accessing websites on the network," court papers said.

More On This...

Michelle Jeffers, a spokeswoman of the library system where Ulbricht was arrested, said she was told by staffers that on Tuesday afternoon they heard a loud commotion in the science fiction section of the library and saw a young man, who appeared to offer no resistance, pushed up against a floor-to-ceiling window by plainclothes FBI agents as they handcuffed him.

Ulbricht, 29, made an initial appearance in a San Francisco court on Wednesday, authorities said. A bail hearing was set for Friday. There was no immediate response to messages left with Ulbricht's attorney.

A criminal complaint said Ulbricht "has controlled and overseen all aspects of Silk Road."

He announced in a website forum last year that to avoid confusion he needed to change his Silk Road username, court papers said. He wrote, "drum roll please ... my new name is: Dread Pirate Roberts," an apparent reference to a swashbuckling character in "The Princess Bride," the 1987 comedy film based on a novel of the same name.

The court papers cite a LinkedIn profile that says Ulbricht graduated from the University of Texas with a physics degree and attended graduate school in Pennsylvania. It says he has focused on "creating economic simulation" designed to "give people a firsthand experience of what it would be like to live in a world without the systematic use of force."

Along with drugs, the website offered various illegal services, including one vendor who offered to hack into Facebook, Twitter and other social networking accounts and another selling tutorials on how to hack into ATMs. Under the "Forgeries" category, sellers advertised forged driver's licenses, passports, Social Security cards and other documents.

As of July, there were nearly 1 million registered users of the site from the United States, Germany, Russia, Australia and elsewhere, the court papers said. The site generated an estimated $1.2 billion since it started in 2011 and collected $80 million by charging 8 percent to 15 percent commission on each sale, it said.

Undercover agents in New York made more than 100 purchases of LSD, Ecstasy, heroin and other drugs offered on the site, the papers said.

In July, customs agents as part of a routine search intercepted a package from Canada that contained counterfeit identifications, all with Ulbricht's photo, the papers said. When confronted by agents at a San Francisco address where he was renting a room for $1,000 a month, he "generally refused to answer questions ... however volunteered that 'hypothetically' anyone could go onto a website named Silk Road and purchase any drugs or fake identity documents the person wanted."

The Maryland indictment alleges Ulbricht told an undercover investigator posing as a drug dealer this year he would pay the undercover to "beat up" a former employee he believed had stolen money from Silk Road. Later, it said, he wrote to ask whether he could "change the order to execute rather than torture" and agreed to make two payments of $40,000 each to get the job done.

The New York complaint cites messages from Ulbricht it says showed he plotted to kill another person who was trying to extort him.

Based on reporting by the Associated Press.

Follow us on twitter.com/foxnewslatino
Like us at facebook.com/foxnewslatino