University of Modena and Reggio Emilia
Way of dealing, essentially, with distributed asset tracking / identity management
A combination of distinct, already existing technologies
What can the blockchain do for distributed computing?
Consensus, fault tolerance, smart contracts, ...
Ethereum as the reference blockchain
The Blockchain is a general concept describing a model for distributed & decentralised computation, that may be implemented in a variety of ways, within heterogeneous application domains, and with disparate goals
Bitcoin is one specific implementation, in one specific application domain (cryptocurrencies), with a set of specific goals (drop the bank system)
A change of state in the blockchain: e.g. money transfer (in Bitcoin)
Once a transaction occurs, a block is created and
Validity:
Unit of information in the blockchain
If a change is to be made, no block is altered or rewritten, a new one is created, instead, and chained (block-chain)
In general, alphanumeric string with some properties:
In blockchain, valid hash must have additional properties, e.g. $N$ of leading zeroes
Finding a nonce (number) which produces a desired hash, to commit the block
"With great powers come great responsibilities"
Cryptographic tool to guarantee:
[https://andersbrownworth.com/blockchain/public-private-keys/blockchain]
The blockchain is made of networked nodes executing the same state machine ($\approx$program)
Each node executes the same consensus protocol
Consensus guarantees
Fundamental problem in distributed computing, core to leader election, mutual exclusion, distributed transactions, clock synchronization
Any consensus protocol should guarantee termination, agreement, and validity (if each $u_k = v$ then utput should be $v$)
No failures? Easy consensus in any system
Asynchronous network, deterministic algorithms? Consensus impossible if failures!
For any distributed system, in case of failures (partitioning) choose amongst consistency and availability
Partitioning is intrinsic to blockchains, availability cannot be lost in many application domains, consistency is of paramount importance too, but there are ways we can have almost consistency
Research in blockchain contributed nice novel mechanisms to have eventual consistency (mostly, "Proof-of-whatever" techniques): "sooner or later, in finite (reasonable) time, things will become consistent"
Both problems are extremely relevant for blockchains, as its foundation is consistency without centralisation!
[https://andersbrownworth.com/blockchain/distributed]
[https://blockchaindemo.io]
Many factors influence how a blockchain actually work:
Permissioned vs. Permissionless
Which consensus?
Many others to define properties of a specific blockchain
Another fundamental problem in distributed computing: achieve system reliability in the presence of faulty processes
Formalised as the two generals problem, then extended for $m \gt 2$
Theorem proved: for any $m$, consensus achieved if there are more than $3m$ participants with at most $m$ traitors
Due to the value of the asset stored in the ledger, hostile actors have economic incentives to, e.g., rewrite blocks
Byzantine Fault Tolerance (BFT) consensus helps against attacks:
See it working: [https://blockchaindemo.io/]
When adding a new block, it needs to meet these requirements (at least):
Hence, changing a committed block leads to a cascade of invalid blocks
An attacker should:
In both cases: M. O. N. E. Y.
Setting aside the blockchain from a native cryptocurrency is far from trivial and currently subject of active research!
[https://youtu.be/BuTj9raHQOU]
Most of blockchain-related technical literature focus on a specific implementation
Until now we've been general, now we must choose a reference blockchain
Ethereum: probably the most mature, studied, and documented blockchain feturing smart contracts
"[...] alternative protocol for building decentralized applications [...]"
"Ethereum does this by building what is essentially the ultimate abstract foundational layer: a blockchain with a built-in Turing-complete programming language, allowing anyone to write smart contracts and decentralized applications where they can create their own arbitrary rules for ownership, transaction formats and state transition functions."
"Smart contracts, cryptographic 'boxes' that contain value and only unlock it if certain conditions are met, can also be built on top of the platform, with vastly more power than that offered by Bitcoin scripting because of the added powers of Turing-completeness, value-awareness, blockchain-awareness and state."
Ethereum admits also smart contracts to issue transactions, besides users
The first miner to find the nonce of a block propagates its proof and, if confirmed by others, gets the right to publish the new block and a reward (a transaction fee charged on the issuer)
The specific protocol is GHOST, which provides probabilistic eventual consistency
Common in blockchains since they run asynchronously: network delays => peers may see different blocks seemingly mined at same time, or same block at different times
Probability that two distinct sub-nets find blocks $\approx$simultaneously vanishes with the length of the chain
If an hostile sub-net create blocks faster than the nice one, it can rewrite history to overtake the honest chain
Faster $\approx$ hostile sub-net is "bigger" (in computatinal terms)
Consensus protocol easy to understand and implement (verifiability)
By contrast, GHOST is quite convoluted and implementations usually have some degrees of freedom
However, RAFT is not BFT
See it in action: http://thesecretlivesofdata.com/raft/
Smart contracts are arbitrary computations executed on the blockchain
Each node in the blockchain network should behave the same, according to the protocol => each node executes the same "program" (the "blockchain application")
What if we replicate a program implementing an intepreter for other programs?
Each node of the blockchain executes arbitrary programs published through the blockchain API => Universal SMR
The blockchain becomes sort of middleware for decentralised computations!
Deployment stage:
Invocation stage:
Check out, design, and test SC for free on Ethereum Remix IDE
Follow instructions at https://github.com/ethereum/remix-workshops
Hype aside, the blockchain truly is potentially disrupting: forget about cryptocurrencies, think about Electronic Medical Records auditing, supply chain tracking, etc.
Consensus plays critical role in defining properties: strength of eventual consistency, BFT or not, role and power of miners
Smart Contracts are still to be fully explored...
From the standpoint of distributed systems and artificial intelligence, what is the expressiveness of the blockchain?
1 --> Blockchain-based coordination
2 --> Agent-oriented smart contracts
Can we implement Linda in Ethereum?
Goal: bring the blockchain to MAS world, gaining "for free" its safety and security properties
Blockchain-Based Coordination: Assessing the Expressive Power of Smart Contracts
Can we design and implement smart contracts as agents?
Goal: bring agents to the blockchain world, gaining "for free" their greater expressiveness
Towards Agent-Oriented Blockchains: Autonomous Smart Contracts
Tenderfone blockchain (developed as master thesis!)
University of Modena and Reggio Emilia
Interactive tutorials:
Introductory papers:
On consensus: