Part II — Failure, replication, agreement · Chapter 7

Distributed ledgers as middleware

~30 min3 instrumentsA.Y. 2025/26 · Prof. Omicini
C4 Distributed Ledger Technology. Blockchain as Middleware
The question

If many distributed applications need consensus, can it be offered once, as middleware, instead of being rewritten for each?

The argument in one paragraph

Middleware gives heterogeneous applications a common model and a common infrastructure. A distributed ledger is middleware of a new kind: a ledger kept synchronised across unsynchronised nodes. Underneath, a blockchain is state machine replication of a notary service. Hash chains, signatures and consensus make it tamper-evident, accountable and robust to Byzantine peers. Closed systems use classical quorum/leader-based consensus; open ones use competition, such as Proof-of-Work, with probabilistic, eventual consistency. Replicate an interpreter instead and you get universal SMR: users deploy smart contracts, N copies computing as one.

Middleware: what sits in the middle

Middleware (traditional definition)[Tanenbaum & van Steen, 2017]

Middleware lies in the middle between the operating system and the applications: vertical layers, with top (middleware-to-application) and bottom (middleware-to-OS) interfaces.

Development is hard, good designers rare, applications ever more complex. Middleware is built once for many applications (affording better designers), provides services, and abstracts from the OS.

Its key feature is interoperability: applications on the same middleware work together. But middleware systems are many and incompatible, and making A-applications work with B-applications is the Enterprise Application Integration (EAI) task, with the emphasis on horizontal communication (application-to-application, middleware-to-middleware). Integration is unavoidable: every project inherits legacy systems and adds features without modifying them. The first casualty is conceptual integrity.

Conceptual integrityC4, Middleware and Models II

The property of a system of being understandable and explainable through a coherent, limited set of concepts.

Piecemeal growth stays popular (asymptotically cheapest as development time goes to zero). Middleware is an integration technology: to limit conceptual drift it casts a model on heterogeneous applications.

Abstract middleware

A common model: CORBA, Java RMI, DCOM and OSGi all model a system as network-reachable objects (with differences even there).

Concrete middleware

A common infrastructure, aiming at actual interoperability, so it handles finer details. Until CORBA 2.0, two vendors' CORBAs did not interoperate.

For infrastructure the key issue is the network effect: the value of a technology grows with the number of its adopters. Hence standards consortia (OMG, FIPA, OSGi, W3C) and players pushing de facto standards. The slides then ask: beyond authentication, authorisation, security and shared resources, what about consensus? Should every application write it from scratch (Ch. 6), or should middleware provide it?

DLT as a synchronising layer

Distributed ledger technology[Focus Group on Application of DLT, 2017]

Distributed ledger technology (DLT) refers to the processes and related technologies that enable nodes in a network to securely propose, validate, and record state changes (or updates) to a synchronised ledger that is distributed across the network's nodes.

Where is synchronisation? The ledger is synchronised, whereas nodes and network are not required to be synchronous. So DLT is expected to work as a synchronising layer for the processes, as middleware can be expected to do.

Ledger · distributed ledger · DLT[ISO/TC 307, 2024]

Ledger: information store that keeps records of transactions that are intended to be final, definitive, and immutable. Distributed ledger: ledger shared across a set of DLT nodes and synchronised between them using a consensus mechanism. DLT: technology that enables the operation and use of distributed ledgers.

Open systems rest on shared standards, most generally at the middleware level. ITU (Focus Group on DLT) and ISO (TC 307) produced them, including actors and a reference architecture covering public chains (Ethereum, Bitcoin), private chains (Hyperledger Fabric) and non-blockchain ledgers. Use cases span finance, pharma, medicine, ICT and energy [FG DLT, 2019c]. General benefits:

  1. Secure and cost-effective, enabling globally-scalable services.
  2. Tamper-resistant and auditable, resistant to systemic failures.
  3. Effective at detecting and mitigating fraud.
  4. A General Purpose Technology: as a middleware instance it brings gains to other sectors; mass adoption may be slow, but then yields productivity gains across industries.

Specific benefits: transparency and trust among untrusted users, security, disintermediation. ACM has a dedicated journal, Distributed Ledger Technologies.

Blockchain sat in Gartner's Hype Cycle for Emerging Technologies from 2016 and vanishes after 2018, as ITU (2019) and ISO (2020) complete their standards: a sign, for the slides, of maturity and industrial exploitation.

Blockchain Smart contractsCryptocurrencies HyperledgerFabricEthereumBitcoin
Fig. 7.1 — Blockchain ≠ Bitcoin: blockchain ⊃ cryptocurrencies ⊃ Bitcoin; smart contracts are another dimension.

DLT ⊃ BCT (blockchain technology): a blockchain is one way to implement a ledger, and IOTA, Hedera Hashgraph and Corda use none. And blockchain ≠ Bitcoin: the blockchain is a model for distributed, decentralised computation, with diverse implementations, domains and goals; Bitcoin is one implementation, for cryptocurrencies, digitalising and decentralising fiat currency.

The blockchain at a glanceC4, Background

A shared, transparent, distributed, append-only ledger tracking the order and timing of transactions: secured by cryptography (hashes, signatures, certificates, encryption); replicated on a P2P network, with no trusted intermediary, making it immutable; updated through consensus, robust to Byzantine failures. Ideal use: a secure hub for mutually-untrusted parties.

From hash chains to a replicated notary

One-way hash H

✓ input → digest; × digest → input; P(H(x) = H(y) | x ≠ y) ≈ 0; small input change, big digest change. Goal: revealing tampering.

Public-key crypto

✓ make a key pair, encrypt with one key, decrypt with the other; × decrypt with the wrong key, derive one key from the other. Goals: confidentiality, authenticity, non-repudiation.

Digital signature

EncryptPriv(H(Message)), verified with the public key: authenticity (alleged ≡ actual sender) and integrity.

A hash chain keeps track of a sequence of events: event i goes in block bi, and bi+1 records H(bi), so the sequence cannot be altered unnoticed.

Instrument 1Hash-chain tamper lab

Edit block 1's data or timestamp, then press Attacker rewrites links.

SHA-256, first 10 hex digits · Δt = 10, ε = 2

Add timestamps and you get a timestamping service: blocks appended (almost) periodically, possibly several events per block, recording what happened and when. Accept only correctly signed events and you get a notary service: who did what and when, with non-repudiation. The slides' applications:

  1. orders, shipments and payments between companies (a supply chain);
  2. open voting, tracking who voted what;
  3. an open registry of public calls and applications;
  4. a registry of building ownership and transfers;
  5. punching in/out for employees;
  6. a cryptocurrency.

In general: whenever parties may want to lie about what they did or when. After each block a resulting state can be computed (in the punch-in example, who is inside).

Run as one logically centralised server (validating events, keeping the chain, storing data), even a redundant one, the notary has a single point of trust: its owner may alter the ordering or timing of events, or exclude someone, with no defence. Hence replication:

  1. replicate the notary, each replica controlled by a different party;
  2. an event sent to one replica is propagated to all;
  3. each replica stores the hash chain and the events;
  4. as long as most replicas are not corrupted, tampering is detected (how many? §4);
  5. we are replicating the software that validates events: state machine replication.

State machine replication

State machine replication (SMR)[Schneider, 1990; Charron-Bost et al., 2010]

State machine replication: executing the same (not necessarily finite) state machine over multiple independent (possibly distributed) processors, in parallel, to achieve fault tolerance (to stops, crashes, lies, bugs), availability and reactivity, and data/software replication and untamperability. The replicas form a P2P network with the same observable behaviour and no assumed topology.

Computation is stateless when output depends on input only (functions), stateful when (Input, State) → (Output, State′) (objects). A machine is deterministic if its state depends only on the initial state and the input sequence. Randomisers and concurrency break this, and a deterministic machine plus its environment is still non-deterministic overall [Wegner & Goldin, 1999]. Deterministic stateful machines can be arbitrarily replicated and run concurrently if

  1. every replica starts from the same initial state, and
  2. every replica processes inputs in the same order.

All then move through the same states: notary + replication + a ledger class ≈ a simple cryptocurrency. Condition 2 is the bank-account problem of Ch. 2.

Open-system challengeResponse
messages lost, corrupted, reordered, duplicated: how to impose one order?robust transport (TCP); hashes for integrity
no global time: how to share a common time?reasonable to assume access to UTC through NTP (Ch. 2)
CAP [Brewer, 2000]: replicas temporarily cut off?∼ eventual consistency
Byzantine generals [Lamport et al., 1982]: replicas crash or lie?∼ redundancy + BFT consensus

On CAP (Ch. 5): the blockchain basically chooses P and A. Like NoSQL databases (e.g. MongoDB) it provides eventual consistency, “sooner or later, in finite time”, often governed by probabilistic rules (§7).

Slides say · “the blockchain chooses P and A”

True of permissionless chains, which extend both sides of a partition and reconcile later. Permissioned BFT chains (“exact” consistency, §6) stop committing rather than diverge: the CP choice.

Why consensus? Alice and Bob update simultaneously through different replicas; the result depends on order, so replicas must agree on one. Byzantine faults (inconsistent views, deliberate lies) can block agreement: three replicas reach an impasse, a fourth may break it. Bad actors have economic incentives; without BFT a replica can alter ordering, exclude events, or block agreement forever.

BFT consensus algorithmC4, Consensus II

A distributed protocol aimed at making an SMR system resistant (i.e. ensuring eventual consistency) to Byzantine failures.

Consensus is impossible under either assumption:

  1. asynchronous network [Fischer et al., 1985], messages arbitrarily reordered or delayed: hence protocols proceed in periodic rounds;
  2. f ≥ N/3 Byzantine replicas [Lamport et al., 1982]: hence the fourth replica (N = 4 tolerates f = 1).
Slides say · “impossible under any of the following”

FLP rules out deterministic consensus with even one crash in an asynchronous system (Ch. 6). The N/3 bound is for unsigned messages: signatures let a synchronous system tolerate any f, but partially synchronous BFT (PBFT) still needs N ≥ 3f + 1.

Universal SMR

The slides' analogy: UTM : TM = Interpreter : Program = ??? : SMR. Instead of a deterministic program with one business logic (say a bank ledger), replicate an interpreter, a program that executes other programs: Universal State Machine Replication (USMR), whose operations let users deploy, undeploy or invoke programs. Smart-contract-enabled blockchains act as replicated universal state machines (§8).

The blockchain, formally

Blockchain technology (BCT)C4, Blockchain Overview

A clever implementation of an SMR system keeping track of which users own some assets (representations), by means of a replicated ledger, updated through consensus.

  1. Users: identified through public keys, sign their transactions.
  2. Assets: anything with value, an owner, possibly mutable state (money, documents, property acts, contracts).
  3. Ledger: a replicated notary service holding the assets' evolution.
  4. Consensus: a protocol keeping the ledger replicas in sync.

Replicas R1…RN store the ledger; clients C1…CM propose updates to any. Users are identified by f(Kpub) (a hash or a CA certificate), their address. Many non-intelligible addresses per user give pseudonymity and decentralisation but invite the Sybil attack; one certified address makes the CA a single point of failure and trust.

SystemState ::= Asset | SystemState ∪ SystemState Asset ::= UserID, AssetState

The world state is a set of assets with owners; AssetState is application-specific (a balance, custom data). Implementations: account-based (Ethereum), UTXO (Bitcoin), versioned key-value store (Fabric).

TX ::= UserID, Operation, Arguments, Signature

A transaction is a proposed state change. Operations are application-specific, but must at least create and update assets; a cryptocurrency has deposit, Value and transfer, UserID, Value.

Transaction validity and executionC4, Transactions III–V

A transaction is valid if (i) it is well formed, (ii) the signature matches the issuer address, (iii) the signature certifies its integrity. A valid tx is applied by γ, giving its resulting state:

γ(s, tx) = s′

Possibly s ≡ s′ (e.g. insufficient funds). γ(·,·) is the state machine (the program) being replicated.

Blocks are timestamped, hash-linked lists of transactions and (hashes of) their resulting states. A block is a 5-tuple of previous hash, height, timestamp, metadata and transactions:

bi = ( phi, hi, tsi, mi, (txi1, ri1, …, txini, rini) )

where rij is the state after txi1…txij.

Local validity of a blockC4, Blocks & Block Chains III

With bi−1 the replica's last known block, bi is locally valid if

  1. phi ≡ H(bi−1)
  2. hi ≡ hi−1 + 1 ≡ i
  3. tsi − tsi−1 ∈ [Δt − ε ; Δt + ε] (Δt, ε chain-specific)
  4. ri1 = γ(ri−1ni−1, txi1)
  5. rij = γ(rij−1, txij) ∀ j ∈ 2…ni

Then Γ executes it, applying its transactions in order through γ: Γ(si−1, bi) = rini ≡ si.

ph = H(bi−2)h = i−1 · tstx¹ r¹ … txⁿ rⁿ ph = H(bi−1)h = i · tstx¹ r¹ … txⁿ rⁿ ph = H(bi)h = i+1 · tstx¹ r¹ … txⁿ rⁿ bi−1bibi+1 si−1 si si+1 Γ(si−1, bi)Γ(si, bi+1)
Fig. 7.2 — Hash links ph (vermilion) and the states each block produces.

What blocks buy

  1. replication + hash-chaining ⇝ untamperability of the past;
  2. hash-chain + time + ordering ⇝ timestamping/notary service [Haber & Stornetta, 1991];
  3. hash-chain + signatures ⇝ accountability, non-repudiation;
  4. blocks are published (almost) periodically, every Δt.

In general, limn→∞ P[inconsistent(Bi)] = 0: as the number n of successors of block Bi grows, the probability that nodes disagree on its content vanishes.

The first, genesis block is assumed shared by all replicas.

Transaction life-cycle

  1. a user U wants to update the system state;
  2. compiles the transaction with operation and arguments;
  3. signs it with KUpr;
  4. spreads it to one or more replicas;
  5. peers validate it on reception, dropping it if invalid;
  6. it is eventually executed, producing an intermediate state;
  7. both are included in some block;
  8. the block is eventually appended: consensus confirms it, with its transactions.

Block life-cycle · each node, every Δt

  1. listens for transactions published by clients;
  2. validates and executes them, dropping invalid ones;
  3. compiles its local candidate block;
  4. takes part in consensus, negotiating the next block with its peers.

Step 4 exists because replicas may be corrupted, or have seen transactions in different orders.

Consensus in blockchains

Identity management decides which consensus is possible:

Permissioned BCTPermissionless BCT
identitiesconstrained through CAsany (Kpub, Kpr)
consensus“classical” quorum/leader-based. BFT: PBFT, BFT-SMaRt, HoneyBadgerBFT; non-BFT: Paxos, Raft, ZooKeeper, Chubby“novel” competition-based: Proof-of-Work, Proof-of-Stake, Proof-of-Elapsed-Time, IOTA Tangle
assumptions on Nnumber of replicas and their IDsnone
upper bound on nodes∼ 100 / 1000virtually ∞
throughput (order)high, ∼ 1000 TX/slow, ∼ 10 TX/s
consistency“exact”probabilistic
ideal forclosed multi-administrative organisationsopen systems, e.g. cryptocurrencies
Sybil attacksolved with CAssolved with PoW
Sybil attack[Douceur, 2002]

In a Sybil attack, an attacker subverts the P2P system by creating a large number of pseudonymous identities, using them to gain a disproportionately large influence. Exposed: systems deciding by majority vote among entities with cheap-to-create IDs.

PBFT [Castro & Liskov, 2002] is the classical answer. An elected leader multicasts each client request; replicas agree in two rounds, prepare and commit; the client waits for f + 1 replies (f = maximum faulty replicas). A suspect leader (timeouts) is replaced by negotiation. The slides' questions: N = 1000 needs order N² messages (all-to-all rounds); fictitious IDs let a Sybil attacker own the quorum. Open systems need something else. Paxos and Raft are in Ch. 6.

Proof-of-Work

Proof-of-Work (PoW), or mining, was conceived against email spam [Back, 2002]; nowadays it endows cryptocurrencies with their value. PoW = computational puzzle + branch resolution strategy.

The computational puzzle

  1. miners compete to solve it first, about once every Δt ± ε seconds;
  2. the proof is easy to verify and included in the block;
  3. only blocks with the proof are valid;
  4. the first solver mines the next block;
  5. difficulty is variable and controllable.

Bitcoin: from bi = (phi, hi, tsi, mi, tx̄i) with mi = 0, while H(bi) ≥ hthreshold, increase mi: a hash starting with enough zeros. Ethereum: the block selects parts of a reproducible ∼1 GiB pseudo-random graph, hashed into the block.

Propagation takes time: while honest replicas adopt a block, another replica, uninformed or malicious, may mine a competitor. That is a branch: several versions of the ledger, an inconsistency. Branches are unavoidable, so each replica applies a local rule to pick the true one; if the majority follows it, all eventually select one branch: eventual consistency. Bitcoin uses the longest chain rule: honest replicas consider the longest chain they heard about first. Branches never grow at the same speed, so one gets longer and the other is abandoned, its blocks becoming orphans. Ethereum uses GHOST, Greedy Heaviest Observed SubTree [Sompolinsky & Zohar, 2013].

Slides say · “Bitcoin: longest chain; Ethereum: GHOST”

Bitcoin follows the most cumulative work (the longest chain at constant difficulty). GHOST picks, at each fork, the subtree with the most blocks, orphans included. Ethereum under PoW chose by total difficulty, borrowing only GHOST's uncle rewards; since Proof-of-Stake (2022) it uses a GHOST variant, LMD-GHOST.

Instrument 2Fork resolver · longest chain

Blocks A4 and B4 were mined at once; your payment tx★ is in B4. Mine on either side, or at random.

How likely is an adversary to produce a longer branch faster than everyone else? With r = adversary CP / honest CP (computing power) and n blocks to catch up [Nakamoto, 2008]:

P[n | r] = 1 − Σk=0..n ((nr)k e−nr / k!) · (1 − rn−k)

Bitcoin waits nthreshold = 6 blocks, ≈ 1 hour since E[ΔT] = 10 min. The slides: 99.999% secure if the adversary has less than 13% of the total CP.

Instrument 3Nakamoto catch-up calculator

Set attacker share q and confirmations z; hover the chart for other z.

Slides say · “99.999% secure if adversary CP < 13%”

The slides' own formula gives, for n = 6 and 13%, P ≈ 0.00115: about 99.88%. 99.999% needs an adversary below about 6%. The figure matches the simpler (q/p)n = (0.13/0.87)6 ≈ 1.1 · 10−5, which ignores the blocks the attacker mines in secret while the 6 confirmations accrue.

PoW features

  1. competition-based, local, eventually-consistent, stochastic;
  2. self-adaptive difficulty, E[Δt] = const, compensating changes in CP (Bitcoin updates hthreshold; Ethereum similarly, plus ASIC-resistance);
  3. only CP matters, so it is Sybil-resistant;
  4. CP distribution and the majority rule: the 51% attack, and “majority is not enough” [Eyal & Sirer, 2014];
  5. E[Δt] = const implies a maximum update frequency 1 / E[Δt].

Why would rational, i.e. selfish miners pay to validate others' transactions? Incentives: the winner gets money created ex nihilo by the protocol. Disincentives: attacks like deliberate branching are not prevented but made extremely costly. PoW, value and security are strictly related:

  1. PoW endows the cryptocurrency with its economic value;
  2. miners require economic compensation;
  3. miners' job is the gasoline of a blockchain system;
  4. miners behave honestly as long as it is convenient;
  5. it is convenient as long as the cryptocurrency has value.

