I am currently learning how the blockchain works, at its mathematical core. I would like to understand precisely why everyone in the blockchain game should trust everyone else to agree on the same status of the blockchain.
My question is: why do all agents consider the longest chain as the true one? Is it only because if they all do, the situation is a Nash equilibrium? Or is there another reason?
I will now make my question more precise. Let me first describe the blockchain model, maybe simplifying the things I think are irrelevant to the problem, in the form of a game.
Let $M$ be a nonempty finite set, the members of which are called miners. Let $W := M^*$ be the set of finite words in the alphabet $M$, the members of which are called states. Let us denote by $l$ the length function. The time of the game is $\mathbb{R}_+$.
Each miner possesses an infinite number of clocks that are manufactured by a trusted factory, and that are guaranteed to ring, once set up, after a random time of exponential law of parameter $1$, independently of every other clock. At time $0$, each miner sets up a clock, and every time a miner's clock rings, he/she sets up another one.
At every time $t$, each miner $m$ has a favourite state $w(m,t)$, and every miner knows which state is each other miner's favourite. At every time $t$, each miner $m$ is allowed to change its favourite state $w(m,t)$ to the favourite state of some other miner, or to the concatenation $w(m,t)+``m"$ if the miner's current clock is ringing exactly at this time.
At time $t$, if a state $w$ is the favourite state of a strict majority of miners, it is considered as the global state at time $t$. If, at time $t$, there is a global state $w$, the score of player $m$ is the number of times the letter $m$ appears in $w$.
We say that miner $m$ follows the $LS$-strategy ($LS$ stands for longest state) if, at each time $t$:
- if $l(w(m,t))$ is not maximal amongst $\{ l(w(m',t)) \ \vert \ m' \in M\}$, then change to any of the states that realizes the maximum;
- after that, if $m$'s clock is ringing, change $w(m,t)$ to $w(m,t)+``m"$.
Prop: If there are at least three miners, the situation where everyone follows $LS$ is a Nash equilibrium.
Informal proof: First of all, whenever there is a global state $w$, every miner should pick the global state as its favourite one. Indeed, as long as their favourite state $w(m,t)$ is different from $w$, their score does not increase, by definition; and the miners whose favourite state is the global one will statistically increase their own score and therefore will not want to pick $w(m,t)$ as their favourite state, since their letter appears less times in this state, so $w(m,t)$ will never become the global state.
Now, if all players follow the $LS$-strategy, at every time when no clock is ringing, all miners share the same favourite state, and each time a clock is ringing, then with probability one, there is only one clock ringing, and all miners change their favourite state $w$ to the concatenation $w+``m"$ where $m$ is the name of the miner whose clock just rang.
Now, if everyone but a single miner $m$ follows the $LS$-strategy, the game, for miners in $M\setminus \{m\}$, is not very much affected by the actions of $m$: since $m$ is alone, if his/her favourite state $w$ is not already the global state, it will very unlikely become the longest, and the others miners will never pick $w$ as their favourite state. Therefore, the only chance for $m$ to have his/her favourite state as the global one is to pick the global one as his/her favourite. $\square$
But, consider now the $S$-strategy ($S$ stands for selfish): miner $m$ never changes his/her favourite state to some other miner's favourite state, and always adds his/her letter to his/her favourite state when his/her clock rings.
Assuming everyone's clock has rang at least one, and everyone follows the $S$-strategy, there is never a global state; and I think no one should switch to $LS$-strategy in this situation.
So, in general, why does everyone choose the $LS$-strategy?
PS: I'm not sure I'm on the right stackexchange site, but I'm more mathematically-minded than anything else, and I prefer rigourous answers.
At a very surface level, suppose I want to add a fraudulent transaction to the blockchain, for instance, I want to add a block that says "Plop pays Oria 100 bitcoin".
I then mine the necessary hash, and happy with my results. But if everyone follows the largest chain, I will have to keep this going, I will have to mine more blocks, which I am unlikely to do fast enough alone, to outpace the main correct blockchain.
Eventually, the main blockchain with hundreds of miners will easily outpace me, and people will reject my fraudulent chain.