So how do I win in a buyback?

So in the previous section the trivial rules were covered. Now it is time to answer the question most people will be seeking for:

How can I make sure I can participate in the GET Protocol buyback?

Well, first and foremost, it is, to my knowledge, impossible to make it so that you will always win. This is due to the fact that blockchains have several processes that are not deterministic, meaning that there are certain crucial pieces of information we can mathematically not know in advance. However it helps to understand this game of chance better, just like it helps to understand blackjack odds better when playing it in a casino.

A word of warning. In order to actually articulate an answer to this question, I cannot prevent going granular as **** about how the blockchain works. So excuse me for that, but that is just the way it is. Let’s go deeper.

Lets first break down the winning-question into components. If you want to participate in the buyback you must first make sure that your transaction is included in the first block that is Timestamped after the start of the auction. So, posed as a question:

How can I make sure that my transaction is confirmed in the first block that is timestamped so that the transaction will be valid for the buyback auction?

Again, this is not possible due to POW not being deterministic. Thus one cannot know when exactly miners will find a block — only roughly estimate it. The GET Protocol team that is setting up the auction also doesn't know beforehand which will be the first valid block of the auction. It is a game of chance all the way down.

A few minutes beforehand one closely looking will be able to, within a margin of error of 2 or 3 blocks, predict which blocks will likely be among the first valid buyback blocks. However, this prediction is far from an exact science and as there are other random variables at play I do not think that this constitutes any significant benefits. Meaning that somebody eyeballing the current block on Etherscan will have roughly the same chances (I cannot be definitive as I didn't do a statistical test).

An extra layer of randomness is introduced by the fact that the winning miner might timestamp their found block differently than the official system time. This might sound strange, but it makes sense when you consider that all miners are individually trying to maximize their profits. To understand this we need to briefly discuss the rules surrounding timestamping of found blocks.

Miner timestamping rules

The miner that processed/found a block has to timestamp it. These miners timestamp blocks such that it will increase the probabilities that their block will form part of the main chain (so that it will not become an uncle block). They will thus choose a timestamp that maximizes their economic output. This doesn't always mean they will use the current system time!

Stackoverflow: A block mined by a miner that sets their computer time ahead of the current “real” time will have their winning block rejected by other Ethereum nodes. Other miners on the Ethereum network will continue mining on the latest valid block.

In Ethereum, the only rule about block timestamps is that the timestamp must be incrementing the previous timestamp of the previous block. There is no other rule. The source for this statement is the Ethereum whitepaper in the section covering mining and block stacking rules.

During the Q4 '18 buyback, some participants sent their transaction a few seconds after 12:00, to later find their transaction was confirmed 25 seconds before noon. How is it possible the transaction was confirmed in the past?

My theory about timestamping 'in the past'

Miners have some margin in setting the timestamp of the found block. In my interpretation of the material available on the subject, there are game theoric motivations why miners sometimes might ‘backdate’ a found block instead of stamping the universal time system. Here goes my theory:

A miner(A) that found a new block (5) does not know if another miner anywhere else on the network also found that exact same block. To increase the chances that the block found by miner A will be part of the main-Ethereum blockchain (and will not become an uncle block, which will mean a lower mining reward) miner A will choose a timestamp to that increments the timestamp of the previously found block. This increment will be kept as small as possible by the miner, as it is possible a different miner somewhere already found that same block and the block following it. Due to this minimisation of, the increment the timestamp of the block will, by definition be a bit in the past. Remember that in blockchain systems there is no central clock source telling the time (that would introduce centralisation after all). All miners keep an own clock, timestamps of miners will thus reflect this. The ETH mining rules indicate that the timestamps of subsequent blocks must always move forward. So for miners it is safer to add a timestamp to a new block (5) that is a bit in front of the previous block (4), as the timestamp of the previous block (4) is already known. The timestamp of the next block (6) is unknown as it is not found yet, and as the miner does not know who will find that block and what incentives this miner will have it is safer to backdate and make sure the block is not cut off by a mining pool that is trying to become the main chain, thereby 'uncling' the current longest chain.

It’s a rabbit hole, but a game of chance in the end

This is an oversimplified theory of my own — if you see mistakes let me know... I did a lot of research to even be able to draft this. It is important to note that even with this knowledge, I do not have a greater chance of participation with a buyback. After all, it is clear that it is more a matter of chance than of scripting (how Gwei fits into this will be explained in a bit). Miners and mining pools are playing a game of chance based on private information. For a non-mining observer, it would be like betting on the outcome of a poker game without seeing the player's cards but only the open cards on the table which is a remarkably good comparison actually.

Mining pool strategies, embrace the chaos

As the Ethereum blockchain is built on fundamentals that maximize decentralization, one can endlessly theorize about why actor A would do Y. At some point, we'll have to just accept that there is a random component.

I haven't considered the many possible strategies mining pools can use to ensure their blocks will not be uncled. Selecting strategic timestamps can be a tool to ensure that newfound blocks of a mining pool will not be orphaned (or inversely, strategic timestamps can be used to uncle blocks of an opposing mining pool). As I mentioned earlier, the way consensus works on a granular level is very complex and goes far beyond the scope of this blog.

How about selecting a high amount of Gwei? Does that make my odds larger?

Well, maybe. A high Gwei amount added to the transaction will make sure the transaction is confirmed faster and will have a higher index/position within the block it is added to. Thereby increasing the odds for being accepted only when the block is timestamped in a block that is valid for the buyback.

Looking at the transactions of the winners of the first two buybacks I concluded that these between 20–90 Gwei. This is slightly above the average Gwei rate for transactions but not extreme by Gwei-war standards. In addition, it is a Gwei price that is not economically excluding participants by a huge margin.

More about Gwei, transaction position & index

Source: JGM Orinoco. How blocks are selected from the transaction pool by miners.

The obvious question is “how do miners select which transactions to put into their block?”, to which the answer is: “money”.

Every transaction submitted to Ethereum has a number attached to it that represents the number of funds that the submitter is willing to pay the miner to include the transaction in their block, known as the Gwei price. When a miner examines the transaction pool and sees two otherwise identical transactions it will pick the one with the higher Gwei price, as that will result in more money being paid to the miner when the block is mined. Source: Blog of JGM Orinco.

Helpful knowledge for a more equal playing field

Within an Ethereum block, transactions are sorted by the miner based on the amount of Gwei set by the sender of the transaction. Source: Blog of JGM Orinco.

If you notice the picture to the left, the miners store all the transactions in the pool sorted by Gwei. The higher the Gwei price, the more likely the transaction is included in the next block.

This is the common configuration for a miner node (to optimize for higher profits). However, a miner can configure her node to sort the transactions however they like (say they want to help the network by mining only low gas transactions). Source: Blog of JGM Orinco.