6

Is it correct that the length of a Plutus time slot is one second? I recall that at one point it was twenty seconds, but I understand that that is no longer the case. Where in the Plutus codebase can I find the answer?

Is this the code?: https://github.com/input-output-hk/plutus/blob/2c8161ad142f56b14611cc0f66b0a2803016fe37/plutus-ledger/src/Ledger/TimeSlot.hs#L58

3

According to the official documentation a time slot is one second.

The Cardano blockchain uses the Ouroboros Praos protocol to facilitate consensus on the chain. Ouroboros Praos divides time into epochs. Each Cardano epoch consists of a number of slots, where each slot lasts for one second. A Cardano epoch currently includes 432,000 slots (5 days). In any slot, zero or more block-producing nodes might be nominated to be the slot leader. On average, one node is expected to be nominated every 20 seconds, for a total of 21,600 nominations per epoch. If randomly elected slot leaders produce blocks, one of them will be added to the chain. Other candidate blocks will be discarded.

I think where you got the 20 seconds from was the block producer node nomination process, which is about 20 seconds on average.

TLDR; One slot = one second.

EDIT:

There is one slight complication with this, and that is that Ouroboros, the consensus protocol powering Cardano doesn’t use POSIX time, it uses slots. But Plutus uses real time, so we need to be able to convert back and forth between real time and slots. This is no problem so long as the slot time is fixed. Right now it is one second, so right now it is easy.

However, this could change in the future. There could be a hard fork with some parameter change that would change the slot time. We can’t know that in advance. We don’t know what the slot length will be in ten years, for example.

EDIT TLDR; One slot = one second. For now.

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.