OptimalBlockDelayTimeToBlockTimeRatio

Hedge By Bitcoin | Memberswill go by tor | RecentChanges | Join |

Practically, miners do not need much knowledge of calculus, they just include transactions into the block by the ordering of fee per byte. As transactions of zero sat per byte is no beneficial and only increase the possibility of doing mining job without payoff, miners will not accept zero-fee transactions. As the block is getting bigger with higher lucrative transactions till the size with the highest expected value of the block fee, the miners stop including additional lower fee transactions into the block. The theoretical analysis is as below.

By knowledge mentioned in EstimateBlockFee and BlockIntervalTime, one can derive the optimal ratio about the delayed time of block propagation. When miners assess zero revenue for orphan probability and aims to maximize the the expected value of the block fee, they come to maximize

I(NnA)e BMTI\left(\frac{N}{n A}\right)e^{-\frac{B}{M T}}

or in case of exponential payment distribution:

NnA(1ln(NnA))e BMT\frac{N}{n A}\left(1-\ln\left(\frac{N}{n A}\right)\right)e^{-\frac{B}{M T}}

With x being defined such x = B / MT = ND / M and k being defined k = M / DnA , this formula is translated to

kx(1ln(kx))e xk x (1-\ln(k x))e^{-x} which is maximized at x when ln(kx)=xx1\ln(k x)=\frac{x}{x-1}

When k is large, the optimal x approaches zero. As mentioned in a long run the n or A may adapt with the x decided by the miners to have long term kx being 1 and then the expected value becomes e xe^{-x}

More precisely, the orphan does not necessarily mean zero revenue because either chain might lose or not. With knowledge mentioned in ScaleDebate, the overall impact is the reduced coin price and production efficiency and the miners are to maximize NnA(1ln(NnA))×(1x1+x(1h))=kx(1ln(kx))1+hx1+x\frac{N}{n A}\left(1-\ln\left(\frac{N}{n A}\right)\right) \times (1-\frac{x}{1+x}(1-h))=k x (1-\ln(k x))\frac{1+h x}{1+x} which, being decreasing beyond 1/k, is maximized at x when ln(kx)=(h1)x1+2hx+hx 2\ln(k x)=\frac{(h-1)x}{1+2h x+h x^2}

When block reward R and network latency l being ratio of connection latency time to block time are considered, the maixmization is about the revenue per unit of time:

(RT+kqVx(1ln(kx)))1+h(l+x)1+(l+x)\left(\frac{R}{T}+k q V x (1-\ln(k x))\right)\frac{1+h(l+x)}{1+(l+x)}

It shows that considering latency and R / T being constant for design, the latency ratio shall be as small as ideal which means the block time shall be long rather than short. Further, the optimal x which must be between 0 and 1/k happens when

ln(kx)=(RkqVT+x)h1(1+hl)(1+l)+2h(1+l)x+hx 2\ln(k x)=\left(\frac{R}{k q V T}+x\right)\frac{h-1}{(1+h l)(1+l)+2h (1+l)x +h x^2}

Two calculation examples assuming zero latency and zero block reward.

  • M = 5 mega byte, D = 266 byte, nA = 1000, a miner with h = 10%, then k = 19.71, the optimal x is 0.0486, meaning the tx queue ratio N / nA being 95.79%, the optimal block size being 145.8 mega byte, the loss of production efficiency due to orphan/reorg being 4.17%.
  • M = 5 mega byte, D = 266 byte, nA = 100000, a miner with h = 10%, then k = 0.1971, the optimal x is 1.9, meaning the tx queue ratio N / nA being 37.45%, the optimal block size being 5700 mega byte, the loss of production efficiency due to orphan/reorg being 58.97%.

Two calculation examples assuming 0.02 latency and 50 block reward.

  • M = 5 mega byte, D = 266 byte, nA = 1000, a miner with h = 10%, then k = 19.71, the optimal x is 0.0164, meaning the tx queue ratio N / nA being 32.32%, the optimal block size being 49.2 mega byte, the loss of production efficiency due to orphan/reorg being 3.16%.
  • M = 5 mega byte, D = 266 byte, nA = 100000, a miner with h = 10%, then k = 0.1971, the optimal x is 1.3833E-48, effectively accepts no tx and results in empty blocks and the loss of production efficiency due to orphan/reorg being 1.76% as consequence.

