bosnet / sebak

SEBAK, the next BOScoin Blockchain
https://devteam.blockchainos.org
GNU General Public License v3.0
44 stars 15 forks source link

Do not use Operation Hash for validation #851

Closed kfangw closed 5 years ago

kfangw commented 5 years ago

Definition of the Hash for operation is debatable. But I want to resolve this.

Hash is a fingerprint of given data. If the data is changed then the Hash also changed. Hence, the Hash is unique when the data is unique.

We use the hash for the transaction or block as a unique identifier. Because the payload for the tx and block is unique.

However, as we already knew, the operation payload is not unique. And the hash also not unique. So, the hash for the operation cannot be used as the identifier.

On the other side, Combination of TxHash and Operation Index is unique because TxHash is unique and Operation Index is unique within the Transaction.

According to this, Validation for the operation should be done with the unique identifier.

kfangw commented 5 years ago

solved by #850