The collateral mechanism is an important feature that has been designed to ensure successful smart contract execution.
โ
Collateral is a small amount of ADA (5-10) that is temporarily locked to help against malicious attacks, allowing the wallet to interact with smart contracts. You can get back that deposit at any time by turning off the collateral.
How does collateral help against malicious attacks?
"Without collateral, the user is not charged if a smart contract fails. However, by the time the transaction fails, the network has already incurred some costs to initiate and validate the transaction. This means that a malicious actor could flood the network with invalid transactions, denying service to other users at little cost.
โ
With collateral, when a user initiates a transaction, they commit enough ada to cover its execution cost. This amount can be small, but it is sufficient to make a denial of service (DOS) attack prohibitively expensive."