Understanding BlockDAGs and GHOSTDAG
My WebsiteSupport My Work
  • Welcome!
  • Preface
  • Introduction
  • Part 1: BlockChains and BlockDAGs
    • Introduction
    • Chapter 1: From BFT to PoW
      • Byzantine Fault Tolerance
      • Proof-of-Work (PoW)
      • How PoW Works*
      • PoS Vs. PoW
      • Exercises
    • Chapter 2: the Block Chain Paradigm
      • A Graph Theory Primer
      • The Paradigm
      • Honesty and Rationality
      • Three Chain Selection Rules
      • Security Notions
      • A Security Model for Blockchain Consensus
      • Selfish Mining in Bitcoin
      • Safety
      • Liveness
      • Confirmation Times
      • Proving Bitcoin's Security*
      • Exercises
  • Part 2: The GHOSTDAG Protocol
    • Page 2
  • Supplementary Material
    • Math
      • Stuff You Should Know
        • Asymptotics, Growth, and Decay
        • Binomial Coefficients
        • The Binomial Formula
        • Geometric Sums and Series
      • Probability Theory
        • Probability Spaces
        • Random Variables
        • The Math of Block Creation
    • Computer Science
      • Stuff you Should Know
        • Asymptotic Notation
        • Negligible Functions
      • Cryptography
        • Random Oracles
        • Merkle Trees
        • One Time Pads
Powered by GitBook
On this page
  • The Network Delay
  • The Confidence Parameter
  • Block Creation
  • The Adversary
  • Inclusion and Approval Times
  1. Part 1: BlockChains and BlockDAGs
  2. Chapter 2: the Block Chain Paradigm

A Security Model for Blockchain Consensus

PreviousSecurity NotionsNextSelfish Mining in Bitcoin

Last updated 2 months ago

We now start the process of defining security notions for blockchains.

As we have learned in the previous section, the first thing we need to describe is the environment (i.e. the model) we are working in. That is, we need to introduce all of the assumptions we have about the abilities of the attacker.

There are several ways to go about this, depending on what properties you want to discuss. I chose to go with a rather simple model, that is just enough for the depth of discussion I plan for the rest of the book.

The Network Delay

The network delay, denoted by DDD, is the time it takes the entire honest network to learn of a newly discovered block that was not withheld. If the network is entirely honest, DDD is the time you would have to wait before you know no new blocks were discovered before you started waiting. That is, by the time t+Dt+Dt+D, all network nodes are guaranteed to have heard of all blocks created before time ttt.

In the general case, you are still guaranteed that all network nodes know of all honest blocks created before time t+Dt+Dt+D. Note that I say honest and not rational. The reasons for that will become very clear in the next section.

Note that blocks may traverse the network a lot faster, the network delay is a bound, not an absolute number.

Codifying the network delay into our model already means it is too restricted to analyze parameterless protocols such as DAGKnight. In fact, properly analyzing DAGKnight (and retroactively understanding the security of SPECTRE to the fullest extent) required coming up with a new model which is arguably a scientific contribution whose significance is not too far removed from the protocol itself.

The Confidence Parameter

One of the details we encoded into our sample security definition above is that the receiver of funds on a blockchain can never expect complete confidence that a transaction will never revert, because of the probabilistic nature of proof-of-work. We implicitly stated that "the revert probability is a negligible function of TTT", but that's not a good way to go about this innate uncertainty. Especially not when we consider .

The confidence parameter is some number ε>0\varepsilon > 0ε>0 that describes how much risk the receiver is willing to take: they would not consider a transaction accepted unless the probability it reverts is below ε\varepsilonε.

A linguistic source of many misunderstandings is that a lower ε\varepsilonε means more confidence. Much like the case of , when we talk about "the confidence" we will usually mean our confidence that the bad thing does not happen. That is, we actually refer to 1−ε1-\varepsilon1−ε.

Sometimes, we will use ε\varepsilonε to denote the effective confidence, not some expectation set by the receiver. I.e., we can use a notation like ε=O(e−T)\varepsilon = O\left(e^{-T}\right)ε=O(e−T) to mean that "the confidence you get increases exponentially as time passes".

This is a bit tricky. When we say that a number we mean that it grows infinitely large very fast. The number 1−ε1-\varepsilon1−ε can't grow exponentially. Indeed, it can't even be larger than 111. What we actually mean when we say that "the confidence grows exponentially" is that its distance from 111, which is just ε\varepsilonε, decays exponentially.

It is one of these sorts of linguistic overloading that anyone who wants to dive into any established theory has to get used to.

Block Creation

We assume each miner in the network has some fraction ϕ\phiϕ of the network, which is the probability that this miner creates the first block. We assume that ϕ\phiϕ is fixed throughout. If we consider several miners with fractions ϕ1,…,ϕk\phi_1,\ldots,\phi_kϕ1​,…,ϕk​ then the probability the next block is created by one of these miners is ϕ1+…+ϕk\phi_1 + \ldots + \phi_kϕ1​+…+ϕk​.

