Post
Topic
Board Development & Technical Discussion
Merits 1 from 1 user
Re: How is a bitcoin address digitally signed?
by
ranochigo
on 12/06/2017, 05:48:31 UTC
⭐ Merited by ETFbitcoin (1)
signing is done using private keys, you verify the signature with the public key

I ask because this may be useful if you want the sender to attach a private message to the receiver.
Achow has answered your question on the first part. As to your second part, you can use a public key to encrypt messages but you cannot really include them in your transaction.

Of course, you can encrypt and put the message in the OP_Return of the transaction.

I was more thinking about external handling of messages, like a server service. The sender use receiver's public key to encrypt a message, and sign it by using his public key from txin address.
You CAN use a public key to encrypt messages for the person with the corresponding private key to decrypt. Note that this isn't exactly the best way to encrypt messages and it doesn't provide as much security as a PGP encryption would.

Electrum has this implementation.