Reputation: 581
I want my master data and transaction data to always match. The master data is off-chain and the transaction data on-chain.
The master data consists of several records from several tables. I want the transaction data to always match the master data. My participants are trusted, but it could be that one could go rogue and adapt the off-chain master data.
I know that hashing is the way to go here. I see loads of examples that a string is hashed. But I am not sure how to hash multiple records. Do I put them all into an object, convert that into a string and hash it? Is there a cleaner way to do this?
Upvotes: 0
Views: 84
Reputation: 363
In almost all implementations a hash is calculated over an array of bytes, any bytes. So you as a developer can choose the content of this byte array.
So the answer is you can choose what to hash it all depends on what you want to verify. The only thing to be aware of is that when checking the hash you should use the same method.
Upvotes: 1