0

To introduce my question I would like to give an example. Suppose a customer wants to join a gym. A transaction is sent and contains:

  • customer id
  • name and surname
  • start date
  • end date

The smart contract receives the transaction and creates a membership at the gym. Where is this data saved? After some time I want to verify that the subscription has not expired and I send a checkRequest. Can I specify only the id and then the smart contract through the id search for the subscription? I mean, can the smart contract access the subscription knowing the id? Can the smart contract take the subscription that matches the sent id and do the check?

I cannot understand the difference between data saved on the blockchain permanently (when is this data saved?) and data that is saved in the smart contract (does the smart contract have storage?) Is there a difference? I know the question is trivial but I can't understand.

1 Answer 1

1

The smart contract is a program that:

  • Its compiled source is saved on the blockchain, so anyone can not change it after deploying on the blockchain.
  • All of its data is saved on the blockchain, so anyone cannot change a data that is registered in a certain block. If you need to change the data you should provide it in smart contract source, so the allowed users can change the data in the following blocks.
  • Has access to all of its own data and can export data or not.
2
  • So if I want to verify a customer's subscription, do I have to pass all the data over again (id, city, start date, end date)?
    – EMANUEL
    Commented Jan 30, 2021 at 9:49
  • 1
    No need to pass all data again, as database applications you can pass customer id and let the program to do other operations. Commented Jan 31, 2021 at 10:03

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.