In real life, if there was a masked vigilante whose codename is ‘Watcher,’ he’s a non-lethal masked vigilante who is a witness to a murder. The detectives and prosecutor want to put the vigilante on the witness stand, but the vigilante’s secret identity is, well, secret, and he doesn’t want to reveal it. Can he still testify with his mask on or testify anonymously?


I asked a lawyer this once. After he was done laughing, the gist was that the limits of anonymity for witnesses is damn near zero. There’s circumstances where a witness might be given some cover if they’re minors, adults just don’t get that. That’s the US though, there are places where secret or anonymous testimony is used.
Now, the conversation did include some hypotheticals. He said there could be some arguments akin to what some vulnerable populations occasionally get, or when a witness is in immediate and provable danger. Anonymous testimony as a last resort is possible, just so rarely given as to be laughable in his opinion.
The big factor in why it wouldn’t work for a vigilante is that even when anonymous testimony is allowed, it’s really only anonymous to the courtroom. The judge would have to know who it was, and likely multiple people involved in the process of trying to get the judge to go along with it.
Even then, a U.S. based prosecutor would be desperate to even consider trying in the first place. Anonymous testimony would be easy to counter, and there would be a ton of ways to counter the attempt in the first place.
What I was told is that it would be career suicide to try and fail. And the chances of success for an adult vigilante are essentially zero when the difficulty of making it happen under very rare circumstances for kids or known adults is already difficult.
There would need to be legislation in place for it to happen in the real world in most countries. I did a quick search on other places, and it’s still rare even in places where secret testimony is less rare than the US. Even those places, the identity is known to the state.