1

I read a lecture about Bitcoin Blockchain. As shown in the slide below, a user Alice sends a transaction to BoB. Alice should

1-) Hash(Hash of the transaction of the coin || Bob Public Key || Alice address)

2-) Sign the hash

3-) Send the signed transaction and Alice public key.

My Question: Assuming this is accurate explanation of transation in bitcoin, why the user should hash the transaction before he send it? Also, How a miner can verify the transaction using the public key and the signed transaction? I guess a miner need the original transaction as well as the hash of the transaction. enter image description here

1
4

why the user should hash the transaction before he sends it? A transaction is a data structure just like a .json file. Therefore if senders wouldn't hash this data structure, it could become inconsistent, e.g. sometimes having more fields, sometimes not. Hashing it before, turns data to a consistent shape, resulting ALWAYS in hexadecimal of x bit (depending on the Blockchain)

Also, How a miner can verify the transaction using the public key and the signed transaction? That's the point of Public-key cryptography. Signing a transaction is a process that is "almost" impossible to revert, but very easy to verify!

If you are new and really want to understand those processes, I think (in my opinion) the best way is to read these books from Andreas Antonopoulos. Form me, they were totally worth.

Mastering Ethereum Mastering Bitcoin

[EDIT] - I could deep my answer more, but I wouldn't be saying anything new and Andreas Antonopoulos' book certainly explain it better than me

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