montypanday / DocChain

0 stars 0 forks source link

Addition of more columns to Database schema + Interaction between Blockchain and the Database #14

Open montypanday opened 6 years ago

montypanday commented 6 years ago

@smmath has done exceptional work with database. The documentation is accurate and shows that he had good understanding of what he did.

The Current fileactions table is

Columns: FileID varchar(20) FileHash varchar(64) StoragePlatform varchar(20) UserID varchar(10) ActionType varchar(20) ActionTime datetime

We have different actions like preview, rename, download which also need to be recorded. Because the whole motive of our application is to provide authenticity using blockchain, i can PUT the

base64(hash(a row in fileactions)) and next we use the database, we first check that its hash exists on the blockchain and if true only then use it.

Please give your ideas here!

montypanday commented 6 years ago

SELECT MD5(concat(field1, field2, field3, ...)) AS rowhash

We can convert rowhash into base64 because that is what LINCD API accepts. The user can be sure that document trail has been verified with blockchain

smmath commented 6 years ago

I like the idea of embedding the hash of the entire database row in the block-chain. With the block-chain API alone embedding just the file hashes we can only determine if a file has changed. Combining the block-chain with a history of block-chain embed events stored in the database we can answer more questions.

We can determine:

This will be made possible by the fact that while the hash of a file will change, the fileID id won't, so we can query against that to uncover its history.

By tracking other actions such as rename and download like Monty said, we could even piece together a finer grained history of a file by determining what actions have been performed on it between two block-chain embed actions.

BTW since we've discussed block-chain usage I've updated the title of the issue for future reference.

montypanday commented 6 years ago

http://ctxp-deakin.lincd.co/swagger/ The Blockchain API only has two methods. GET - Validate data exists in Blockchain PUT - Put data into blockchain.

It cannot be used to store data

We will discuss in meeting as well