Browse Source

Define how nodes select a best chain. fixes #97

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
memo-field-specification
Daira Hopwood 7 years ago
parent
commit
b6ae95bd2c
  1. 19
      protocol/protocol.tex

19
protocol/protocol.tex

@ -1136,6 +1136,12 @@ Each \block in a \blockchain has a \blockHeight. The \blockHeight of the
\genesisBlock is 0, and the \blockHeight of each subsequent \block in the
\blockchain increments by 1.
In order to choose the ``best'' valid \blockchain in its view of the overall
\block tree, a node sums the work, as defined in \crossref{workdef}, of
all \blocks in each chain, and considers the chain with greatest total work
to be best. To break ties between leaf \blocks, a node will prefer the
\block that it received first.
The consensus protocol is designed to ensure that for any given \blockHeight,
the vast majority of nodes should eventually agree on their ``best''
\blockchain up to that height.
@ -3441,6 +3447,18 @@ fully defined in the Bitcoin documentation \cite{Bitcoin-nBits}, and so we defin
\end{cases}$
\end{formulae}
\introlist
\nsubsubsection{Definition of Work} \label{workdef}
As explained in \crossref{blockchain}, a node chooses the ``best'' \blockchain
visible to it by finding the chain of valid \blocks with the greatest total work.
Let $\ToTarget$ be as defined in \crossref{nbits}.
The work of a \block with value $\nBits$ for the $\nBitsField$ field
in its \blockHeader is defined as $\floor{\hfrac{2^{256}}{\ToTarget(\nBits) + 1}}$.
\introlist
\nsubsection{Calculation of Block Subsidy and Founders' Reward} \label{subsidies}
@ -4073,6 +4091,7 @@ The errors in the proof of Ledger Indistinguishability mentioned in
\item Make the description of \blockchains more consistent with
upstream \Bitcoin documentation (referring to ``best`` chains
rather than using the concept of a \term{block chain view}).
\item Define how nodes select a best chain.
\end{itemize}
\introlist

Loading…
Cancel
Save