But, I think Apple already does this. https://developer.apple.com/wallet/get-started-with-verify-w...
"Information about past presentments — including where, when, and what personal information you share — is encrypted and stored only on your device. Neither the state issuing authority nor Apple can see your presentment history."
An simplified example could be that I ask the third-party to sign a package that include my current IP address, a message that say "I am over 18", and a validity period. They sign it (after I identify myself to the third-party), and give me the requested signature. I then give this to the website and the website can verify the signature of the third-party. The website only know my IP address, the time, and what third-party service I use to verify my age. Third-party only know my ip address, the time, and that I requested a token for "I am over 18".
A major drawback occur if this is only used for porn. In that case, the message "I am over 18" will be synonymous with porn use and thus giving the third-party information that they should not have.
Adult streaming sites have the "are you 18 years of age?" pop-up. As far as those managing the sites are concerned that should be enough.
The problem is, every data provider has to get on board first. For instance, the city you live in can verify if you're over eighteen. If their IT can handle setting the bit 'over eighteen' in the IRMA app, you can securely and verifiably show this bit of information, and only this piece of information, to the party asking to verify this information. They have to support IRMA too though.
But even then, if I'm under age and just borrow your phone...
Technology does not solve people problems. It only makes them worse/creates new ones in the process of (generally poorly) trying to partially solve them.
This is a people problem.
Sometimes, the only winning move is not to play.