Bitcoin Forum
November 16, 2024, 04:38:31 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How is a bitcoin address digitally signed?  (Read 1209 times)
wingding (OP)
Hero Member
*****
Offline Offline

Activity: 770
Merit: 504



View Profile
May 28, 2017, 09:40:08 AM
 #1

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?
bL4nkcode
Copper Member
Legendary
*
Offline Offline

Activity: 2142
Merit: 1307


Limited in number. Limitless in potential.


View Profile
May 28, 2017, 11:21:12 AM
 #2

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.
ranochigo
Legendary
*
Offline Offline

Activity: 3038
Merit: 4420


Crypto Swap Exchange


View Profile
May 28, 2017, 11:45:10 AM
Merited by ABCbits (1)
 #3

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.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
wingding (OP)
Hero Member
*****
Offline Offline

Activity: 770
Merit: 504



View Profile
May 28, 2017, 01:15:20 PM
 #4


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.
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3542
Merit: 6886


Just writing some code


View Profile WWW
May 28, 2017, 05:57:00 PM
 #5

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.

ranochigo
Legendary
*
Offline Offline

Activity: 3038
Merit: 4420


Crypto Swap Exchange


View Profile
May 29, 2017, 02:56:47 AM
 #6

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.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
wingding (OP)
Hero Member
*****
Offline Offline

Activity: 770
Merit: 504



View Profile
May 29, 2017, 11:03:37 PM
Last edit: June 13, 2017, 07:47:35 AM by wingding
 #7

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.
Markley
Newbie
*
Offline Offline

Activity: 21
Merit: 0


View Profile
June 11, 2017, 04:16:19 PM
 #8

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.
fan_of_things_and_stuff
Newbie
*
Offline Offline

Activity: 36
Merit: 0


View Profile
June 12, 2017, 04:55:47 AM
 #9

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
ranochigo
Legendary
*
Offline Offline

Activity: 3038
Merit: 4420


Crypto Swap Exchange


View Profile
June 12, 2017, 05:48:31 AM
Merited by ABCbits (1)
 #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.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!