0

with reference to this question. Store specific data related to users I wanted to ask is there any difference between transaction's data and smart contract's data? how is transaction's data is cheaper to store?

How can we use IPFS to store database don't we need a server for that?

1

A transaction can carry with it an input field. So, for example, I can send my friend 10 ether, and in the input field, I can add a message that he can later read. Assuming my account is a regular account (as opposed to a smart contract account) and so is his nothing really gets stored on the blockchain other than the transaction (and its input).

Alternatively, if my friend's account is a smart contract that has been programmed in such a way that the transaction causes it to do something and then store the results (say it adds me as a token holder) to its own internal state. That internal smart contract state has to be saved on-chain and has a fairly high cost per megabyte associated with it. In this case, many people store the actual data in a distributed files system such as IPFS (because it's way cheaper) and store only a pointer to the file (i.e. the IPFS hash) in the smart contract.

IPFS does not require a server because it is a distributed files system. Anyone who wishes to participate must run an IPFS node locally on their own machine. (Although, there are services that allow you to run a remote IPFS node, but that's not the preferred embodiment.)

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.