3

I was wondering wether a smart contract can execute automatically or not. For example, let's say I have a vesting contract that, when a certain deadline passes, automatically executes and send some funds to the beneficiary. Is this possible? Or this can only happen if there is a transaction that triggers the sending of funds? Do smart contracts on other blockchain have automatic execution?

2 Answers 2

5

On Cardano the answer is simple: smart contracts cannot execute themselves automatically. Rather, a smart contract is nothing but a set of rules associated with an address. In a first transaction, Ada and other tokens are transferred to the address - the so called script address. This script address is like a normal wallet address, the difference is that wallet addresses are associated to cryptographic keys and script addresses are associated with scripts (actually, the hash of the script as the script itself is not even stored on the blockchain), i.e. the smart contract. Then subsequently to this first transaction, any other transaction that wants to spend the funds sitting at the script address needs to satisfy the conditions set in the smart contract. Put simply, the smart contract is nothing else than a validator. In fact, there is nothing that gets "executed" in the narrow meaning of the word.

3

To complement Jey's answer and respond to your last question, I don't think that smart contracts can execute automatically as they are just code that is sitting at an address and they need an actual transaction to happen in order for them to be triggered. I would say this is the expected behaviour throughout the blockchain space.

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.