0
votes

I have a fundamental confusion about the public key cryptography in the Bitcoin (Blockchain) field.

For example, I understand that, in Bitcoin, when Bob wants to make a transaction, he sends out a transaction that contains the following:

  • The plain transaction message (such as Bob sends 5 Bitcoins to Alice).
  • Bob's public key
  • The digital signature of the transaction, signed using Bob's private key

I understand the whole Bitcoin network will validate this transaction based on Bob's public key and digital signature, which is broadcasted along with the plain transaction info all across the network.

However, what if the above transaction (that Bob sends Alice 5 bitcoins) is initiated by Eve? Eve broadcasts the plain transaction message, her public key, the digital signature signed using her private key. It seems the whole Bitcoin network will also validate the transaction based on the provided information.

Can you please clarify what type of wrong thinking I'm having?

Thanks a lot!

Cheers, M.

1

1 Answers

1
votes

Everything is correct. But, Bob cannot send any Public Key. He must provide the Pubkey, related to the address, from which he take 5 BTC for send further. In the Bitcon design, the address is hash of the Pubkey.

As result, Eve does not know pubkey for Bob's address, and she unable send transaction, which spends Bob's money. But, of course, she able to send transaction with pubkey for address, she owns. By other words, Eve can spend her own money, and this is OK.

If you will see details of the Bitcoin script, you will see typical spending script:

ScriptPubKey = OP_DUP OP_HASH160 OP_EQUAL OP_CHECKSIG

This script duplicate pubkey, hashing one copy, compare hashed copy with btc_address, and if equal - checks signature. As you see, no any pubkey acceptable.