One calculation example of mining monopoly where h is 1.

  • The optimal x is 1/k and the miner doesn't care how big/latency a block could be. Even 1/k is greater than 1, the miner simply puts all the transactions during time T into the block and cares nothing for its transmission because the miner is the only mining force, pretty much like a fiat money and the story of some chain.

Note that for generic transaction fee distribution G, the goal is to maximize

(RT+qV 1kx 1G 1(y)dy)×1+h(l+x)1+(l+x)=(RT+kqV 0 xG 1(1ku)du)1+h(l+x)1+(l+x)\left( \frac{R}{T}+q V \int_{1-k x}^1 {G^{-1}\left( y \right)d y} \right) \times \frac{1+h(l+x)}{1+(l+x)}=\left( \frac{R}{T}+k q V \int_0^x {G^{-1}\left( 1-k u \right)d u} \right)\frac{1+h(l+x)}{1+(l+x)}

and the optimal equation is

G 1(1kx)RkqVT+ 0 xG 1(1ku)du=1h(1+(l+x))(1+h(l+x))\frac{G^{-1}(1-k x)}{\frac{R}{k q V T}+ \int_0^x {G^{-1}(1-k u) d u}}=\frac{1-h}{\left( 1+(l+x) \right) \left( 1+h(l+x) \right)}

and similar stories like the exponential distribution assumption will be told.

Also note that the two maximization using orphan probability vs using efficiency loss agree on the first order by the Taylor series expansion at x = 0 when the miners are small meaning h being almost zero. Again, in a long run the n or A may adapt with the x decided by the miners to have long term kx being 1 and then the expected value becomes 1+hx1+x\frac{1+h x}{1+x}. By the point of view of the macro, it is the reduced price of the coin and a regular block fee of qVT. As time goes by, k increases because miners choose higher M for the sake of higher block fee without sacrifice the security as mentioned in AttackCost.


While one may argue that the block size B is not the "transmitted" block size thanks to the fact that miner may see many transactions already, in which only 6 bytes check sum is transmitted rather than the whole D.

It comes to some modeling of probability of knowing at time T of a transaction broadcast at time t during the time interval 0 to T, w(t). Then the average transmitted block size B will be

B=N× 0 t(6w(t)+D(1w(t)))dtB=N \times \int_0^t { \left( 6w(t)+D\left(1-w(t)\right) \right) d t}

So the above reasoning remains but for a smaller effective D. For example of a simple modeling, the transaction information before timing t is of the size DnAt and is broadcast to the miner taking time T-t, and all transactions before t are known and all transactions after t are unknown to the miner, therefore

t×DnA=(Tt)×Mt \times D n A=(T-t) \times M

so

