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

Klaus Kursawe, Vega’s blockchain researcher, will be here at 5pm (GMT) Tuesday 27th October to discuss Wendy Grows Up and all things related to fairness in transaction ordering on the blockchain, why it is a problem that needs to be solved and how we are researching this at Vega.

Feel free to post questions here beforehand.

Resources
Wendy Grows Up
Wendy, The Good Little Fairness Widget
AFT 2020 Presentation
Previous AMA on Wendy, The Good Little Fairness Widget
Wendy prototype running on a simulator

3 Likes

My first question, to kick things off, as Fairness is a massive philosophical question (like trust, another crypto favourite :slight_smile:). @klaus please define what you mean by ‘fairness’.

3 Likes

Could there be any connection/ link between UI/UX work/ research that is being done by @michael on order book design and @klaus research on fairness in blockchain? Could @klaus research lead not only to fairer order processing but also to potentially influence the creation of new innovative UI/UX design elements (tools/order book graphical representation/ wendy performance UI/UX representation/ way of incorporating wendy performance measurements/blocked transactions/ transactions that don’t need fairness into an order book processing UI/UX)?

4 Likes

Hey @klaus, looking forward to this, thanks. I’m interested in how this actually works with a blockchain … is it part of the blockchain or does it work outside it? Can you explain in really simple language please! :slight_smile:

3 Likes

Could this be used with other Cosmos chains? What about Ethereum?

3 Likes

how does ethereum do this now? what about uniswap?

3 Likes

While the security community has two good (and completely contradictory) definitions of trust,
but fairness is so far open; in the real world, it’s also a very subjective feeling. My
working definition is that a system is fair if, given full transparency on how it works,
all stakeholders are similarly (un)happy, or at least similarly enough that no stakeholder
group feels the need to opt out.
In an exchange, I would also argue that the exact definition of fairness depends on the market
we’re looking at - we would probably find it unfair if a rich investor bought up all food in
a remote island village, but completely ok and desirable if the same investor can trade
unconstraintly in gold. That’s why we don’t want to nail Wendy down to once technical
definition, but give wiggling room to market makers.

3 Likes

@Marcin:
The data is all made available, though for each block only to the validator that generated
the block, so we would need some more dispersal. The point that I can’t judge (maybe @michael
can say more to this) is its value for the UI; it’s probably fun to know these aspects (and good to
show that Wendy is active), but won’t impact the clients decision making on their trades much
(happy to be corrected here).

3 Likes

so who gets to define their own definition of ‘fairness’ and how do they do it?

3 Likes

Hi TraderSwift, Welcome first of all!

TO answer your question, Wendy is a bit of both; she is designed as an add-on to be integrated and be part of a blockchain, but also to be as independent as possible so that she has minimal impact on the blockchain implementation and can be used with as many blockchains as possible.
What Wendy does is to intercept all transactions, sort them according to fairness rules (which means some need to be grouped, some delayed, and some can pass through), and then hand them over to the blockchain for (mostly) normal processing.

4 Likes

Hi dearthmetalkoala,

Wendy is designed to be blockchain independent. There’s some aspects that make things easier and some that make them harder - for example, as Wendy needs all validators to talk to each other, she is generally easier to integrate in a BFT style protocol than a longest-chain based one (finality is another issue here that creates more work). The other factor is that we need to be careful that the blockchain internal mempool management doesn’t work against Wendy and tries to optimize by itself - Wendy does need to be able to dictate the mempool the order in which transactions can be processed, and enforce some grouping of transactions. Finally, we need to expand the block-validity function to verify that a block is correct according to fairness rules. There’s ways to work around most these issues, but it’s less pain if the blockchain cooperates.

4 Likes

so @klaus what does that add to performance?

4 Likes

Hey @klaus, why is fairness such a hard thing for blockchains to achieve?

3 Likes

Could this be used by a centralised exchange - some of them are pretty opaque and have been accused of running internal trading desks that front run their customers…

4 Likes

Ethereum essentially uses capitalistic fairness, whoever offers more gas can frontrun. I’m not sure if Uniswap has any fairness provisions, I think they essentially try to avoid the use cases where frontrunning can cause the most damage.

3 Likes

The current thinking is that marketmakers can define a fairness model when creating a new market, though it also is possible to make it changeable by governance vote (still need to discuss if that’s a good idea). Essentially, we would offer a library of fairness definitions the marketmakers can choose from; if there’s new definitions, they would need to be implemented (theoretically one could add some form of sandboxed programming language where marketmakers can write their own definition, but that seems a lot of effort for very little gain).

2 Likes

About performance: The communication overhead is one multicast from validators to each other (or for some blockchains to the next leader). This happens in parallel to the blockchain and thus doesn’t slow down the chain itself, but it does slow down the latency of some transactions. In our testruns, the number of transactions that were delayed (i.e., ended up one block later than they otherwise would) is about the ratio of message delivery time to blockchain finalisation time, so if a blockchain needs 10 rounds of messages to create a block, a bit more than 10% of all transactions get delayed by one block. There’s some overhead through the additional communication, and some computational overhead through additional signature verification that we haven’t measured yet, but that should be modest.

3 Likes

Consensus layer protocols do tend to get complicated as they always need to work on incomplete information - you don’t know which other validator is corrupt (or just crashed), so you need to make decisions before you get everyone’s opinion. For fairness, which intrinsically depends on the perception of other validators, this can be difficult to circumvent - that’s the reason why the most straightforward definitions for fairness turn out to be impossible to achieve, so we needed to find the right compromise to get what we want and still be able to do it

3 Likes

What kind of compromises have you made with Wendy because of things that are impossible to achieve?

2 Likes

I could be wrong but don’t lots of HFT trading strategies benefit from what basically amounts to legal frontrunning… does that mean those guys won’t trade on Vega?

2 Likes