GOOGLE BOOKS is a dream project — a vast online database of millions of books from libraries and publishers worldwide. It would be a library and a bookstore, a compendium of everything written.

But from the start it has raised difficult questions about who should profit. If every book ever written could be found online, readers and researchers would benefit. But what about authors and publishers or, as they are known these days, “content creators”? What part should they play?

Trying to answer that question, Google engaged in long negotiations with organizations representing authors and publishers and arrived at a settlement that provided a sensible way of sharing revenue. The difficulty, though, was that neither Google nor those organizations could speak for all authors. Partly for that reason, the settlement, and the Google plan, were rejected last week by Judge Denny Chin of the U.S. Court of Appeals for the 2nd Circuit — and rightly so, in our view.

At the heart of the problem was the question of orphan works — out-of-print books still protected by copyright for which the holders cannot be found. Google already has the right to scan books for which the copyright has expired, and books in print are easily bought online. So the orphan works, even if relatively few, are both crucial to the project and vexing in terms of rights and wrongs.

Google’s solution was to claim the right to scan any work unless the rights holders objected — unless they opted out, in other words. The logic was that an opt-in strategy was impractical — and that, if such “orphaned” works turned out to have value, this would inspire copyright holders to come forward.

This may well be a practical solution, but the issue should not be Google’s to decide. As the lawfully elected representatives of rights holders and readers, Congress is best positioned to determine how copyright should apply in this case.

An essential piece of any such solution is a body, similar to the recording industry’s ASCAP, that would be able to search for rights holders, disperse funds and oversee collective licensing of copyrighted works. This is an accepted strategy for exactly such situations, where an opt-in approach would be prohibitively onerous.

The objection to the Google Books settlement has never been to the prospect of a digital library. National libraries of other countries, and libraries and nonprofits in the United States, have their own efforts underway to digitize their collections; and Google may yet end up with the best approach. There is no question that such a database is worth having, but it is worth having fairly, legally and with consent.