Some worthwhile reading on the topic if you're interested:
https://en.wikipedia.org/wiki/Zero-knowledge_proof#Zero-Know...
https://en.wikipedia.org/wiki/Blind_signature
It should even possible to construct a protocol where you can prove that you're over 18 without revealing your birthdate.
Zero-Knowledge Range Proofs: https://eprint.iacr.org/2024/430
"Zero-knowledge range proofs (ZKRPs) allow a prover to convince a verifier that a secret value lies in a given interval."