0

I am writing a book about cryptocurrency history. I have questions about 0x, Etherdelta, and IDEX.


Question 1. This is the last trading process from 0x whitepaper page 5.

  1. Taker submits the makers signed order to the DEX contract.

  2. The DEX contract authenticates makers signature, ... transfers tokens between the two parties...

It sounds like the taker generates only 1 transaction for #6 above, not 2(one for Maker order, another for Taker order). Correct?


Question 2. IDEX blog says this for the similar step of the trading process.

  • After the trade has been reached in the queue, the maker’s transaction is dispatched to the ethereum blockchain.

  • The maker’s transaction is mined and the order is added to the internal order book in the smart contract.

  • After the maker’s order has been mined, the taker’s transaction is dispatched to the ethereum blockchain.

This sounds like 2 txs, 1 maker order and 1 taker order. Correct? If indeed 2 txs, why the difference from 0x and EtherDelta? (Assuming 0x and EtherDelta had 1 tx only.)

FYI, I am not a developer.

1 Answer 1

1

👋 nice to meet you! Let me respond to the first point above (I'm unaware of IDEX).

Below is an example 0x V4 order that swaps an NFT for 20 MATIC

{
    "erc721Token": "0x26970ceb166b71db3480b7464387f793a570259a",
    "erc721TokenId": "2",
    "direction": "SELL",
    "erc20Token": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
    "erc20TokenAmount": "20000000000000000000",
    "maker": "0xee165e50bf52e1b9e3a8a74ab9b2ea6f268c5ae9",
    "erc721TokenProperties": [],
    "fees": [],
    "expiry": "1846785190",
    "nonce": "100131415900000000000000000000000000000127568926376844443394699692469437845268",
    "taker": "0x0000000000000000000000000000000000000000",
    "chain": "POLYGON"
  }

In 0x, the taker submits a single transaction to the DEX contract that includes the signed order from the maker and the taker's order. The DEX contract authenticates the maker's signature and then executes the trade by transferring the tokens between the two parties. The maker does not need to submit a separate transaction for their own order (unless they use the preSign feature - but we won't get in to that).

To be more clear, the order of operations is the following:

  • Maker 0xee165e50bf52e1b9e3a8a74ab9b2ea6f268c5ae9 creates the order above
  • Maker signs the order (hash) off-chain - this generates an off-chain signature
  • Maker passes the order and the signature to the taker
  • Taker sends a transaction to the 0x DEX and triggers buyERC721 function. This function verifies the signature of the maker (that is passed in the calldata of the transaction) and performs the swap.

Hope that clarifies! feel free to reach out for more questions, I'm definitely curious about your book 😃

1
  • "Maker passes the order and the signature to the taker" Do you mean Maker attaches the signature to the order on the off-chain orderbook server? Though I guess Maker could directly send the signature via email or IM, that's not the standard 0x process, right? Thank you very much for your reply, by the way. Commented Jan 18, 2023 at 6:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.