If you type your name and address into the HN comment box and hit submit, you have opted in to having your address visible in a comment on HN.
The ham registration is the same. Before you can take the test to get licensed, you have to go to the FCC website and enter your information into their public database. It’s clear what you’re doing, you have to actively choose to do it, and it’s the direct outcome of the action you take.