I would like to develop a Plutus script that executes each time an epoch ends.

What's the best way to achieve this behaviour?

2 Answers 2


As mentioned by Jey earlier, blockchains and smart contracts remain latent until triggered by a user submitted transaction.

One way you could pull this off is that you could use the cardano-cli application to create, sign and submit a transaction which executed the plutus script at the end of every epoch. You can find out more about cardano-cli and plutus scripts here and a simple sample here

UPDATE: I realized that I missed out explaining how this could be done by creating an javascript bot which submits this kind of transaction near the end of the epoch automatically. You can use the cardanocli-js javascript library to achieve this... here's a basic sample, but you can pretty much do any kind of action that the cardano-cli can do, in a programmatic submission.

Hope this helps!

  • 1
    This is exactly what I learned at the Plutus Pioneer Program but I just needed to be sure I was understanding it correctly. Thank you very much for your clarification! Feb 16, 2022 at 10:29

Scripts are executed as part of a transaction validation. That means: no transaction -> no script execution. The blockchain has no mechanism of timed or automatic script execution. What you can do is to implement transaction submission at every new epoch in your off-chain code.

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.