As the the trial of alleged Silk Road mastermind Ross Ulbricht unfolds, its transcript has read like a manual of things not to do when running a secret, billion-dollar online drug conspiracy. But on Thursday, the jury heard about the most human of all the human errors Ulbricht may have made: confessing his creation to an in-real-life friend.

In a Manhattan courtroom Thursday, Austin, Texas-based eBay software engineer Richard Bates took the stand to testify against Ulbricht, his college friend and one-time programming partner. From late 2010 until at least 2011, Bates says he gave Ulbricht coding advice on a project Ulbricht described as "top secret." And when Bates ultimately refused to offer any more assistance unless Ulbricht shared the details of that project, he says that Ulbricht showed him the Silk Road for the first time on a laptop in Bates' home.

"I told him, tell me about this or leave me out of it," said Bates, a pale programmer with slicked-back hair and black-rimmed glasses who wore a worried grimace during his entire questioning by the prosecution. "He told me about it."

By November of 2011, Bates testified, Ulbricht would tell him that he had sold the Silk Road and was no longer involved. But the prosecution also showed a chat log from the next month pulled from Ulbricht's computer in which Ulbricht seems to tell an associate involved in the Silk Road that he lied to two people about selling off the site and in fact still maintained control of it.

According to Bates, Ulbricht's initial confession in early 2011 had revealed that he was working on a "website where people can buy drugs." Using a neighbor's open Wi-Fi to assuage Bates' concerns about surveillance, he showed Bates the site. "I remember seeing the home page, the green camel [of the Silk Road logo] for the first time, and pictures of drugs," Bates said in response to questions from prosecutor Timothy Howard. "I was shocked and very intrigued. I didn't know how something like this could be possible."

Despite all the evidence piled against Ulbricht—which includes screenshots of his seized laptop taken from him while he was logged into the Silk Road's "mastermind" page and a journal on that PC documenting his thoughts and activities allegedly running the site—Bates' testimony could be particularly damning.

The defense, after all, has argued that Ulbricht created the Silk Road only as an "economic experiment" before giving it up to the real operators of the site who would expand it into a narcotics empire and then later frame Ulbricht. Bates' story captures Ulbricht's intention to sell drugs, specifically, and also indicates Ulbricht ran the site longer than the few months his attorneys have claimed.

In fact, Bates wasn't the only one of Ulbricht's contacts who knew about his involvement in the Silk Road, Bates told the court. So did Ulbricht's girlfriend "Julia" and a third person Julia had told. Bates himself says he also "tried" to tell a friend about his involvement in the Silk Road, but wasn't sure if she had gotten the message. "I tried to confide in a friend of mine," Bates said. "I don't think it was communicated across. We were both drunk."

Bates told the jury that he had first met Ulbricht during their time together as undergraduate students at the University of Texas at Dallas. They once went on a spring break trip together, according to Bates. In 2010, they reconnected when Bates moved to Austin, where Ulbricht lived at the time, and went cliff-jumping a few weeks later. By late 2010, Bates says, they saw one another on a weekly basis.

Around that time, Ulbricht began to ask Bates "very frequent" questions about PHP and server administration, often over Google chat, Bates said. But when Bates asked about the nature of Ulbricht's project, Ulbricht refused to say more. Eventually Bates wrote to Ulbricht, "I'm officially forbidding you from mentioning your secret project to me again unless you're going to reveal it." Soon after that, Ulbricht revealed his secret, Bates said.

Despite his initial shock, Bates said he continued to advise Ulbricht on his Silk Road programming problems, helping him in March of 2011, for instance, to deal with a major site outage. The two would later work together on plans for a bitcoin exchange, Bates confirmed in response to prosecutor Howard's questions. And Bates also used the Silk Road to buy drugs under the pseudonym "melee", listing marijuana, ecstasy, psychedelic mushrooms, Vicodin and antibiotics among those he'd purchased. He also told the jury that Ulbricht had personally given him a bag of psychedelic mushrooms he'd grown and stored in a large black trash bag, offering more evidence that Ulbricht had sold his own homemade mushrooms as the first product on the Silk Road.

At one point in 2011, Bates says that Ulbricht offered him a position as an administrator of Silk Road. But Bates turned him down, telling him he already had a job. The two planned to create a bitcoin exchange that could potentially be used "to launder money," splitting the profits 60/40 in Ulbricht's favor. But Bates says he was busy with his job and never signed the contract that Ulbricht created to seal their partnership. Asked how much Ulbricht paid him for his help on the Silk Road, Bates answered, "Nothing but his friendship."

Over time, Ulbricht seems to have grown increasingly concerned that Bates might reveal him, according to Bates' telling. The prosecution showed the jury the following chat from June of 2011:

Ulbricht: You gotta keep my secret, buddy

Bates: I haven't told anyone and I don't intend to

Ulbricht: I know I can trust you

Then in November of that year, Bates says, Ulbricht came to his home in a panic: Someone had written on his Facebook page, "I'm sure the authorities would be very interested in your drug-running site." Ulbricht had quickly deleted the post and unfriended the person who wrote it.

At the time, Bates said he warned Ulbricht to shut down the Silk Road. "This is not worth going to prison for," Bates recalls telling Ulbricht. But Bates said that Ulbricht answered that he "couldn't shut it down because he'd already sold it to someone else."

"Did you believe him?" asked prosecutor Howard.

"I did," responded Bates.

After Bates was dismissed from the court later in the day, however, prosecutor Howard showed the jury a chat log pulled from Ulbricht's laptop in December of 2011. In the chat, Ulbricht's friend and advisor known by the name "Variety Jones" tells him that he needs to cover his tracks, suggesting for the first time that Ulbricht adopt the Dread Pirate Roberts pseudonym.

"[In real life,] is there anyone with a clue at all?" Variety Jones asks Ulbricht.

"There are two, but they think I sold the site and got out a month ago," Ulbricht responds. "One I'll probably never speak to again and the other I'll drift away from."

"Clear your old trail," Variety Jones tells Ulbricht. "You are the weak link from those two prev contacts."

When Ulbricht was arrested in October 2013, Bates said he was visited by FBI agents. He testified that he initially lied to them about his involvement in the Silk Road, the aborted bitcoin exchange and his drug purchases before confessing. He eventually agreed to serve as a witness against Ulbricht to avoid prosecution.

As Bates testified, Ulbricht stared straight ahead, offering no hint of his facial expressions to the press gallery.

In cross examination by Ulbricht's defense, Ulbricht's attorney Joshua Dratel emphasized to the jury that Bates had agreed to testify against Ulbricht to avoid facing his own legal consequences. "I knew I could go to prison for a very long time," Bates admitted.

"You chose to be there, on the witness stand, rather than there, as a defendant?" Dratel asked, pointing to Ulbricht.

At that point, the prosecution objected and the judge sustained the objection. Bates didn't answer the question.