A better one is Chaum's Ecash protocol: https://en.wikipedia.org/wiki/Ecash
To use a metaphor for that protocol:
1) The gambling site gives you a piece of with a UID on it.
2) You put the paper in a opaque envelope. (This is a cryptographic way of hiding the contents)
3) You take the envelope to the bank (or DMV, police station, etc) along with a copy of your birth certificate/RealID and they emboss it with their stamp saying you are over 18. The embossing is transferred through the envelop to the paper, but the bank hasn't seen the contents of that paper. (This is a cryptographic signing method which can affect the UID in step 2 without the bank needing to see the UID: https://en.wikipedia.org/wiki/Blind_signature)
4) You take the paper out of the envelope and destroy the envelope. The paper with the UID has the stamp but doesn't have any tracking information that the bank might have put on it.
5) You give the UID to the gambling site. They see that you got it stamped by the bank so they know you have an account with the bank and are over 18, but they don't know the RealID that the bank saw when the bank stamped the envelope.
This is secure because the bank never saw the UID so they don't know if it was gambling-123 or disney-123. The gambling site can save that stamped UID and give it to the bank (or government) if required, but bank can't figure who came in to get that UID embossed. The only person who knows all the tracking information is the user. And as long as they burn the envelope (which is cryptographically secure), there is no usable tracking information.As long as the bank is Good and uses the same stamp for all users (i.e, they don't use alice-stamp, and bob-stamp, etc for different users), there is no way for anyone to connect that Alice got her gambling-123 UID stamped. But this stamp is normally using PKI so anyone can check the public key of the stamp.
This algorithm was originally conceived to create anonymous "cash" since the bank would charge $1 to stamp your envelope and the gambling site could sell their UID paper to the bank to get that $1 from the bank.