A hidden website operated by a San Francisco man using an alias from “The Princess Bride” became a vast black market bazaar that brokered more than $1 billion in transactions for illegal drugs and services, according to court papers made public on Wednesday in New York.

A criminal complaint in New York charged the alleged mastermind, Ross William Ulbricht, with narcotics trafficking, computer hacking and money laundering. A separate indictment in Maryland also 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 “Cannibus,” ”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 protected users with an encryption technique called “onion routing,” which is designed to make it “practically impossible to physically locate the computers hosting or accessing websites on the network,” court papers said.

Federal authorities shut the site down and arrested Ulbricht on Tuesday afternoon in a branch of San Francisco’s public library. Ulbricht was online on his personal laptop chatting with a cooperating witness about Silk Road when FBI agents from New York and San Francisco took him into custody, authorities said.

Ulbricht, 29, made an initial appearance in a San Francisco court on Wednesday, authorities said. A bail hearing was set for Friday.

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

The defendant announced in a website forum in 2012 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 also 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 ATM machines. 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 around the globe, the court papers said. The site generated an estimated $1.2 billion since it started in 2011 and collected $80 million by charging 8 to 15 percent commission on each sale, they 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 intercepted a package from Canada as part of a routine search 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.”