user4089: Many people wrote about the eUTXO model and the benefits it brings compared to Ethereum.
However, eUTXO also comes with some challenges.
In particular, eUTXO is susceptible to "economic denial of service (DOS) attacks".
Let me give you an example of an economic DOS attack.
Consider the following NFT-auction from the Plutus pioneer program: https://plutus-pioneer-program.readthedocs.io/en/latest/pioneer/week1.html
This contract is a simple auction where anybody can bid for an NFT until a specified deadline has passed.
However, this contract is vulnerable to an economic DOS attack where a malicious bidder creates a sequence of low bids that prevent other people from placing their bids (e.g. 0.001 ADA, 0.002 ADA and so on).
Such an attack is possible because each eUTXO can be spent only once, and if the attacker is faster than you, then you fail to place your bid on the Cardano blockchain.
It requires some technical sophistication to execute an economic DOS attack, but an average (non-technical) wallet-user cannot defend against it.
Although economic DOS attacks are also possible on Ethereum, it is much harder to execute them successfully within Ethereum's account model.
See the following paper for more details about economic DOS attacks:
https://docs.google.com/document/u/0/d/12atK0oEME0y1GHo_HmqhrcZ3pQeEqB_0tFKknhsjsLY/mobilebasic
So my question is:
(1.) How would you implement a Plutus-NFT-auction that defends against economic DOS attacks and (2.) how would you generalize a defense-pattern for other Plutus-contracts?

user1130: I can think of a different way to structure the contract to avoid this attack.
If you allow all the bidders to lock up their funds at the same time, in separate UTxOs, the auctioneer could just choose which to accept when the deadline has past. This works in Plutus because you can redeem multiple datums in a single transaction, and have the validators check that the other UTxO is being spent, i.e. the PickWinner redemption path for a Auction datum would requires a Bid datum get redeemed as well, and vice-versa.
And say someone wants to update their bid, the Bid datum would have a redeemer of Update, otherwise your funds are locked until after some grace-period has passed.
This might come with some drawbacks, like the opportunity cost of all the losing bids being locked up, but I can think of ways to minimize those pain. In many cases, it seems like a reasonable cost to pay regardless.

user2537: These types of attacks are inherent to the auction model and are not dependent on the technology used. To protect against these, auctions have a minimum bid increase. Other solutions would be (i) a whitelist of known wallets making sure that every participants has at most one wallet, or (ii) bidding fees making DoS attacks expensive.
If you want to run an auction without identity control opened to the general public, minimum bid increases would be the way to go, in my opinion.

4089: <p>Many people wrote about the eUTXO model and the benefits it brings compared to Ethereum.
However, eUTXO also comes with some challenges.
In particular, eUTXO is susceptible to &quot;economic denial of service (DOS) attacks&quot;.</p>
<p>Let me give you an example of an economic DOS attack.
Consider the following NFT-auction from the Plutus pioneer program: <a href="https://plutus-pioneer-program.readthedocs.io/en/latest/pioneer/week1.html" rel="noreferrer">https://plutus-pioneer-program.readthedocs.io/en/latest/pioneer/week1.html</a>
This contract is a simple auction where anybody can bid for an NFT until a specified deadline has passed.
However, this contract is vulnerable to an economic DOS attack where a malicious bidder creates a sequence of low bids that prevent other people from placing their bids (e.g. 0.001 ADA, 0.002 ADA and so on).
Such an attack is possible because each eUTXO can be spent only once, and if the attacker is faster than you, then you fail to place your bid on the Cardano blockchain.</p>
<p>It requires some technical sophistication to execute an economic DOS attack, but an average (non-technical) wallet-user cannot defend against it.
Although economic DOS attacks are also possible on Ethereum, it is much harder to execute them successfully within Ethereum's account model.</p>
<p>See the following paper for more details about economic DOS attacks:
<a href="https://docs.google.com/document/u/0/d/12atK0oEME0y1GHo_HmqhrcZ3pQeEqB_0tFKknhsjsLY/mobilebasic" rel="noreferrer">https://docs.google.com/document/u/0/d/12atK0oEME0y1GHo_HmqhrcZ3pQeEqB_0tFKknhsjsLY/mobilebasic</a></p>
<p>So my question is:
(1.) How would you implement a Plutus-NFT-auction that defends against economic DOS attacks and (2.) how would you generalize a defense-pattern for other Plutus-contracts?</p>
 1130: <p>I can think of a different way to structure the contract to avoid this attack.</p>
<p>If you allow all the bidders to lock up their funds at the same time, in separate UTxOs, the auctioneer could just choose which to accept when the deadline has past. This works in Plutus because you can redeem multiple datums in a single transaction, and have the validators check that the other UTxO is being spent, i.e. the <code>PickWinner</code> redemption path for a <code>Auction</code> datum would requires a <code>Bid</code> datum get redeemed as well, and vice-versa.</p>
<p>And say someone wants to update their bid, the <code>Bid</code> datum would have a redeemer of <code>Update</code>, otherwise your funds are locked until after some grace-period has passed.</p>
<p>This might come with some drawbacks, like the opportunity cost of all the losing bids being locked up, but I can think of ways to minimize those pain. In many cases, it seems like a reasonable cost to pay regardless.</p>
 2537: <p>These types of attacks are inherent to the auction model and are not dependent on the technology used. To protect against these, auctions have a minimum bid increase. Other solutions would be (i) a whitelist of known wallets making sure that every participants has at most one wallet, or (ii) bidding fees making DoS attacks expensive.</p>
<p>If you want to run an auction without identity control opened to the general public, minimum bid increases would be the way to go, in my opinion.</p>
