Background: We learned that corda is not tamper-proof but tamper-evident. So, if one of the node manipulated a state directly in the database, other nodes will be able to detect and flag it if that state was used in subsequent transactions. However, our test results were not as per our expectation. Corda did not flag the state that was tampered and in fact it recorded the new state with tampered data in all participant nodes.
Prerequisites: Comment Out Contract Validations: We commented contract code to check if the data tampering is detected in Corda without the check being explicitly done at command level.
Steps to replicate:
- Start obligation Cordapp.
Create 3 obligations between Party A and Party B (100 THB, 256 THB and 100 THB)
Edit the VAULT_STATES table in the database of Party B, by looking at the differences between the hexs. Obligations with different amount is on the left and the two obligations with the same amount is on the right. From the editor when they are at same amount there are 2 differences (presumably linear-id & timestamp related) and when they are at different amount the 3rd discrepancy is showed on the left.
Overwrite the specific portion with the lower value amount, update vault using SQL on Party B’s vault:
After this update, check Party B’s vault and the amounts are changed to 100 THB on all 3 obligations.
However, Party A’s vault will show original amounts (100, 256, 100) as the data was not tampered in Party A’s vault.
Transfer ALL obligations from Party B to Party C
Transfer obligations result: Party B have no more obligations
Transfer obligations result: Party C will get all Party B’s Obligations (100 THB for all, i.e. tampered data was passed on to the new party)
Transfer obligations result: Party A’s vault will also be updated with tampered data. It couldn’t identify or flag tampered data.
How to get Corda participant nodes to detect tampered states? have i missed some config while setting up the node?