We are creating a payment processor. The business wants to send users a product when they receive a payment. This is easy enough using the cardano-wallet api. However, we were made aware of the existence of rollbacks on the chain. In the event of a rollback, what is the best practice for handling a change?

For example we may have detected a payment for 30 ADA. A rollback occurs, and that payment is removed from the chain history. How do we detect that this happened? How can we have confidence that a payment will not be rolled back before sending the customer the product?

1 Answer 1


In a perfect network setup rollbacks should not be happening. It is also down to your business decision of managing risks -- deep rollbacks are very rare but possibile nonetheless.

Shallow rollbacks (depth 1-3) do happen on occasion, perhaps once or twice a day. This happens because of the way the Praos protocol is selecting the block leaders and this relates to slot battles. Those are local rollbacks, most of the time happening to the cluster of nodes, not the whole network. This is considered to be a healty operation of the network.

Deeper rollbacks are happening less often (rare) and might be a sign of malevolent actor in the network. Block is stable when it is securityParam (currently 2160) blocks deep. So to be 100% sure you might wish to wait for that number of confirmations.

refer to CIP-9 for details on securityParam

you might check the current value in cardano-node repo

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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