5

Trying to understand how opensea "Make the bid" work. Whenever any interested buyer wants to buy an NFT, they have to create an offer,in which they basically sign a message(commitment)(which is not costing gas fees). I didn't understand how this thing works behind the scene. If, let say, i made an offer for 3 days and i won the bid or seller accepted the bid, and i don't have required ether(the bid amount) at that moment, then what will happen?

Auction smart contract basically take bidder amount as stake, and when auction end, if user doen't won the auction, transfer staked ether back, but in both the above process staking ether+paying transaction fees, these extra overhead is there.

Opensea doesn't follow staking of bidding amount and hence save user from paying transaction fees + staking ether. But they ask user to sign for confirmation of bid. Can anyone explain whats technically happening?

I have gone through below links also but this doesn't answer how opensea is working.

Link 1 : https://ethereum.stackexchange.com/questions/102660/creating-an-auction-smart-contract-without-storing-the-ether

Link 2: https://ethereum.stackexchange.com/questions/110749/auction-data-on-chain-or-off-chain

In link 2, they mention "Commitments are created by signing "messages". These are off-chain transactions. However, cancelling transactions requires posting on-chain." But how is it actually working?

Dummy Mail
  • 83
  • 5

1 Answers1

1

I'll explain how the newest version of Opensea works, called Seaport (docs).

If, let say, i made an offer for 3 days and i won the bid or seller accepted the bid, and i don't have required ether(the bid amount) at that moment, then what will happen?

Simply your offer won't be fulfillable. Opensea's UI should filter unfulfillable offers so they don't get accepted. If an offer is accepted by mistake, nothing bad happens, the transaction simply fails and no token is transferred.

The job of the smart contract is not to store offers, but to verify that an offer is valid and to transfer the tokens accordingly.

It may be a surprise, but the only data stored on the contract are the following mappings

// Track status of each order (validated, cancelled, and fraction filled).
mapping(bytes32 => OrderStatus) private _orderStatus;

// Only orders signed using an offerer's current counter are fulfillable.
mapping(address => uint256) private _counters;

The first mapping ensures that an order can't be fulfilled multiple times or if it was cancelled. (The order is recognized by its bytes32 hash).

The second mapping saves a counter for every offerer. Every offer has a counter parameter that should match _counters[offerer], otherwise it's invalid. This is a smart way to cancel all your existing offers, because you have a "cancel all" function simply increment your _counters.

This should have answered why to cancel orders you need to have a on-chain transaction. Because nothing guarantees that an offer is forgotten by everyone off-chain.

Opensea doesn't follow staking of bidding amount and hence save user from paying transaction fees + staking ether. But they ask user to sign for confirmation of bid. Can anyone explain whats technically happening?

The "confirmation of bid" is a wallet signature (EIP-712) necessary to make the process trustless. No one will be able to steal tokens by forging offers. The only trusting assumption is that Opensea won't hide an offer from a buyer/seller.

0xSanson
  • 718
  • 1
  • 2
  • 11