If I understand correctly, when I create a new transaction from my wallet, I have to sign it and encrypt it. My wallet encrypts the message using the public key of the node it is connected to, so it can decrypt the message when it receives it, and signs the message with my private key, so the node knows it was me who sent the message because my public key is then sent along with the message.

What I don't understand is that when this message is transmitted to the other nodes for verification, how can they decrypt it if it was encrypted using the initial node public key. Furthermore, I read that also the miners should verify the validity of the transactions they have received. How can they decrypt the transactions?

  • There are some basic wrong assumptions in your post, and Andrew has already pointed into the right direction. There is a set of verification steps, which are described here: en.bitcoin.it/wiki/Protocol_rules#.22tx.22_messages. Also I highly recommend Andreas’ book “Mastering Bitcoin”, which is online readable in many languages. Keep on the good work, search the forum, and post your new questions! – pebwindkraft Feb 1 at 8:37
up vote 1 down vote accepted

If I understand correctly, when I create a new transaction from my wallet, I have to sign it and encrypt it. My wallet encrypts the message using the public key of the node it is connected to, so it can decrypt the message when it receives it, and signs the message with my private key, so the node knows it was me who sent the message because my public key is then sent along with the message.

You understand incorrectly. Nothing is encrypted in Bitcoin, there is no need to do so, and, as you noticed, it would make it impossible to verify the contents of the transaction.

Transactions are only signed. The signature both ensures the integrity of the transaction and proves that the sender is actually allowed to send the Bitcoin.

  • Thank you very much for your reply. Ok, I see I understood wrongly. However I still don't see how do the other nodes would know my public key. Is it that the transaction is a composite of two things, the transaction data itself, signed with the private key of the sender, along with his/her public key so the nodes can verify that the sender is the owner of the public key? – daniel sp Jan 31 at 20:27
  • The transaction contains the public key itself along with the signature. Both are contained within the transaction, but the signature does not and cannot cover itself (duh). – Andrew Chow Feb 1 at 1:42

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.