Author

Topic: How is a bitcoin address digitally signed? (Read 1209 times)

legendary
Activity: 3038
Merit: 4418
Crypto Swap Exchange
June 12, 2017, 12:48:31 AM
#10
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.
newbie
Activity: 36
Merit: 0
If there was ever a private key for a specific wallet, there was also a public key; the two are generated as a pair. I'm not entirely sure what the question is, but suffice to say that the public key shouldn't ever really be lost...its public knowledge  Smiley
newbie
Activity: 21
Merit: 0
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.
hero member
Activity: 770
Merit: 504
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.

Edit: the sender use receiver's public key/address to encrypt a message that receiver can decrypt with his private key.
legendary
Activity: 3038
Merit: 4418
Crypto Swap Exchange
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.
staff
Activity: 3458
Merit: 6793
Just writing some code
Is it also possible to use the public key directly as address instead of the bitcoin address? I ask because this may be useful if you want the sender to attach a private message to the receiver.
Yes. Many old transactions did this since Bitcoin used to be pay to IP (ask an IP address for a public key). However you will need to ask the person you are sending to to give you a public key and many wallets do not have this information readily available.
hero member
Activity: 770
Merit: 504

Quote
If you're talking about the signature verification when someone sends a transaction, the public key is sent in the scriptsig of the transaction so nodes can verify the signature. The scriptsig contains both the signature and the public key. If it doesn't verify, the transaction is invalid.

Ok. I think I get it: the public key of txin bitcoin address is made public when you announce a transaction.
Is it also possible to use the public key directly as address instead of the bitcoin address? I ask because this may be useful if you want the sender to attach a private message to the receiver.
legendary
Activity: 3038
Merit: 4418
Crypto Swap Exchange
To verify a digital signature you need the public key. But the public key can not be recovered from a bitcoin address. So how is signing done?
If you're talking about the signature verification when someone sends a transaction, the public key is sent in the scriptsig of the transaction so nodes can verify the signature. The scriptsig contains both the signature and the public key. If it doesn't verify, the transaction is invalid.

If you mean a message that is signed by an address, the signature will contain necessary information that can be used to calculate the public key. From there, once the signature is verified to be signed by that public key, the public key can be converted into a Bitcoin address.

Private key is used to sign the message. With the private key, you can get the public key, RIPEMD 160 hash and public key hash.
copper member
Activity: 2142
Merit: 1305
Limited in number. Limitless in potential.
To verify a digital signature you need the public key.
Yes, thats true and you can do it from any desktop wallet client, like electrum which has its own, you can signed message using electrum.
But the public key can not be recovered from a bitcoin address. So how is signing done?
So what is the wallet you are using now to signed a message.
hero member
Activity: 770
Merit: 504
To verify a digital signature you need the public key. But the public key can not be recovered from a bitcoin address. So how is signing done?
Jump to: