<blockquote>
<ol>
<li>can I trust that after this returns the Tx is definitely on the chain and won't be rolled back? In other words does it unblock after the Tx has been added to the tip of the ledger by the slot leader or after so many blocks have been added and the network has consensus (it's on the chain permanently) ? (pls note as I'm new to this, I might not be using all the terms correctly)</li>
</ol>
</blockquote>
<p>No, you cannot trust that it won't be rolled back. It only returns after the Tx is added to the ledger. Only 1 confirmation. It's just not deep enough in the ledger.</p>
<blockquote>
<ol start="2">
<li>typically how long does this take on the mainnet ?</li>
</ol>
</blockquote>
<p>A block is added every 20 seconds on average. For irreversibility, 15-30 blocks needed so 5-10 minutes.</p>
<blockquote>
<ol start="3">
<li>what happens if the Tx is not added to the chain ? Does it still unblock?</li>
</ol>
</blockquote>
<p>Nope, it never returns if Tx is not added, thus blocking forever.</p>

CC BY-SA 4.0
2022-01-24T10:53:07.690Z
2022-01-24T10:53:07.690Z
Tuvshintsenguun
<p>Question for Plutus Pioneer cohort 3 Q&amp;A week 1</p>
<p>I'm new to plutus dev and trying to clarify the behavior of awaitTxConfirmed. From the docs and other questions I've seen, it seems that the line</p>
<pre><code>void $ awaitTxConfirmed $ getCardanoTxId ledgerTx
</code></pre>
<p>taken from the EnglishAuction example blocks until the Tx has been added to the ledger.</p>
<p>Questions</p>
<ol>
<li><p>can I trust that after this returns the Tx is definitely on the chain and won't be rolled back? In other words does it unblock after the Tx has been added to the tip of the ledger by the slot leader or after so many blocks have been added and the network has consensus (it's on the chain permanently) ? (pls note as I'm new to this, I might not be using all the terms correctly)</p>
</li>
<li><p>typically how long does this take on the mainnet ?</p>
</li>
<li><p>what happens if the Tx is not added to the chain ?  Does it still unblock?</p>
</li>
</ol>
<p>These questions are from a UI dev perspective. In general I'm trying to work out how long would an end user have to wait from pressing a button in a GUI (that generates a Tx via the API and backend) and getting a response that the intended action has confirmed (is permanently on the chain) or is rejected.</p>

CC BY-SA 4.0
2022-01-19T00:19:45.830Z
Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer.
Community
<plutus-pioneer-program>
clarifying awaitTxConfirmed behavior
# clarifying awaitTxConfirmed behavior

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

Question for Plutus Pioneer cohort 3 Q&A week 1
I'm new to plutus dev and trying to clarify the behavior of awaitTxConfirmed. From the docs and other questions I've seen, it seems that the line
void $ awaitTxConfirmed $ getCardanoTxId ledgerTx

taken from the EnglishAuction example blocks until the Tx has been added to the ledger.
Questions

can I trust that after this returns the Tx is definitely on the chain and won't be rolled back? In other words does it unblock after the Tx has been added to the tip of the ledger by the slot leader or after so many blocks have been added and the network has consensus (it's on the chain permanently) ? (pls note as I'm new to this, I might not be using all the terms correctly)

typically how long does this take on the mainnet ?

what happens if the Tx is not added to the chain ?  Does it still unblock?


These questions are from a UI dev perspective. In general I'm trying to work out how long would an end user have to wait from pressing a button in a GUI (that generates a Tx via the API and backend) and getting a response that the intended action has confirmed (is permanently on the chain) or is rejected.

**Tags:** plutus-pioneer-program
> **Comments:**
> **username_1**: Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer.  

---

## 1 answers

### Answer by username_2 on 2022-01-24. Score: 0 | Accepted answer

> 1. can I trust that after this returns the Tx is definitely on the chain and won't be rolled back? In other words does it unblock after the Tx has been added to the tip of the ledger by the slot leader or after so many blocks have been added and the network has consensus (it's on the chain permanently) ? (pls note as I'm new to this, I might not be using all the terms correctly)

No, you cannot trust that it won't be rolled back. It only returns after the Tx is added to the ledger. Only 1 confirmation. It's just not deep enough in the ledger.

> 2. typically how long does this take on the mainnet ?

A block is added every 20 seconds on average. For irreversibility, 15-30 blocks needed so 5-10 minutes.

> 3. what happens if the Tx is not added to the chain ? Does it still unblock?

Nope, it never returns if Tx is not added, thus blocking forever.


---

