<p>Block time is 20 seconds in average. Sometimes we have blocks at shorter intervals, sometimes much longer. I saw sometimes sequences of 4 or 5 blocks at one second interval from each other. And sometimes even 2 minutes. And sometimes we have 2 or even stake pools which are minting a block in the same second, and only one will be adopted by the blockchain (this is called a slot battle). And when a stake pool mints a block without receiving the previous minted block (if it was minted in the second before, and the propagation time is more than 1 second), a height battle will occur, and only one of the 2 blocks will be adopted.</p>
<p>SPOs cannot choose when to mint a block. This is decided randomly, based on the VRF key of each stake pool, and is known 1.5 days before each epoch starts for the next epoch. In about 2 hours, I will know how many slots to mint blocks my stake pool has allocated for epoch 318 (exact date and time, in seconds, because one slot is one second).
The average interval of 20 seconds between block is given by a parameter, &quot;density&quot;, which is not 0.05 (5%). This means 5 blocks in average for every 100 seconds. This is a parameter that can be adjusted, but I don't think it will be adjusted soon.</p>
<p>If your transactions were confirmed until now in less than 10 seconds, you were just &quot;lucky&quot;. Now the blockchain is pretty busy, and it will probably take a few blocks until a transaction is confirmed, even more if you are using a light wallet.</p>

CC BY-SA 4.0
2022-01-29T16:08:20.430Z
Thanks for the detailed explanation. I still don't follow how would Cardano achieve real time transactions, say someone paying ADA at a coffee shop. Is density parameter tuning from 0.05 to 1.00 (or close to 1) the only way? Why not do it now?
dev
CC BY-SA 4.0
2022-01-29T16:09:14.860Z
Have one more query on your statement "In about 2 hours, I will know how many slots to mint blocks my stake pool has allocated for epoch 318". Are you suggesting slot leaders for each slot in the coming epoch are announced 1.5 days before it starts? If that were the case, wouldn't an SPO just turn on their machine for those few seconds and ignore the rest because it's not getting any revenue? Additionally, what happens a preselected slot leader is down when the slot time comes?
dev
CC BY-SA 4.0
2022-01-29T18:08:38.377Z
Yes, SPOs can find out 1.5 days before a new epoch starts the slots when their stake pools will mint blocks. They could turn off the block producer, but starting it and starting the service takes at least 10 minutes, sometimes a lot longer. 
The relays cannot be stopped, because they need incoming connections to propagate blocks. It you stop them, you lose those connections, and the blocks will be lost. This is why the relays must stay connected all the time.
George - APEX Stake Pool
CC BY-SA 4.0
2022-01-29T18:09:47.993Z
For real time payments a Layer 2 solution will probably be better suited.
George - APEX Stake Pool
CC BY-SA 4.0
2022-01-31T02:53:02.543Z
@dev - the Cardano roadmap has a bunch of things in the pipeline coming that will lead to scalability. Hydra Head is a big one, but AFAIK there are a bunch of other things that will work together to increase Transactions Per Second to 3000+. Right now they've just introduced smart contracts and dapps, so I think that's what a lot of the work has been going to.
marcel_g
CC BY-SA 4.0
2022-01-29T08:56:09.160Z
2022-01-29T08:56:09.160Z
George - APEX Stake Pool
<p>New to the crypto space, please correct me if I misunderstood the meaning of block time.</p>
<p>When a cardano node submits a transaction, it goes to a local mempool and submitted on the blockchain for verification. Let's assume this part is instantaneous from the wallet node.</p>
<p><a href="https://developers.cardano.org/docs/stake-pool-course/introduction-to-cardano/#slots-and-epochs" rel="nofollow noreferrer">The official docs</a> state that blocks are produced every 20 seconds. In other words, even if the validator nodes receive the transaction immediately, they will wait upto another 20 seconds, and then create a new block to broadcast.</p>
<p>This implies even a low assurance for block will take atleast 20 seconds. In my experience with cardano wallets (before the dexes were launched), it rarely took more than 10 seconds to get a high assurance for transaction.</p>
<p>I also read on the forums that 20 seconds block time is configurable, and can't be enforced on a node. So are we relying on SPOs to use a low block creation time interval to solve real time transactions in the long run?</p>

