I'm pretty sure that's how the stock market is actually intended to work. This should be obvious if you consider things like dividends. There needs to be a fixed number of shares, each with a clear owner for that to work.
The reason it's a bit more complicated in practice, is because historically the technology wasn't there to do realtime gross settlement. So to limit the number of transactions that the central database had to handle, layers of delayed net settlement were set up instead.