I was thinking about this some yesterday and I think the simplest way to have a distributed exchange without modifying the bitcoin protocol at all would be something similar to the following (see below). It would require a peer-to-peer network built to facilitate finding buyers and sellers for trading and distributing information regarding the securities but the transactions themselves would be conducted using the blockchain. This basic idea could be extended to facilitate bonds with buyback in addition to stocks although I haven't though through the details yet. The concept is similar to the idea of colored coins.
I'm willing to start building this, but I don't have the time to do it all alone, so if there are any talented programmers out there, please let me know if you are interested.
Here are the details:
* Each security would be represented by a single bitcoin address. The issuer of the security would hold the private key for this bitcoin address. Information regarding the security, including any news, announcements, or updates to the security would be signed by the issuer using the security's private key thus ensuring that the information is truly coming from the issuer.
* Shares in the security would be represented by the bitcoins belonging to the bitcoin address. Each satoshi would represent a single share. The security must be funded by a single transaction that represents the number of shares for that security. The total number of shares can never be increased or decreased. Any additional deposits made to the bitcoin address representing the security will be ignored by the Distributed Security Exchange (DSE) protocol. If the issuer wishes to increase the number of shares available he must create a new security.
* Shares are traded to investors by transacting bitcoins from this address to a investors bitcoin address. For simplicity sake, each investor should have a separate bitcoin address for each security he invests in. In that way, the value of the coins in his address with represent, in satoshis, the number of shares he holds for a given security. There is nothing to stop him or someone else from depositing more coins into an investors address but the DSE protocol will not count coins that come from an address that can not be traced back to the original security issuer's bitcoin address.
* Transactions of shares of a security would be performed using contracts. In the simplest case, the contract would involve the security seller transferring a number of satoshis equal to the number of shares he is selling to the buyer and the buyer transferring a the cost in bitcoin back to the seller. The contract would only be valid if both transactions have been signed appropriately by both the buyer and seller. A description of how contracts work in the bitcoin protocol is outside the scope of this document. In this way, both the buyer and seller can be sure that neither one can be cheated.
* The current price of a security can be determine by using a standalone app (or web service) that scans the blockchain and looks at the most recent price a security was traded for. It can also use this method to get average prices, daily highs and lows, and volumes in addition to other useful statistics on a security.
* Finding a buyer or seller is a little more difficulty. It is necessary to a use peer-to-peer network for buyers and sellers to connect with each other. A seller or buyer will broadcast how many shares they are looking to buy or sell and what price they are willing to buy or sell at. When a match is found, the trading software can automatically perform the transaction as described above and both parties will be notified of the transactions success. Transactions can occur outside of this peer-to-peer network just as easily so buyers and sellers can be located using other methods such as IRC, forums, and word of mouth, if desired.