Stock price is determined at any point of time by Buyers and Sellers. The brokerage and exchange have processes built in place to cover the default risk of the buyer and seller. Any stock bought is stored in dematerialized form in NSDL/CSDL depositories