This frame grab from the Silk Road website shows thumbnails for a product allegedly available through the site. On Tuesday, Oct. 1, 2013, FBI agents arrested Ross William Ulbricht, who is accused of operating the secret website, which is believed to have brokered more than $1 billion in transactions for illegal drugs and services. (AP Photo/silkroaddrugs.org)

This frame grab from the Silk Road website shows thumbnails for a product allegedly available through the site. On Tuesday, Oct. 1, 2013, FBI agents arrested Ross William Ulbricht, who is accused of operating

This frame grab from the Silk Road website shows thumbnails for products allegedly available through the site. On Tuesday, Oct. 1, 2013, FBI agents arrested Ross William Ulbricht, who is accused of operating the secret website, which is believed to have brokered more than $1 billion in transactions for illegal drugs and services. (AP Photo/silkroaddrugs.org)

This frame grab from the Silk Road website shows thumbnails for products allegedly available through the site. On Tuesday, Oct. 1, 2013, FBI agents arrested Ross William Ulbricht, who is accused of operating

SAN FRANCISCO (AP) -- A bail hearing is scheduled Friday for Ross William Ulbricht, the San Francisco man known online as Dread Pirate Roberts who the FBI says operated a vast black market website that was believed to have brokered more than $1 billion in revenue.

Ulbricht has been charged in New York as the mastermind of Silk Road, an encrypted website where users could shop for drugs like heroin and LSD anonymously. He is also charged in Maryland with arranging to pay someone to kill a witness.

Agents arrested the 29-year-old Tuesday in the science fiction section of a small branch of the San Francisco public library, where he was chatting online.

He will appear in a San Francisco federal courtroom to discuss bail and his transfer to New York, where most of the charges have been filed.

Ulbricht's arrest comes after a yearslong federal investigation that began in 2011. Agents determined Ulbricht was "altoid," someone who was posting information about Silk Road on other drug-related websites that were under federal surveillance.

Since then, Ulbricht's online behavior has been tracked, and agents slowly gathered evidence connecting him to Silk Road.

Court documents show that Ulbricht's final mistake was ordering fake identification documents from a Silk Road vendor in Canada that were intercepted at the border by U.S. Customs.