0

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?

1
  • 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! Commented Feb 1, 2018 at 8:37

1 Answer 1

1

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.

2
  • 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
    Commented Jan 31, 2018 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).
    – Ava Chow
    Commented Feb 1, 2018 at 1:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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