Coinbase Inc. customers who haven’t reported their cryptocurrency gains to the Internal Revenue Service, beware.

A federal judge is poised to allow a limited investigation into those gains to proceed over the company’s objection that the agency is on “a massive fishing expedition” meant to make itself look tough in the eyes of its critics in Congress.

"It’s legitimate for them to investigate whether people are making money on their bitcoin purchases" and paying taxes on any gains, U.S. Magistrate Judge Jacqueline Scott Corley in San Francisco told lawyers for Coinbase at a hearing Thursday. "I have to give tremendous discretion to the agency as to how they investigate," she added later.

Bloomberg News

Corley indicated she will allow the IRS to investigate Coinbase customers who made money on the currency and bar the agency from probing accounts of those who hadn’t. The judge also said she’ll probably give Coinbase time to appeal her decision before it turns over any customer information. The price of bitcoin fell as much as 1 percent on the news.

The company has been sparring since last year with the IRS over its summons — and continued to resist turning over the information even after the agency scaled back its request in July. Coinbase and industry trade groups contend the government’s concerns about tax fraud are unfounded and that its sweeping demand for information is a threat to privacy.

"U.S. taxpayers, including Coinbase users, have made use of virtual currencies to avoid the reporting and payment of taxes," the IRS argued in a court filing. The agency said it needs access to customer records to “gain some degree of visibility into a space where it is already necessarily moving about somewhat in the dark."

Mike Lempres, the chief legal and risk officer for Coinbase, said after the hearing that the company can’t negotiate with the IRS about a "forward-looking, rational reporting system" so long as the agency is suing it.

Such discussions aren’t possible "because we’re in this tussle with them where they are improperly searching for private information of our customers with no evidence of wrongdoing," Lempres said. He declined to comment on Corley’s pending ruling before the company has seen a final order in writing.

The IRS persuaded Corley last year to order Coinbase to approve its summons for customer records from 2013 to 2015 for an investigation into whether taxpayers failed to report income. Coinbase resisted, and negotiations between the company and the agency resulted in a narrowed request for information about 8.9 million transactions and 14,355 account holders. Coinbase argued Thursday the inquiry remains unreasonably broad.

The case is U.S. v. Coinbase, 17-01431, U.S. District Court, Northern District of California (San Francisco).

Bloomberg News