For example, in Bitcoin the block delay is λ=10 mins\lambda = 10\text{ mins}λ=10 mins, so a miner with ϕ=1/4\phi = 1/4ϕ=1/4 creates, on average, one block per λ/ϕ=40 mins\lambda/\phi = 40\text{ mins}λ/ϕ=40 mins.

Note that this includes orphaned blocks. That is, we only require that a miner with fraction ϕ\phiϕ creates ϕ\phiϕ of the blocks, not ϕ\phiϕ of the blocks on the selected chain.

The Adversary

Recall the fine line we are attempting to walk here: we want an adversary strong enough to capture as many attack vectors as possible, but not too strong, because then it would be impossible to defend against it.

We assume what's usually called a byzantine attacker, which is a very powerful kind of attacker. The byzantine attacker suffers no delays, they instantly know of all blocks created, by them or others on the network. Even if we think of the attacker as many disparate nodes, we assume that these nodes can communicate instantaneously.

Additionally, we assume that the adversary can delay any message (say, containing block data) between any two nodes. The only limitation is that it cannot make a message take longer than DDD to arrive at the entire network.

Finally, we assume that the adversary has some (possibly unknown) fraction of the network, that we denote α\alphaα. So saying we consider an attacker with at most 45%45\%45% of the hashrate is the same as setting α=0.45\alpha = 0.45α=0.45.

Sometimes, instead of saying "an attacker with fraction at least α\alphaα" we just say an α\alphaα-attacker. Note that an attacker with more than α\alphaα is still considered an α\alphaα-attacker, it is just easier that way.

Sometimes, it will be more comfortable to use δ\deltaδ to denote how larger than half the honest fraction is. In other words, δ=12−α\delta = \frac{1}{2} - \alphaδ=21​−α.

Inclusion and Approval Times

We now introduce two quantities that will be very useful, but are also a bit annoying to explain.

The idea is this, we want to measure how long the transaction has consecutively been and how long since it was first included in the blockchain and until this started to happen.

Say that, for some reason, we decided that the former quantity is ten seconds. Then the latter probability becomes "how long would it take for the transaction to be added to the selected chain such it would stay there for ten seconds?

We thus define L(α,ε,T)L(\alpha,\varepsilon,T)L(α,ε,T) to be how long (on average) you would have to wait to guarantee with confidence ε\varepsilonε that the transaction was added to the selected chain and will stay there for at least TTT. The future tense on the word "will" indicates that this time is not counted into L(α,ε,T)L(\alpha,\varepsilon,T)L(α,ε,T).

Visually, you could imagine something like this:

Next is the time TTT itself. What do we want it to be?

Let S(α,ε)S(\alpha,\varepsilon)S(α,ε) denote how long the transaction has to stay in the selected chain so that there is confidence of ε\varepsilonε that an α\alphaα-attacker could not revert the transaction. We call this the approval time. This is the time we are interested in.

Note that the definition of approval time doesn't care if the selected chain was changed, as long as the new chain also has the transaction in one of its block. So for example, the following scenario will correspond to one contiguous blue stripe, despite two reorgs occurring during this period:

The justification is that even if there are two competing chains, and the can't choose a winner, both chains include txtxtx. So from the point of view of the merchant who cares about how safe txtxtx is, it doesn't matter which chain won.

In practice, a scenario as above should very much concern a merchant: since the honest network is split between two similarly heavy chains. It follows that a 13\frac{1}{3}31​-adversary could revert the transaction. This does not mean that the definition of SSS is wrong. SSS will naturally be large enough to accommodate that. In particular, if we have a network where such splits of length TTT happens with probability ppp, then for any ε<p\varepsilon < pε<p it will necessarily hold that S(13,ε)>TS\left(\frac{1}{3},\varepsilon\right)>TS(31​,ε)>T,

A proper security definition will ensure that ppp decreases exponentially with TTT.

The inclusion time L(α,ε)L(\alpha,\varepsilon)L(α,ε) measures how long since the transaction first appeared on the blockchain and until it was added to the selected chain for at least the approval time. In other words, it is defined by the icky equation L(α,ε)=L(α,ε,S(α,ε))L(\alpha,\varepsilon) = L(\alpha,\varepsilon,S(\alpha,\varepsilon))L(α,ε)=L(α,ε,S(α,ε)).

In pictures:

The quantities are denoted by LLL and SSS to reflect that they are relevant to liveness and safety, as we will soon see.

We assume that there is some fixed block delay λ\lambdaλ such that a block is created, on average, once per λ\lambdaλ. More precisely, we assume that the block creation process is a with parameter λ\lambdaλ, and consequentially, the blocks created by a particular miner with fraction ϕ\phiϕ produces blocks in a Poisson process with parameter λ/ϕ\lambda/\phiλ/ϕ.

confirmation times
difficulty
grows exponentially
Poisson process