BSV
$53.8
Vol 30.1m
1.75%
BTC
$95982
Vol 40382.99m
-1.18%
BCH
$451.88
Vol 324.26m
-0.36%
LTC
$101.07
Vol 780.45m
1.33%
DOGE
$0.31
Vol 4487.72m
-0.04%
Getting your Trinity Audio player ready...

This post was first published on Medium.

Sealed auctions are a well-established method for trading and selling goods and services. With the advent of blockchain technology, sealed auctions can now be implemented on-chain, offering a number of advantages over traditional auctions.

Sealed Bid text on paper being put inside brown envelope.
Credit

In this article, we will implement of a collateralized sealed auction on UTXO-based smart contract blockchains such as Bitcoin.

What is a Sealed Auction?

A sealed auction is a type of auction in which bidders submit their bids privately, typically in sealed envelopes or electronically, without knowing the bids of other participants. The bids are usually submitted to a neutral third party, such as an auctioneer or organizer, who collects and then opens them at a predetermined time or date. This ensures that bidders cannot strategically adjust their bids based on the bids of others.

Sealed auctions have a number of advantages over traditional auctions, including:

  • Confidentiality: Bids are kept secret, which can be important for sensitive items or when bidders do not want their competitors to know how much they are willing to pay.
  • Efficiency: Sealed auctions can be conducted more efficiently than traditional auctions, as they do not require an auctioneer to be present.
  • Transparency: All bids are disclosed at the end of the auction, which ensures that the auction is fair and impartial.

Implementation

This sealed auction contract, ensures that bidders are penalized for abandoning the auction after submitting their bids. This is achieved by introducing collateralization.

Phase 1: The Bidding Phase

A user submits their bid in the form of a double SHA256 hash. This hash represents the bid amount, plus a random value (salt) to ensure its secrecy. This salt ensures that other bidders can’t determine the bid amount even if two bidders bid the same amount.

Bidders also lock up a specified collateral amount. This ensures that bidders have a stake in the auction and are less likely to abandon their bids.

Phase 2: The Reveal Phase

Once the bidding phase ends (as enforced by the contract using a time lock), the reveal phase starts. During this phase, bidders disclose their actual bid amounts.

The smart contract is designed to automatically track the highest revealed bid. It will store this information until the end of the reveal phase.

Phase 3: Close

  1. Auctioneer Withdrawal: After the reveal phase concludes, the auctioneer can withdraw the highest bid.
  2. Collateral Retrieval: Bidders can then retrieve their collateral. The winning bidder, however, only retrieves the difference between their bid and the collateral.

The full code of the smart contract is available on GitHub.

Collateralization

To prevent bidders from abandoning their bids, we will use collateralization. In this approach, bidders must lock up a specified amount of collateral when they submit their bids. If a bidder does not reveal their bid in the reveal phase, their collateral is forfeited.

Watch CoinGeek Weekly Livestream with Craig Mason: Bitcoin transactions at scale are cheaper

Recommended for you

Google unveils ‘Willow’; Bernstein downplays quantum threat to Bitcoin
Google claims that Willow can eliminate common errors associated with quantum computing, while Bernstein analysts noted that Willow’s 105 qubits...
December 18, 2024
WhatsOnChain adds support for 1Sat Ordinals with new API set
WhatsOnChain now supports the 1Sat Ordinals with a set of APIs in beta testing; with this new development, developers can...
December 13, 2024
Advertisement
Advertisement
Advertisement