This can be done and it's called a zero knowledge proof (ZKP) in cryptography. And it's starting to be used in crypto wallets to verify humanity.
Why can’t this be used everywhere we are being asked to validate our age like adult websites/discord/etc?
As I recall it seemed to be just one guy, David Chaum, who did so much to show how so many of these things could work, but the rest of us have somehow managed to do very little with his ideas. What are we missing?
Of course there's always been ways to do this ethically. But the ones up top don't make money from that. And they can spend billions convincing people the only way it works is with whatever makes them money.