Serra grew up in a working-class family near San Francisco’s Ocean Beach. After playing football as an undergraduate at Stanford, he tried to become an expat writer in Morocco, but at that point he had never smoked a cigarette and was put off by the heroin and the opium. He returned to San Francisco, discovered the Haight and took a vow of poverty. He graduated from law school at U.C. Berkeley in 1961 and has worked almost exclusively pro bono since. Among Serra’s many strong beliefs is that nostalgia is a scourge — ‘‘the first sign of death,’’ he says. Still, it bears noting that one of the biggest cases of his early career also involved Chinatown. Serra exonerated, in a retrial, a Korean-American man convicted of the 1973 murder of a Chinatown gang leader. That case formed the basis of the 1989 movie ‘‘True Believer,’’ with James Woods starring as a character modeled on Serra.

Serra himself has served two prison terms, as a tax resister — four months in 1974 and 10 months in 2005. He would be happy to serve a third, should anyone care to arrest him. He loves life on the inside — ‘‘It’s like locking a doctor who likes to practice medicine in a hospital,’’ he once said. Less felicitous, to Serra, is contemporary, gilded San Francisco. (‘‘Look out the window! Do you see the common man?’’) Serra has no bank account, no credit card and no cellphone. ‘‘My DNA is nonmaterialistic,’’ he explained. He abhors what he perceives as the extravagance of American law enforcement after Sept. 11: As part of the sting, F.B.I. informants ate meals with Shrimp Boy at the Four Seasons, the Fairmont and the Ritz, according to a co-defendant’s filing.

A few weeks after Shrimp Boy’s arrest last March, Serra held a news conference. ‘‘These undercover agents sought to induce him, sought to involve him, sought to catch him in some overt act that represented criminal activity,’’ Serra told the journalists and friends of Shrimp Boy — many of whom were wearing ‘‘Free Shrimp Boy’’ T-shirts. ‘‘My client’s not a gangster.’’ The F.B.I., he said, ‘‘didn’t stop, you know, abort criminal activity that my client participated in.’’ Serra pointed to a picture of Shrimp Boy, who is 5-foot-4, nearly wrinkle-free and almost always smiling. ‘‘You saw a person,’’ Serra continued, ‘‘who is wholly dedicated to the Chinese culture. To love. Education. We represent an exemplary human being.’’ He paused to clarify for those familiar with the Shrimp Boy of the 1970s, ’80s and ’90s, a man who was convicted of racketeering, drug trafficking, arson, armed robbery and attempted murder. ‘‘I’m not talking before he went to prison,’’ Serra said. ‘‘I’m talking after he got out.’’

In Shrimp Boy’s pretrial defense, Serra, along with his co-counsel, Curtis Briggs, a former small-time criminal, has employed a legal strategy right out of the Merry Prankster handbook: Stand out, be aggressive and fight authority every step of the way. Serra, Briggs and other members of the team have accused the F.B.I. of racial profiling — setting a dragnet over Chinatown to catch Chinese people breaking the law. They have also demanded that Shrimp Boy’s case be dismissed on the grounds of selective prosecution: They argued in a motion that the same series of wiretaps that led to Shrimp Boy’s indictment also revealed that Mayor Ed Lee of San Francisco laundered campaign money. (The mayor’s office did not return calls and emails but has publicly denied this.) Judge Breyer ruled against the motion, but the local press ran with the story, which was largely the point.

Serra is cynical about many things. He believes that ‘‘law is class struggle.’’ He believes that judges ‘‘are not referees, they are bullies,’’ and that they make decisions ‘‘based on their own moral perspective.’’ But Serra still believes in juries, believes they are ‘‘the last avenue to the common mentality, and there is something beautiful in the American mentality.’’ He sincerely believes that a jury will hear Shrimp Boy’s story and let him go. ‘‘We have a person who did have an epiphany,’’ he said about Shrimp Boy’s decision to go straight and live a normal life, a person who didn’t succumb to the government’s yearslong campaign to lure him back into crime.

The prosecution, on the other hand, argues that Shrimp Boy was employing a classic strategy: ‘‘He did not have to get his hands dirty committing crimes and could insulate himself — although he did it poorly in the end — from the crimes being committed around him,’’ the government wrote in a filing. ‘‘The jury should be permitted to understand that Chow’s techniques were taught to him by his prior dai los.’’ (Dai lo is the Cantonese term for big brother, or mob boss.) Still, Serra is confident. To win this case, and any case, he said, ‘‘You have to show you have the moral high ground — that you have transcended the conflict as defined by the prosecution.’’ He paused, then added: ‘‘I have the Buddha here.’’