(If required, answers may assume I am asking about the situation in the US)
Where does stock ownership ultimately mean if we ignore middle men like brokers. Does the company itself keep a record of who owns what and is that the legal source for ownership questions? That would feel like a conflict of interest. Or is stock ownership entered in some public database? (Is that what DTC is for?) Or is stock ownership completely decentralized and immaterial and is simply based on some numbers that I am given in legally binding documents at the time of purchase that I can then use to argue in front of a court if my ownership is ever disputed?
Related to this question, how do I transfer ownership? If I buy stock and the company later says they do not have me in their records, do any documents that I received count to prove ownership? This has even more relevance if I did buy through a broker. What if the broker went bankrupt? There must be an actual ownership beyond being listed in some books of some broker, right?
If I want to sell my stocks to, say, a friend, how do I transfer ownership to him? Do I have to inform the company? This would feel strange; if I buy a computer I don't need to inform the store I bought it from when I sell it to a friend. I imagine I should just be able to hand my original letters of purchase to my friend together with a new document in which endorse the trade?