Wendy Grows Up - let's talk about Fairness - Ask me anything

I donā€™t think it could; the issue weā€™re dealing here is one that decentralisation brought upon us, and unless the centralised exchange internally works like a decentralised one they wonā€™t have the issues weā€™re solving here. We are going the other route though and looking into countermeasures some centralised exchanges thought of to stop the arms race to get faster and faster connections, and considering if some of those could benefit Wendy to make her even more fair (and avoid that high-paying traders start another arms race to have the fastest average connection to all validators).

3 Likes

@Marcinā€™s comment made the think about order book replaying particularly if/when you suspect youā€™ve been cheated. So perhaps this is something we can think about in the Vega block explorer.

The recent order book research has been about viewing live data. In the block explorer Iā€™m imagining something that allows you to replay the order book one order at a time. Perhaps from there you can dive into something that shows you how the blocks you are interested in were composed. or maybe there is a way to show both at once. its an exciting idea.

4 Likes

The most obvious fairness definition one would like is along the lines

ā€œIf all honest validators receive transaction a before transaction b, then a must be scheduled before bā€.

For that one, we can prove that it cannot be fully achieved; there are cases where transactions come in in an order where itā€™s undecideable what is fair according to that definition. So one compromise is to go for a weaker definition:

ā€œIf all honest validators see a before b, then a is in the same or an earlier block than b, and we provide enough information to make a best-effort in sorting them according to the first definitionā€.

Thereā€™s some other impossibilities, and other fairness definitions that get around them, but that is the main one (let me know if you need more details here)

2 Likes

Iā€™m not sure how many HFT traders want to go to decentralised anyhow, as it will always be slower than centralised. But the main point is that we want to give market makers a choice - you can create a market without fairness (and thus have the HF traders in and maybe lose the traders that donā€™t want to compete there), or you can create a fair market where HF trading makes less sense but LF traders feel happier.

2 Likes

@klaus worth mentioning the simulator that has a version of Wendy running on it to test performance.

1 Like

One thing to add to performance - if a market maker sets up a market without fairness requirements, then those transactions are passed right through Wendy, and thus shouldnā€™t see any performance impact at all.

1 Like

Indeed, itā€™s a prototype version of Wendy on a simulated network and blockchain where we can see Wendys impact on various network behaviours and blockchains. It is the full protocol, with some details (like signing messages and some robustness tests) left out for now.

2 Likes

Thanks @michael yes I was thinking of a visual representation of how well wendy is working. The order book is perhaps not the best place but yea maybe block explorer. I think that would be quite cool to have.

4 Likes

It would also be real nice to add a better visualisation to the simulator and a good attack interface so people can see how Wendy behaves under specific attacks. That would more be a project for a master student though, as - as cool as it would be - we first have a product to launch before we can do that. So if anyone knows someoneā€¦

2 Likes

Yeah, I look to IEX as an interesting case study in terms of how ā€œfairerā€ market designs compete with ā€œless fairā€ but deeper liquidity venues. Thereā€™s a cost of not being able to access liquidity, just as there is a cost of being front-run. As rational trader, your aim is to try and minimise these costs in totality - and what you find is that many times the price you can source liquidity at will make it worth your while paying the ā€œspeed taxā€ extracted by HFT types (upsetting though that may be). At Vega weā€™ve taken the approach of developing attractive native liquidity incentives and cheaper, broader access which should mean that such a global, trading system could win on both fronts :smile_cat:

1 Like

I love that idea!! Sounds like a fun hackathon or bountyā€¦ ping us if youā€™re interestedā€¦

1 Like

One additional aspect we see a lot that many projects see their blockchain as a black-box and focus on the application design - if we look at the crypto space now, thereā€™s not that much more people working on the actual consensus level than there where 20 years ago, but many more with usecases (which is great - when I first worked on consensus around 2000 I eventually abandoned the topic because - as cool as it was back then already - we just couldnā€™t find the killer usecase. Thus I am grateful for any good usecase unless itā€™s people confusing the blockchain with Santa Claus). This means too many projects donā€™t even work around it, but are unaware that ordering attacks are a possibility.