<cardano-node><block-production><slottime>
How does Cardano execute real time transactions if block time is 20 seconds?
# How does Cardano execute real time transactions if block time is 20 seconds?

(Asked by: username_0 on 2022-01-29)

New to the crypto space, please correct me if I misunderstood the meaning of block time.

When a cardano node submits a transaction, it goes to a local mempool and submitted on the blockchain for verification. Let's assume this part is instantaneous from the wallet node.

[The official docs](https://developers.cardano.org/docs/stake-pool-course/introduction-to-cardano/#slots-and-epochs) state that blocks are produced every 20 seconds. In other words, even if the validator nodes receive the transaction immediately, they will wait upto another 20 seconds, and then create a new block to broadcast.

This implies even a low assurance for block will take atleast 20 seconds. In my experience with cardano wallets (before the dexes were launched), it rarely took more than 10 seconds to get a high assurance for transaction.

I also read on the forums that 20 seconds block time is configurable, and can't be enforced on a node. So are we relying on SPOs to use a low block creation time interval to solve real time transactions in the long run?

**Tags:** cardano-node, block-production, slottime

---

## 1 answers

### Answer by username_1 on 2022-01-29. Score: 7 | Accepted answer

Block time is 20 seconds in average. Sometimes we have blocks at shorter intervals, sometimes much longer. I saw sometimes sequences of 4 or 5 blocks at one second interval from each other. And sometimes even 2 minutes. And sometimes we have 2 or even stake pools which are minting a block in the same second, and only one will be adopted by the blockchain (this is called a slot battle). And when a stake pool mints a block without receiving the previous minted block (if it was minted in the second before, and the propagation time is more than 1 second), a height battle will occur, and only one of the 2 blocks will be adopted.

SPOs cannot choose when to mint a block. This is decided randomly, based on the VRF key of each stake pool, and is known 1.5 days before each epoch starts for the next epoch. In about 2 hours, I will know how many slots to mint blocks my stake pool has allocated for epoch 318 (exact date and time, in seconds, because one slot is one second).
The average interval of 20 seconds between block is given by a parameter, "density", which is not 0.05 (5%). This means 5 blocks in average for every 100 seconds. This is a parameter that can be adjusted, but I don't think it will be adjusted soon.

If your transactions were confirmed until now in less than 10 seconds, you were just "lucky". Now the blockchain is pretty busy, and it will probably take a few blocks until a transaction is confirmed, even more if you are using a light wallet.

> **Comments:**
> **username_0**: Thanks for the detailed explanation. I still don't follow how would Cardano achieve real time transactions, say someone paying ADA at a coffee shop. Is density parameter tuning from 0.05 to 1.00 (or close to 1) the only way? Why not do it now?  
> **username_0**: Have one more query on your statement "In about 2 hours, I will know how many slots to mint blocks my stake pool has allocated for epoch 318". Are you suggesting slot leaders for each slot in the coming epoch are announced 1.5 days before it starts? If that were the case, wouldn't an SPO just turn on their machine for those few seconds and ignore the rest because it's not getting any revenue? Additionally, what happens a preselected slot leader is down when the slot time comes?  
> **username_1**: Yes, SPOs can find out 1.5 days before a new epoch starts the slots when their stake pools will mint blocks. They could turn off the block producer, but starting it and starting the service takes at least 10 minutes, sometimes a lot longer.  The relays cannot be stopped, because they need incoming connections to propagate blocks. It you stop them, you lose those connections, and the blocks will be lost. This is why the relays must stay connected all the time.  
> **username_1**: For real time payments a Layer 2 solution will probably be better suited.  
> **username_2**: @dev - the Cardano roadmap has a bunch of things in the pipeline coming that will lead to scalability. Hydra Head is a big one, but AFAIK there are a bunch of other things that will work together to increase Transactions Per Second to 3000+. Right now they've just introduced smart contracts and dapps, so I think that's what a lot of the work has been going to.  

---

