You have just described IRMA (I Reveal My Attributes) which is an experimental non-profit implementation of a subset of Idemix, a type of ABC (attribute-based credentials) system:
https://privacybydesign.foundation/irma-en/
https://privacybydesign.foundation/irma-explanation/
https://petsymposium.org/2017/papers/hotpets/irma-hotpets.pd...
edit: links