2 Likes

Anyone I forgot or any answer that didnā€™t quite fit the question ?

1 Like

And for students/lecturers here, we can co-supervise a thesis as well

2 Likes

Okey dokey ā€¦ thatā€™s all for now folks! Thank you to the wonderful @klaus for the 1000 years you have been working in blockchain :wink: ā€¦ and for your time and knowledge. Always a treat.

If you come up with any questions later on please feel free to continue to post here and we will answer. Otherwise look out for @klausā€™s latest blog on Wendy coming to Medium in the next few days (Iā€™ll post here when it is published).

Cheers dudes, hereā€™s to Fairness, thatā€™s a wrap :kissing_heart:

3 Likes

Why does the paper propose different definitions for fairness?

1 Like

Hi dvglass,

the issue is that the most straightforward definition for fairness - if all honest validators see a before b, the a i scheduled before b" can be proven to be impossible to achieve. The alternative definition(block order fairness) - assuring that at least a is in the same or an earlier block than b, and beyond that itā€™s best effort - is possible, but can lead to extremely large blocks under some circumstances (this is laid out in the original paper in more detail). The original idea for the two definitions was to use a weaker form of fairness (the timed fairness) to resolve these cases. This means the protocol would implement block order fairness, but measure if the block would get too large. If that is the case, it switches to timed fairness, resolves the issue, and switches back to block order fairness.
In Wendy 2 we expand that concept; as we have different definitions of fairness and the ability to switch anyhow, the protocol now can support additional definitions (such as including a priority treatment), and the marketmakers can choose which definition their market uses.

1 Like

Hey @klaus one thing I could not get my head around regarding Wendy, is that I thought Wendy talks about which blocks transactions should be scheduled in based on when they are observed by different nodes in the network. Could be a misunderstanding on my part, but isnā€™t ordering within the block essential for trading, and ultimately the reason front-running is possible on Ethereum (paying higher gas does not only guarantee you are included in a block ahead of the competition, but actually guarantees your position within an individual block)?

How does Wendy ensure that transactions are ordered correctly within each block, such that the outcome of a sequence of trades is deterministically as fair as possible?

2 Likes

Hi Fred,
thanks for this question, it is a point I definitively need to highlight more. Wendy is in this sense essentially a two stage protocol - the first stage is to achieve block order fairness, the second one is to achieve fairness within a block (Itā€™s like me cleaning up - first all books go into the library and all food into the pantry, and then I go through those two rooms and sort things into shelves).
The reason for this is that the two stages handle different problems. Putting things into the right blocks is a distributed protocol level problem, where I need to handle byzantine inputs, unreliable timing, try to keep communication complexity down etc. Doing the fine grained sorting is an algorithmic problem; the main issue here is that (for some definitions of fairness) I might have sets of transactions for which it is undecideable who needs to come first, and need to deal with that somehow. In the absence of these sets, the algorithm is straightforward (Wendy does make sure it gets all the information it needs), and the combination of the block order and the postprocessing order is giving us the fairness definition we want (e.g., if all honest parties see a before b, than a is scheduled before b). If we have such an undecidable set, the algorithm needs to make a best effort, and might for example just randomize the order inside the undecidable set; the right behaviour here also depends a bit on the use case.
Wendy is focusing on the block level part as this is the (protocol-design wise) hard one; the fair order inside a block is easy where possible, and a policy decision where not.

Please let me know if that answered the question correctly; it is an important feature and somewhat complicated to describe properly.

2 Likes

This reminds me of replaying a chess match on a computer. Itā€™s a visualisation that would be really cool to see, but perhaps unnecessary if we already have faith that the blockchain is fair?
It would be great to see on a CEX, but then we couldnā€™t trust the replay anyway! :rofl:

1 Like