Published unlisted
Edited
Oct 9, 2019
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
md `Now, how do we apply this. There are two clear options here:

1) ${tex `w_{r+1} = w_r + wFF*(wBF_{r+1} + wPF_{r+1})\\`}
2) ${tex `w_{r+1} = w_r + (wFF*wBF_{r+1}) + wPF_{r+1}\\`}

Option 1 is nice because as a product of all other factors wForkFactor dampens the overall weight added to great effect. Note that we only punish incremental weight (wBF and wPF) and not all weight (w_r) to ensure liveness: weight must grow monotonically across all chains.

However we run into an issue! As stated above, the adversary can choose whether to continue contributing PoSts to the honest chain or not while running an attack. With this wForkFactor, one strategy for the attacker would be to keep contributing PoSts to both chains (at no extra cost) and then not submit blocks to the honest chain. With a large enough attacker, wFF will penalize the honest chain for having produced too few blocks thereby enabling the attacker to grow their chain faster with less power.

Option 2 suffers from this problem less given that the penalization only applies to wBF. However it does entail that the wRatio can have an impact on wheether the above attack can succeed (e.g. with wRatio = .5, the adversary can make the honest chain lose up to 1/3 of its weight -- i.e. wBF -- which would create an incentive to use a more aggressive wPF function than log_2.

Option 2 also allows us to greatly simplify the wFF by making the following change to wBF:
${tex `\\
wBlockFactor[k] =
\left.\begin{cases}
\dfrac{log_2(power[r+1])\times wRatio}{e} \times numBlocks[r+1] \text{ for } abs(E[X] - k) \leq \sigma[X] \\
0 \text { otherwise}
\end{cases}\right.\\
`}

However, given the still existing issue here (allowing a miner to freely gain power over an honest chain by withholding blocks on it), we choose to forgo this additional tool for now.

`
Insert cell
Insert cell
function wCDF(n, p, k) {
n = Math.floor(n)
var _sum = 0;
for (var i = 0; i <= k; i++) {
_sum += (mathjs.combinations(n, i)*(p**i))*((1-p)**(n-i))
}
return _sum;
}
Insert cell
Insert cell
wFFHonPen = wFF(wFFTotN, wFFTotP, wFFHonMean)
Insert cell
wFFAdvPen = wFF(wFFTotN, wFFTotP, wFFAdvMean)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
function wPowFn(input) {
return Math.log2(input)
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
totPFAdd = clean(wPowFn(networkSize))
Insert cell
totBFAdd = eBlocksPerRound
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
wBlocksFactorConstTot = clean(eFinality*wTransitionSpeed*(totPFAdd / totBFAdd))
Insert cell
Insert cell
wBlocksFactorConstAdv = clean(eFinality*wTransitionSpeed*(advPFAdd / advBFAdd))
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more