1

The above statement is taken out of a book which I've been reading: Mastering Bitcoin 2nd Edition.

...as its communications and transaction data are not encrypted and do not need to be encrypted to protect the funds...

Just started about bitcoin, going through the third chapter and when I come across the above lines, I merely struck by one question, and that is, if the communication happens between (peers' / wallet to bitcoin network) is not encrypted...then I am just thinking a scenario

X is sending BTC to Z (obviously by mentioning Z's address in txn)

Y (bad guy) cuts in the communication which is not encrypted (as per the above reading) and tampers the transaction that X has been sent ( by Just putting his address in beneficiary )

I mean, honestly, it is a very naive scenario that anyone could think of and I know there would be something in bitcoin (which I am not aware of) could prevent this from happening, so, giving clarification on how this kind of attacks being handled or mitigated in Bitcoin would be much helpful for this post.

3

Standard transactions are digitally signed using a private key. If a middle man tampers with the transaction, then the digital signature verification would fail, because the only way to produce a valid signature is to have the original private key. This would cause the transaction to fail and the network would reject it as invalid.

This signature algorithm is called ECDSA and a common address type that requires signature verification is a P2SH(P2WPKH) (Pay to Script Hash - Pay to Witness Public Key Hash).

Also, it is important that the transactions are not encrypted, otherwise the rest of the network would not be able to verify that the transaction was valid (and prevent double spends, etc.).

  • "if a middle man tampers with the transaction, then the digital signature verification would fail, because the only way to produce a valid signature is to have the original private key".......................one can possibly keep the signature intact and modify the beneficiary can't they? – Explorer_N Aug 28 at 5:26
  • @Explorer_N no, the signature is made over the relevant parts of the transaction, including the recipients address. Modifying any of that data will cause the signature verification to fail. – chytrik Aug 28 at 5:39
  • @Explorer_N Related question discussing about modification of recipient: bitcoin.stackexchange.com/questions/90028/… – Ugam Kamat Aug 28 at 6:03
3

Cryptography and Encryption

In the wider world, cryptography is used for a variety of security related purposes:

  • Authentication (proof of identity, or proof of ownership)
  • Non-repudiation (author cannot later deny authorship of data)
  • Confidentiality (secrecy - third parties can't see the data)
  • Integrity (proof that data has not been changed or tampered with)

When we say "encryption" without clarifying further, we are usually talking about the use of cryptography to ensure confidentiality (secrecy of data, but not secrecy of a transmission having occurred - the latter might involve steganography or private channels etc).

Bitcoin's peer-to-peer protocol doesn't need secrecy but it does need a form of authentication and integrity proof that is provided by digital-signatures.

Traditionally digital-signature algorithms used RSA which involves encrypting a hash of data but not encrypting the data itself. Bitcoin uses Elliptic Curve cryptography which produces digital signatures without involving encryption of a hash.

So the author is perhaps pointing out that the data sent by Bitcoin peer-to-peer protocols is not encrypted for confidentiality and does not involve encryption.

Terminology

The word crypto-graphy literally means hidden writing. There is a certain irony in using this term for elliptic curve cryptography which cannot directly be used for hiding the text of messages - what many people mean by encryption is the process of converting normal readable plaintext into unreadable ciphertext.

  • 1
    If by traditionally you mean "in RSA". Looking at the variety of digital signature schemes that exist, ones that reduce to encrypting a hash are rare. In particular, ECDSA, the digital signature scheme used in Bitcoin, does not use anything that could be useful for encryption. – Pieter Wuille Aug 28 at 17:56
  • it looks correct now, but "not using encryption in the normal sense" is confusing to me. It's not used in any sense. – Pieter Wuille Aug 29 at 15:28
  • @Pieter. Fair enough. – RedGrittyBrick Aug 29 at 18:00
0

Thanks to all the contributors; I realized I was bit hasty..After continue reading the book (6th chapter now!) during my spare time I come across this passage

A digital signature serves three purposes in bitcoin (see the following sidebar). First, the signature proves that the owner of the private key, who is by implication the owner of the funds, has authorized the spending of those funds. Secondly, the proof of authorization is undeniable (nonrepudiation). Thirdly, the signature proves that the transaction (or specific parts of the transaction) have not and cannot be modified by anyone after it has been signed.

Third purpose answers this question.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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