2

Suppose I sent a signed transaction using the web3.js library. But, I might be using some third party API like an Infura node or others. So there are chances of attacks and data manipulation. So, is there any way to verify if the all transaction data entered in the blockchain is same as the one entered by me or if it has been manipulated by someone?

1

You can look at the receipt of the transaction to verify the data yourself. The web3.js library's sendSignedTransaction will return a receipt that you can check to verify the data.

Edit based on goodvibration's comments

My original answer was as follows:

A signed transaction cannot be altered, as the data within the transaction has already been signed. If any data is manipulated, then the signature would be invalid and the transaction would never be broadcasted.

However, this is not entirely true in the case where a user's private key is shared among other parties. Because of this, the original answer does not apply.

| improve this answer | |
  • 1
    Your initial statement, although correct by itself, misses a key issue here, probably as a result of assuming that this user is the sole owner of the private key (and you know what they say about assumptions, right?). Imagine that someone else holds the same private key, detects this user's transaction in the pending-transactions pool, and immediately overrides it using the same nonce and a higher gas-price. – goodvibration Sep 15 at 15:25
  • 1
    That's why, although my initial instinct was to answer this question in the same way that you did ("no one can alter your transaction"), looking slightly beyond our "regular blockchain perspective", I realized that there was actually an interesting point in the question once you looked at it from a higher (slightly "naive") perspective. – goodvibration Sep 15 at 15:25
  • 1
    Another example - suppose this user uses a node which keeps his/her account unlocked and signs the transactions itself, and this "naive" user somehow assumes that this is considered as "I sent a signed transaction using the web3.js library". Then somebody hacks the node and sends different transactions. In this scenario, the user would still want to assert that his/her intended transaction was successfully executed on the blockchain. – goodvibration Sep 15 at 15:30
  • 1
    Your first comment is a great point! I will update accordingly. – Shane Fontaine Sep 15 at 16:36
  • 1
    Thanks ShaneFontaine and goodvibration for the valuable inputs. Initially I just thought only about the node getting hacked but did not thought about the private key being shared. – krritik Sep 15 at 17:11

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.