Cow protocol currently conducts an off-chain auction, where external parties, known as solvers, apply different strategies to propose competing solutions.
Currently, the autopilot service is responsible for maintaining the order book and arbitrating the solver auctions. It maintains all the user orders, invokes the solvers at the auction start, collects solutions (bids) by solvers, chooses the solution that maximizes the score, and informs the relevant solver to settle on-chain.
The autopilot service represents a single point of failure for the entire CoW protocol. Users and solvers must trust it not to censor orders and solver bids, as a malicious service could compromise auction safety without being held accountable. Furthermore, CoW Core, the entity responsible for operating and maintaining this service, faces potential legal and compliance risks in the evolving regulatory environment.
In this proposal, we provide the first practical step towards decentralisation. We propose moving the solver auctions to use pod network. pod is a programmable L1 that is designed to conduct real-time censorship-resistant auctions. The proposed design enables extending the system further to decentralize the order book, which would eliminate the need for the autopilot service.
Existing solutions do not work.
Informally, conducting auctions requires that users be able to:
(i) bid until the deadline;
(ii) fetch the set of bids after the deadline and find the winner locally.
The order of bids is irrelevant. The auction protocol should be fast to operate intra-block and with a minimal latency overhead, maximizing the time available for solvers to compute optimal solutions.
Existing primitives either do not provide the required interface or are not efficient:
- Decentralized Storage and Data Availability systems cannot enforce the auction deadline.
- Consensus Protocols (existing Blockchains): Consensus protocols (Blockchains) require several rounds of communication, making them slow for conducting inter-block auctions. Consensus protocols are also prone to short-term censorship. L2s rely on a centralised sequencer, which would not provide any improvement over the autopilot.
For more information, read our blog post on why blockchains are a bad fit for fast auctions and our report evaluating potential solutions to decentralize the Flashbots PBS auction.
Overview
pod is a programmable layer-1 primitive designed to facilitate censorship-resistant real-time auctions. pod finalizes transactions in a single network round-trip (<150ms), validating each transaction completely independently, maximising parallelism. Unlike consensus protocols, pod does not totally order transactions, which is an acceptable trade-off for auctions, but is necessary to achieve this level of efficiency.
For CoW auctions, we implement optimistic single-shot transparent auctions. These auctions take place on a CoW pod subnet but settle on the original network where the liquidity lives, such as Ethereum.
Protocol. Bidders submit their bids through the auction contract on pod, subscribe to the network for other bids, and the auction deadline. The network notifies the bidders that the deadline has passed, and no new bids can be confirmed for this auction. The bidders then look at their local bidset, and the winning bidder declares their victory optimistically by executing their proposed solution on-chain.
Since there is no strong consensus, participants may occasionally see different sets of bids and identify different winners. However, this can only occur if some bidder misbehaves—in which case they are held accountable and their stake is slashed on Ethereum. Similarly, if a winning bidder fails to declare their victory, they can be held accountable and slashed.
Check out the single-shot auction paper for the detailed pseudocode and analysis of the construction.
Rollout. Initially, the pod system will run in addition to the centralised auctioneer and only log its results (shadow-mode). This allows to measure the latency of the new system and simulate that the behaviour is indeed identical to the current auction. Over time, the winner selection can gradually move from the autopilot to pod. Note that this will need a CiP, requiring all solvers to update their drivers to post their bids on pod. There will be a canonical implementation for a pod-compatible driver, but solvers will also be able to implement their own. Optionally, the current autopilot will be able to act as a circuit breaker that observes pod and the L1 chain, and performs accounting and emergency interventions in the case of misbehaviour.
Staking & Gas. The pod-cow subnet will use the top n (~60) addresses that have staked COW tokens in a staking contract as the active validator set. Solvers are expected to pay gas in ETH for bidding in the network. This amount can be 0 in the shadow mode.
Auction Flow
- Auction starts: Autopilot announces a new batch of orders and provides a deadline for solutions.
- Solution submission: After the driver calculates a solution, it submits a transaction on pod that calls
submitBid
function on the auction contract and receives a certificate that the solution was included. Solutions must reach a supermajority of the pod validators before the auction deadline. - Waiting for other solutions: The solvers subscribe to pod with
eth_subscribe
RPC to receive bids. The solvers also subscribe to a custom eventpod_pastPerfectTime(auction_deadline)
. After this event, the protocol ensures that no new bids can be confirmed. - Computing the winner: The solvers look at the local set of bids they have received so far, and compute the maximum.
- Settlement: The solver with the highest bid announces themselves as the winner on the settlement contract, providing proof that he submitted a bid on time.
Dispute resolution
As in the existing autopilot-based auction, the settlement contract allows a solver to claim that he is the winner. In order to make the settlement efficient in the case of no misbehaviour, this claim is not immediately verified by the smart contract. Instead:
- If a bidder falsely claims to be the winner without being the highest bidder, any party can show a higher bid that was confirmed on pod to slash the false winner.
- If a bidder wins the auction but does not show up, any party that has seen the winning bid being submitted on pod can slash the winner.
The dispute resolution smart contract leverages transaction confirmation certificates generated by pod which are efficiently verifiable on-chain.
Check out the auction paper for the complete pseudo-code and auction analysis.
References
- Proof of concept integration that provides a foundation for the first milestone: Comparing cowprotocol:main...podnetwork:feat/pod · cowprotocol/services · GitHub
- Documentation for the pod devnet: https://docs.pod.network
- Similar integration, using pod for PBS auctions for Flashbots’ rollup-boost stack: pod-sdk/examples/optimism-tx-auction at main · podnetwork/pod-sdk · GitHub
- pod auction explorer: https://explorer.pod.network