A
A
alex_devPY2018-10-31 10:37:20
blockchain
alex_devPY, 2018-10-31 10:37:20

How to sell links through an Ethereum smart contract?

Hello.
I read about smart contracts, but did not quite understand.
There is data

a = {
         '2': 'http://site.ru',
         '1': 'http://test.ru',
     }

I write this data to the smart contract array, upload it to the blockchain.
The idea is simple: the user program sends ethers + link id (1 or 2), and in response receives a link from the smart contract array.
Will the links be visible to all users or will the ether blockchain provide a non-public array?
Smart Contract by itself can't return a response? How is there no callback? How then to carry out operation of return of the link?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
rPman, 2018-11-01
@alex_devPY

You will not be able to directly implement the storage and transmission of data completely on contracts (it is possible to apply some kind of homomorphic encryption here, I xs), because the data will be in the open.
Therefore, the only way is to track payment events in your application and react accordingly.
Your contract should be just a tool for users to tell what product (link) they want to receive, along with a payment transaction, and after that your service could send the purchased information to the address of the payer in a normal message transaction.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question