A judge last week dismissed and sealed the case against a group of young Manhattan men accused of trying to steal a pal’s bitcoin stash after a night of partying.

Prosecutors asked a Manhattan Criminal Court judge to drop the raps against Stephen Orso, 25, David Leica, 19, Steven Dorn, 29, and Chris David, 25, for the Sept. 7 incident.

Each of the defendants had been charged with one count of second-degree robbery, but the Manhattan District Attorney’s Office couldn’t corroborate the story of alleged victim Nicholas Truglia.

It turns out that the real thief might be Truglia, who was arrested by California authorities just one month after fingering his pals. Santa Clara prosecutors say that he tried to loot the cryptocurrency accounts of a series of Silicon Valley bigwigs.

Truglia, 21, had called the cops on his pals, claiming they beat him up and ransacked his apartment to swipe a thumb drive containing his cryptocurrency account information.

But a lawyer for the four young men says that he made up the allegations to detract from his own crimes.

“These charges and allegations are totally false,” said attorney Stacey Richman. “They made sure he got home safely despite how intoxicated he was, and he turns around and accuses them of this to cover up his own misdeeds.”

Truglia was extradited to Santa Clara, where he’s charged with looting $1 million from one victim and targeting several others.

He allegedly pulled off the heist from the comfort of his luxury Times Square high-rise, using a scheme called SIM swapping.

He got cellphone customer service representatives to port his victim’s phone numbers to a number he controlled, giving him access to the device and locking out the owners.

Truglia’s California case is still pending. His lawyer couldn’t immediately be reached for comment.