What's the best way to embed a note in the transaction? And the note can only be read by receiver.
thanks
Yes, please don't create lots of unspendable scriptPubKeys. There are more prunable ways of embedding messages into transactions. And there are even better ways of associating messages with transactions, so only people involved with the transaction can read the message (if that's desired).
In other words, lets figure out how to do this the right way. The way you're doing it now will stop working as soon as the network upgrades anyway (0-value outputs are nonstandard as of the 0.7 release).
The method Gavin was probably talking about is the
Payment Protocol, which was still in development at the time of his comment.
BIP70 only supports request. What about send?
BIP70 also requires request party has a CA and url. A lot of p2p won't have those.