@anildash there is a LOT of work going on on this space, some of it based upon zero knowledge proofs, some of it snake oil. See eg iso mdocs, verifiable credentials (now happening at both W3C and ietf in different flavors), “trust exchanges” etc.
My state’s drivers license allows you to do roughly what you want; phone app shows a QR code that’s only good for two minutes, with selective disclosure of identity or age. I did a FOI for their privacy impact statement; frustratingly redacted.