Did you refuse and ask under what power the police were acting if you refused , under what power in law they demanded the information ?
If we are getting the whole story, police powers are limited. I suspect we are not. Are you sure that the police did not have some suspicion that you had committed an offence ? I'm thinking of the kind of offence of sending tweets or messages which are so offensive that someone could be jailed for it. if they had reasonable suspicion, they should have arrested you for that offence
Police who stop and search you, legitimately, may ask for your name and address but you are not obliged to give those: see Police and Criminal Evidence Act, Code of Practice A section 4.1 and 4.2. That gives you an idea. If they arrest you then you will have to, at some point.
Police who suspect you of committing a crime may demand the correct name and address if they think that you are deliberately giving a false one of either, and will, of course arrest you if you refuse to give any,( if only because that is some evidence to confirm the suspicion they already have).
Interesting though all that is, I don't presently see how any of it applies to you.