I have a dapp that allows you to upload pictures into blockchain using IPFS and I would like to implement a buy/sell smart contract that will allow users to buy the pictures or to setup terms to sell them.

What is the easiest way to start implementing this? I have looked over tutorials and examples, but I didn't find a good example of a buy smart contract, for example. Do you have any suggestions on what is the best approach or source to start?


1 Answer 1


First of all, I would embed a watermark in every image uploaded to IPFS and then unembed just because information is accessible to everyone via IPFS and it would make sense to show a preview of what people are purchasing.

As for buying and selling, I recommend examining the ERC standards, see

real-estate standards and erc-1175 if you are looking for tokenized transactions.

Buying and Selling is a fairly basic concept. If a user sends an transaction with ether greater than a specific buy price the transaction goes through, and ownership of the asset is transferred. A decent contract for buying and selling is available from open-zeppelin Payment Contract, almost forgot about open zeppelin :P.

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.