I am currently learning about smart contracts and there is a question I have.
I am trying to understand how smart contracts are executed. I read already different sources and I tinkered some ideas together but not sure if it is correct.
To deploy a smart contract, I have to send a transaction. A miner takes it, creates a smart contract address and as soon the block is valid, I have to possibility to work with the smart contract.
If I want to execute a smart contract I create a new transaction using the ABI of the smart contract to call a function(s). Since it is a transaction, a miner takes it, executes the code of the smart contract. But what happens now? Is the execution stored in the blockchain with the result of the execution?
I was wondering how this actually works. Let's consider I create a symmetric key encryption smart contract. I send a message and key and the smart contract sends the cipher back. Will the plain text be visible for everyone or just the cipher text?
Thanks in advance