I'm looking for a way to store data in a decentralized way such that I can access any record from within the smart contract, probably through oracles I guess?

I've been looking into gundb but not sure how it can be used with solidity.


Storing data on the Ethereum chain can get very economically infeasible.

I would suggest making use of IPFS via Filecoin. This breaks your files up in objects, encrypts it and distributes/stores copies on different user's storage mediums without them having they encryption keys. IPFS will provide you a hash to "relocate" your data. For added safety, you can save that hash on the Ethereum chain.

If your idea is to store data directly on the Ethereum chain and the regain access to it via a Smart Contract, this can be done by a few lines of code but will be economically infeasible for even relatively small data. Thus the latter is proposed.

Hope this helps.

| improve this answer | |

If you are ok with using (centralized) oracles then you can basically use any database alternative out there. Oracles provide access to the world outside blockchain so the oracle can just call any database you want - depending of course on what the oracle supports.

IPFS is quite popular for somewhat-decentralized data storage, for example.

| improve this answer | |
  • But gundb works in JS. How do I interact with it using oraclize? – Sc4R Aug 18 '19 at 12:01
  • Never heard of gundb so no idea - also no idea what all type of connection Oraclize supports. But at least in theory it's possible to access any endpoint out there - as long as a database provides an endpoint. – Lauri Peltonen Aug 18 '19 at 12:36
  • ok thanks, I'll look into it – Sc4R Aug 18 '19 at 13:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.