If I buy shares of a company through a broker, who is my counter-party? The company or the broker? i.e Do I face counter-party risk twice over(if company goes bankrupt and also if broker goes bankrupt)?
If one is using a broker to trade equities then the equities are held in "street name"; in other words, in the brokerage's name at the equity's transfer agent on behalf of the client. A client can request that they be held in the client's name, but it will then be out of the broker's fiduciary so will be almost impossible to trade unless if the client can find someone to buy directly.
The counterparty risk for a brokerage client is the brokerage; however, many insure their accounts.
The ultimate counterparty risk for a shareholder is the registrar. Restrictions in the contract between corporation and registrar usually prohibit lending the shares and anything else that would place the shares at risk.