IBM-Blockchain-Archive / ibm-blockchain-issues

Having issues with the IBM Blockchain Bluemix service? Let us know!
13 stars 12 forks source link

Can I store multimedia files (pdf, mp3...) in the blockchain? #123

Closed Alexander-Herranz closed 6 years ago

Alexander-Herranz commented 6 years ago

Hi all,

I'm developing some POCs over an API REST exposed from the deployed blockchain instance with composer. I can model my asset types and the relations with rules or smart contracts.

But what if I want to store data such as pdf, mp3 or so? What is the best practice here? Should I get a checksum (SHA256 for example) of the file, and store it on the blockchain to check it later with the real data file from an storage data base like COS or so? Or could I store the file directly on the blockchain? Or should I generate a base64 string of the file, and store it on the JSON object that is saved in the blockchain?

Thanks in advance

dhyey20 commented 6 years ago

A good practice is to store the files off the chain and just have the hash tracked on the blockchain. If you start appending file to the blockchain then the size of transactions will also be an issue.