This is already possible with the German ID card (nPA). It can also verify if you are over a certain age without giving out your data. You also cannot read the nPA without a PIN code. It even includes a pseudonymity function where every service you authenticate with receives a different pseudonym so tracking isn't (easily) possible.