w(t)={1 tMTDnA+M 0 t>MTDnA+Mw(t)=\begin{cases}1 & t \leq \frac{M T}{D n A + M}\\0 & t > \frac{M T}{D n A + M}\end{cases}

And then

B=NT(6×MDnA1+MDnA+D×11+MDnA)B=N T \left( 6 \times \frac{\frac{M}{D n A}}{1+\frac{M}{D n A}} + D \times \frac{1}{1+\frac{M}{D n A}} \right)

And k shall be defined as

kM(6×MDnA1+MDnA+D×11+MDnA)nAk \equiv \frac{M}{\left( 6 \times \frac{\frac{M}{D n A}}{1+\frac{M}{D n A}} + D \times \frac{1}{1+\frac{M}{D n A}} \right) n A}

Further, the above reasoning assumes that the CPU speed is infinite or the major bottleneck is internet transmission. Otherwise, a CPU speed C for validating the transactions can be introduced as below.

The x in the optimization is the ratio of overall delay time over T beside latency,

x=BMT+BCTx=\frac{B'}{M T}+\frac{B}{C T}

where B' be the transmitted block and B be the real block therefore

B=NTD(6D×MDnA1+MDnA+11+MDnA)B'=N T D \left( \frac{6}{D} \times \frac{\frac{M}{D n A}}{1+\frac{M}{D n A}} + \frac{1}{1+\frac{M}{D n A}} \right)

B=NTDB=N T D

Therefore

x=ND(1M(6D×MDnA1+MDnA+11+MDnA)+1C)x=N D \left( \frac{1}{M}\left( \frac{6}{D} \times \frac{\frac{M}{D n A}}{1+\frac{M}{D n A}} + \frac{1}{1+\frac{M}{D n A}} \right)+\frac{1}{C} \right)

NnA=x(1M(6D×MDnA1+MDnA+11+MDnA)+1C)DnA\frac{N}{n A}=\frac{x}{\left( \frac{1}{M}\left( \frac{6}{D} \times \frac{\frac{M}{D n A}}{1+\frac{M}{D n A}} + \frac{1}{1+\frac{M}{D n A}} \right)+\frac{1}{C} \right)D n A}

and

k1(1M(6D×MDnA1+MDnA+11+MDnA)+1C)DnAk \equiv \frac{1}{\left( \frac{1}{M}\left( \frac{6}{D} \times \frac{\frac{M}{D n A}}{1+\frac{M}{D n A}} + \frac{1}{1+\frac{M}{D n A}} \right)+\frac{1}{C} \right)D n A}

In terms of B, the optimal equation is

G 1(1aB)RkqVT+b 0 BG 1(1au)du=1h(1+(1+bB))(1+h(l+bB))\frac{G^{-1}(1-a B)}{\frac{R}{k q V T}+ b \int_0^B {G^{-1}(1-a u) d u }}=\frac{1-h}{\left( 1+(1+b B) \right) \left( 1+h(l+b B) \right)}

where

a1DnATa \equiv \frac{1}{D n A T}

b1M(6D×MDnA1+MDnA+11+MDnA)+1CTb \equiv \frac{ \frac{1}{M}\left( \frac{6}{D} \times \frac{\frac{M}{D n A}}{1+\frac{M}{D n A}} + \frac{1}{1+\frac{M}{D n A}} \right)+\frac{1}{C} }{T}

k=abk=\frac{a}{b}

The better the infrastructure, the lower b. Beside the theoretical deduction, can be directly observed and and can be obtained by regression of block delay time against block size. After that, the optimal block size B, or equivalently the optimal x, is derived accordingly. See OptimalPercentile.


Let r be the block reward of unit time of a design, L be the latency in seconds so that l=LTl=\frac{L}{T}, the above equation does hint about the optimal design about T. At every time interval T, a revenue of T(r+kqV 0 xG 1(1ku)du)1+h(LT+x)1+(LT+x)T \left( r+k q V \int_0^x {G^{-1}\left(1-k u\right)d u} \right) \frac{1+h \left( \frac{L}{T}+x \right)}{1+\left( \frac{L}{T}+x \right)}

is collected. Knowing that q is also time preference rate, the overall present value of all future revenue is

T(r+kqV 0 xG 1(1ku)du)1+h(LT+x)1+(LT+x)×(e qT+e 2qT+e 3qT+)T \left( r+k q V \int_0^x {G^{-1}\left(1-k u\right)d u} \right) \frac{1+h \left( \frac{L}{T}+x \right)}{1+\left( \frac{L}{T}+x \right)} \times \left( e^{-q T}+e^{-2q T}+e^{-3q T}+\cdots \right)

So the optimal T is about maximization of

T(1+hx)T+hL(1+x)T+L×1e qT1T \frac{(1+h x)T+h L}{(1+x)T+L} \times \frac{1}{e^{q T}-1}

whose optimal equation is

qTe qTe qT11=L(1h)T((1+x)T+L)((1+hx)T+hL)\frac{q T e^{q T}}{e^{q T}-1}-1=\frac{L(1-h)T}{\left( (1+x)T+L \right) \left( (1+h x)T+h L \right)}

When qT is tiny, the left hand side is 12qT\frac{1}{2}q T, this solves to

T2L(1h)q(1+x)(1+hx)T \approx \sqrt \frac{2L(1-h)}{q(1+x)(1+h x)}

For example, assume h being zero and x being tiny and L being 10 second and q being 0.005 annually, T is 355168 seconds.