I want to store some documents in my smart contract that some users upload. Can I use table for storage? But second thing is table resides in RAM and this doesn't seems good to store data in Ram.

Is there any other option like IPFS?

1 Answer 1


Yes, you can upload the document on IPFS; and then store the IPFS multihash as a key of your table:

Something like this should be useful:

// @abi table
struct ipfsid
    uint64_t key; //the multihash
    account_name uploader; // the account of the document uploading on ipfs

    uint64_t primary_key() const { return key; } //multihash is the key
  • Yes this is the table part. How can I connect to the IPFS inside my contract? Sep 25, 2018 at 9:26
  • 1
    What about if the user upload the document on IPFS off-chain; retreive the multihash from a front-end using eosjs, and then save it onchain calling a method of your contract (that basically add this new element to the table)? Sep 25, 2018 at 9:49
  • That sound good to me,this also save the cost of RAM and cpu . Sep 25, 2018 at 9:54
  • Agree, this could be one of the solution that saves more RAM. Sep 25, 2018 at 9:56
  • How is IPFS here is compared to Demux? any preferences? Dec 22, 2020 at 0:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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