I have often seen the general rule of thumb be 30 block confirmations. Is this adequate or is it better to count to 900 endorsements or use some other more complicated approach to determining confidence in the finality of a transaction?
It is better (although more complex) to use fitness/endorsements. 900 fitness/endorsements is roughly 30 "normal" blocks (i.e. blocks with close to full endorsements), which is a simpler rule of thumb for users to remember and check.
The difference would be if the past 30 blocks have very low endorsements/fitness - this would make a chain-split in the past a higher probability. Confirming after just "30 blocks" is more riskier in my opinion.
If you can monitor the fitness/endorsement difference, I would use that.
Tezos current protocol (003) achieves probabilistic finality after a recommended time of 30 confirmations which reduces the chances of the transaction being impacted by a reorg.
A series of blog posts from Nomadic Labs give a more detailed and up-to-date answer, notably this one: https://blog.nomadic-labs.com/emmy-in-the-partial-synchrony-model.html.
Roughly, the answer depends on how much stake an attacker is considered to have. But it also depends on whether the network message delays are reasonable, and on the degree of assurance one wants to have. And one has to bear in mind that these analysis are based on a model, which nevertheless we hope to be accurate.
Anyway, to give some concrete numbers, suppose the concrete question is: I have seen
n confirmations since my transaction was included in a block, and since then all blocks come one minute one after the other; is my transaction final?
In this case, the smallest values for
n are 3, 5, and 12, when the attacker has 20%, 30%, and respectively 40% of the total active stake.