user1638: I've been hearing that in Cardano transaction fees are highly predictable (in contrast to Eth gas fees) and that failed transactions don't pay fees. This is in direct contradiction to the transaction fee equation in the official docs ( https://docs.cardano.org/explore-cardano/fee-structure ) which includes a minimal fee (a) to prevent DoS attacks.
So which is true? Are failed transactions free or do they always have to pay a min fee?
Edit: please elaborate how the system works in these cases for anybody who is reading to understand.

user2537: On the Cardano blockchain there are two stages where a transaction can fail.
In the first stage, there are some integrity checks that are run. Also the node checks if the UTxO-inputs of the transaction exist and are free to be spend. No scripts are run at this stage. If the validation fails, no fees are collected.
In the second stage, scripts are executed. If one of them fails, fees are collected. For this purpose, the transaction includes a collateral-UTxO.
In summary, no fees are collected for unpredictable failures and fees are collected for predictable failures. This protects against DoS with scripts that are expensive to execute and fail.
That being said, there can never be a complete protection against DoS in an open network. If the system is flooded by a huge amount of stage-1-invalid transactions, I guess that the Cardano distributed system would get into trouble. But I also think, that this type of attack are probably difficult and expensive to execute.
There is a nice article explaining the topic here:
https://iohk.io/en/blog/posts/2021/09/07/no-surprises-transaction-validation-part-2/

1638: <p>I've been hearing that in Cardano transaction fees are highly predictable (in contrast to Eth gas fees) and that <strong>failed transactions don't pay fees</strong>. This is in direct contradiction to the transaction fee equation in the official docs ( <a href="https://docs.cardano.org/explore-cardano/fee-structure" rel="nofollow noreferrer">https://docs.cardano.org/explore-cardano/fee-structure</a> ) which includes <strong>a minimal fee (a) to prevent DoS attacks</strong>.</p>
<p>So which is true? Are failed transactions free or do they always have to pay a min fee?</p>
<p>Edit: please elaborate how the system works in these cases for anybody who is reading to understand.</p>
 2537: <p>On the Cardano blockchain there are two stages where a transaction can fail.</p>
<p>In the first stage, there are some integrity checks that are run. Also the node checks if the UTxO-inputs of the transaction exist and are free to be spend. No scripts are run at this stage. If the validation fails, no fees are collected.</p>
<p>In the second stage, scripts are executed. If one of them fails, fees are collected. For this purpose, the transaction includes a collateral-UTxO.</p>
<p>In summary, no fees are collected for unpredictable failures and fees are collected for predictable failures. This protects against DoS with scripts that are expensive to execute and fail.</p>
<p>That being said, there can never be a complete protection against DoS in an open network. If the system is flooded by a huge amount of stage-1-invalid transactions, I guess that the Cardano distributed system would get into trouble. But I also think, that this type of attack are probably difficult and expensive to execute.</p>
<p>There is a nice article explaining the topic here:
<a href="https://iohk.io/en/blog/posts/2021/09/07/no-surprises-transaction-validation-part-2/" rel="nofollow noreferrer">https://iohk.io/en/blog/posts/2021/09/07/no-surprises-transaction-validation-part-2/</a></p>