Swan [2015] names three generations: 1 cryptocurrencies, 2 custom assets, 3 smart contracts. The model so far covers 1–2, with expected applications such as online payments in place of PayPal, smart property, unified medical records, non-censurable social media and news, shared balances among companies, public tenders, naming and access control, voting. Generation 3: data is now stored without single points of trust, but who trusts its producers? Software automation just moves trust to developers; we need trustable agents managing assets automatically.

Smart contracts: programs on the universal machine

Smart contract[Szabo, 1997]

Smart contracts (SC) are stateful, user-defined, reactive, immutable (therefore trustable), deterministic processes executing replicated and expressive computations on the blockchain.

  1. Stateful: encapsulate their own state, like objects.
  2. Reactive: only triggered by some off-chain client.
  3. User-defined: users deploy their own, with any business logic.
  4. Immutable: code cannot change after deployment.
  5. Replicated: the blockchain is their replicated interpreter.
  6. Expressive: written in a Turing-complete language.
Slides say · definition cited to [Szabo, 1997]

Szabo coined the term before blockchains, for computerised protocols executing a contract's terms; the six properties are the slides' own.

SCs act as intermediaries in multi-party workflows, reducing failures from corrupt or selfish operators. Immutability + inspectability + accountability + replication make them trustworthy with critical assets: “the code is always right, the true history is on the blockchain”, fewer disputes, no arbitration. They lack situatedness: data and computation are totally disembodied [Mariani & Omicini, 2013], like the cloud with no single point of trust. N copies of an SC exist, one per replica, but they always compute as one.

Clients get two operations, deploy and invoke:

Deployment

  1. initially there are no SCs;
  2. a deployment TX carries the source or byte-code and initialises the state; the protocol assigns an address;
  3. once confirmed, an instance runs on all replicas, just listening for invocations.

Invocation

  1. an invocation TX names the SC address as recipient, with input data;
  2. each replica eventually receives and executes it;
  3. without exceptions, side effects enter the new intermediate state; otherwise they are dropped;
  4. once consensus confirms the block, the computation is actually executed.
EntityID ::= UserID | SmartContractID Asset ::= UserID, Data | SmartContractID, SmartContractState SmartContractState ::= Storage, Code TX ::= EntityID, Operation, Signature Operation ::= deploy, Code | invoke, Arguments, SmartContractID | transfer, EntityID, Value

Storage is like an object's fields, code like its methods. γ now creates an SC on deploy, updates its state on invoke, updates both balances on transfer; Γ still executes a block's transactions sequentially. This is the Order-Execute architecture [Androulaki et al., 2018].

What about non-terminating programs? The halting problem forbids filtering them, and open systems cannot assume good behaviour, so long computations must be discouraged. Ethereum uses gas; Hyperledger Fabric the Execute-Order-Validate architecture.

  1. transactions carry gasLimit and gasPrice;
  2. miners may delay low-gasPrice transactions, so users raise gasPrice for priority;
  3. each bytecode instruction increases a counter g per a price list [Wood, 2014];
  4. if g > gasLimit, an exception reverts the side effects;
  5. in any case the issuer pays ΔETH = gasPrice · g;
  6. the winning miner redeems ΔETH for its effort.

Computation's economics enter SC design, and SCs are not really Turing-complete: quasi-Turing-complete [Wood, 2014].

Beyond the slides · Execute-Order-Validate

In Fabric, endorsing peers first execute (simulate) a transaction and return its read/write sets; the ordering service orders the results; every peer validates them before applying. A runaway contract only costs the endorsers.

The slides' Solidity example:

contract Counter {
  event Increased(uint oldValue, address cause); // event definition
  address owner;
  uint value;
  function Counter() public { owner = msg.sender; }  // constructor
  function inc(uint times) public {                   // API
    for (uint i = 0; i < times; i++) {
      emit Increased(value++, msg.sender);
    }
  }
}

