---
# System prepended metadata

title: Untitled

---

**BID-BLOC**
<!-- [toc] -->
<!-- ### Why are auctions important? -->
> Auctions are ubiquitous in crypto. From Maker collateral auctions, to Flashbots’ sealed-bid blockspace auctions and NFT auctions on OpenSea, auctions are suitable for a wide array of situations where price discovery, liquidity, or allocation of scarce resources is needed, both on and off-chain     --[a16zcrypto](https://a16zcrypto.com/how-auction-theory-informs-implementations/)
> 
### What are Sealed Bid Auctions?
Sealed-bid first-price: Each bidder submits a sealed bid (e.g. in a sealed envelope) to the auctioneer/organizer. Once all bids are submitted, the auctioneer privately reads them and announces the winner (the highest bidder).
- Sealed-bid first-price auctions: The winner then pays the amount that they bid (Equivalent to English Auction)
- Sealed-bid second-price (the “Vickrey auction”): Yhe winner pays the amount of the second-highest bid.(Equivalent to Dutch Auction)
### Issues with the current auctions held on chain?
Most common auctions that occur onchain are *English* or *Dutch* auctions which sometimes lead to bidding wars and gas wars. With sealed bid auctions a user has no incentive to bid multiple times or use bots. Were as marketplace like opensea performs auction off-chain to save gas but there is trust involved. 


### How sealed bid auctions are currently organised?
> Web2 version
```mermaid
graph LR
server([trusted server])
user1 -->|bid| server
user2 -->|bid| server
user3 -->|bid| server
server -->|After deadline send prize to winner| winner

```


## Architecture
Main challenges to solve this problem:
1. The bids needs to be kept secret untill a certain point of time.
2. The bidders have to pay 3% commitment fee for each bid.

### Proof of collateral
> Shadow Vault
 
- users can **deposit** into the vault from any address and create ***commitments***
- users can only **Withdraw** at the end of the auction


### Auction Contract Architecture
This contract is responsible for managaing the auction process.
- submit sealed bids to a auction. we can use a merkel tree to records the **bid commitments** and store the root on-chain in the contract
- when auction ends. Record the winner and final price.

#### Option 1
modified commit reveal scheme.

```mermaid
graph LR
server([server/public mempool])
B1([Biders])
B2([Biders])
V1([Vault])
SC1([SmartContract])
SC2([SmartContract])
S{{winner is determined from all the revealed bids}}
subgraph _
subgraph commit[Commit Phase]
    B1 -->|deposits funds| V1
    B1 -->|commit bid on-chain & lock funds in vault| SC1
end

subgraph Reveal[Reveal Phase]
B2-->|reveal their commitments| server
S
winner -->|submits proof of winning|SC2
end
end
```
Cons:
- its a two step process. Users need to reveal their commitments at a later point in time. Big difference from the web2 counter part.
- User needs multiple wallets for effective privacy. :thinking_face:
 
#### Option 2
Using VDFs for reveal.

1. users commit by encrypting their bids 
2. the decryption key is revealed after solving a VDF(verifiable delay function)

Pros: 
- the userflow can be made similar to web2 counterpart.

Cons:
- No way of knowing when someone has solved the VDF. as they have no incentive to reveal the solution.

#### Option 3
Using a oracle network.

Similar to option 2 but a oracle publishes the public key with which every user will encrypt then after the time limit the oracle will reveal the private key so that everyone can decrypt. But now everyone needs to trust the oracle no different from the web2 version.
But we can decentralize it by using a network of oracles using [Shamir Secret Sharing](https://en.wikipedia.org/wiki/Shamir%27s_secret_sharing#:~:text=Shamir's%20secret%20sharing%20(SSS)%20is,together%20to%20pool%20their%20knowledge.) scheme to calculate the keys. So, for example an attacker need to control/corrupt 2/3 of the oracles to get access to the decrypting keys. 

We can also work on some tokenomics incentive and slashing mechanics to make the oracle network more decentralized and secure. 
Bid-Bloc is a platform where people create auctions for government contracts and procurement, as well as for auctions of high-value items such as artwork or real estate.
type of sealed auction where bidders submit their bids without knowing the amount of the other bids. The bids are then opened at a predetermined time and the highest bidder wins the item being auctioned.