On the chain, Alice deploys it; Bob, Dan and Carl call inc; states show value going 0, 3, 5, events emitted; callers pay gas to each block's miner. SCs are expected to mediate money management (bills, insurance, shares), shared governance (DAOs) and supply-chain tracking, e.g. with IoT:

  1. interacting SCs track movements of goods automatically;
  2. IoT sensors detect departures and arrivals, so nobody can lie about quantities or timings;
  3. SCs pay as soon as movements are detected, or refund if not;
  4. founders, creditors, inspectors, end users always know the distribution path, agreeing only on the SC's policy.

The idea: delegate trust-critical decisions to transparent, trustable software agents.

Open issues: an early technology

  1. No privacy or secrets. Everything published stays public, SC state included; pseudo-anonymity yields to statistics or machine learning. No secret voting?
  2. No randomness. Real randomness makes replicas diverge; block data (timestamp, height, hash) is miner-manipulable. No lottery?
  3. Inter-SC communication and re-entrancy. SCs call each other synchronously; non-reentrant code called back can fail, enabling fraud (The DAO [Dupont, 2017]). Is OOP right?
  4. Immutability. Buggy or fraudulent contracts cannot be fixed or undeployed, so correct design and formal validation are paramount (and hard with Turing-complete languages).
  5. Pure reactiveness. SCs borrow a user's control flow; time-aware but not time-reactive, they cannot schedule computations (no periodic payments).
  6. Disembodiment, no concurrency. Computation is logically everywhere and strictly sequential; local computations get replicated globally; SCs cannot parallelise.
  7. Cost granularity. Pricing computation is not new (cloud, XaaS), but is per-instruction right? In Ethereum publish-subscribe the publisher pays more [Ciatto et al., 2018].

For the oral

In what sense is a distributed ledger middleware?

A common model (a synchronised ledger) and infrastructure over unsynchronised nodes: consensus provided once, as a layer. Middleware economics apply: network effect, standards, General Purpose Technology.

Why is a blockchain an instance of SMR?

γ is the deterministic machine, transactions its inputs, the genesis block the common initial state, consensus the common input order. Hash chains and signatures add tamper-evidence and accountability.

Why can't Bitcoin just use PBFT?

PBFT needs known identities (else Sybils own the quorum) and its all-to-all rounds cap it near a thousand nodes. PoW ties votes to computing power and assumes nothing on N, at ∼10 TX/s and probabilistic consistency.

What do 6 confirmations buy?

A bound on an attacker with share q overtaking from 6 blocks behind: ≈0.02% at 10%, ≈0.1% at 13%, certainty at 50%. It is lim P[inconsistent(Bi)] = 0 made quantitative.

How do smart contracts follow from universal SMR, and why gas?

Replicate an interpreter and users can deploy their own programs. Non-termination cannot be ruled out in a Turing-complete language, so Ethereum charges per instruction and aborts past gasLimit: quasi-Turing-completeness.

Project lens · Thunk
Slide coverage: where each slide section went
SlidesContentHere
C4 · MiddlewareDefinition; why; models I–III; abstract vs concrete; standards; consensus?§1
C4 · DLTDefinitions; standards; actors; architecture; use cases; benefits; journal; DLT vs BCT§2
C4 · ExpectationsHype cycle I–IV; blockchain ≠ Bitcoin I–II§2
C4 · BackgroundAt a glance; crypto tools; hash chains; timestamping; notary; replication I–III§2, §3
C4 · SMROverview; deterministic stateful computation; open-DS issues; CAP; Byzantine faults; consensus§4
C4 · Universal SMRUTM : TM = interpreter : program = USMR : SMR§4
C4 · Main elementsOverview; users; world state; transactions; blocks; life cycles§5
C4 · Main elementsConsensus & mining I–II; Sybil I–II; PBFT I–II§6
C4 · Main elementsPoW; longest chain; features; incentives; generations; towards SC§7
C4 · Smart contractsDefinition; features; run time; updated model; termination; gas§8
C4 · ExamplesSolidity I–II; use cases; SC + IoT I–II§8
C4 · IssuesEarly technology and its seven issues§9