Hyperledger PDF
Hyperledger PDF
Christian Cachin
July 2016
Overview. A blockchain is best understood in the model of state-machine replication [8], where a
service maintains some state and clients invoke operations that transform the state and generate outputs.
A blockchain emulates a “trusted” computing service through a distributed protocol, run by nodes con-
nected over the Internet. The service represents or creates an asset, in which all nodes have some stake.
The nodes share the common goal of running the service but do not necessarily trust each other for
more. In a “permissionless” blockchain such as the one underlying the Bitcoin cryptocurrency, anyone
can operate a node and participate through spending CPU cycles and demonstrating a “proof-of-work.”
On the other hand, blockchains in the “permissioned” model control who participates in validation and
in the protocol; these nodes typically have established identities and form a consortium. A report of
Swanson compares the two models [9].
Architecture. The validating peers run a BFT consensus protocol for executing a replicated state
machine that accepts three types of transactions as operations:
Deploy transaction: Takes a chaincode (representing a smart contract) written in Go as a parameter; the
chaincode is installed on the peers and ready to be invoked.
Invoke transaction: Invokes a transaction of a particular chaincode that has been installed earlier through
a deploy transaction; the arguments are specific to the type of transaction; the chaincode executes the
transaction, may read and write entries in its state accordingly, and indicates whether it succeeded or
failed.
Query transaction: Returns an entry of the state directly from reading the peer’s persistent state; this
may not ensure linearizability.
Each chaincode may define its own persistent entries in the state. The blockchain’s hash chain is
computed over the executed transactions and the resulting persistent state.
Validation of transactions occurs through the replicated execution of the chaincode and given the
fault assumption underlying BFT consensus, i.e., that among the n validating peers at most f < n/3
may “lie” and behave arbitrarily, but all others execute the chaincode correctly. When executed on top
of PBFT consensus, it is important that chaincode transactions are deterministic, otherwise the state
of the peers might diverge. A modular solution to filter out non-deterministic transactions that are
demonstrably diverging is available and has been implemented in the SIEVE protocol [3].
Membership among the validating nodes running BFT consensus is currently static and the setup
requires manual intervention. Support for dynamically changing the set of nodes running consensus is
planned for a future version.
As the fabric implements a permissioned ledger, it contains a security infrastructure for authen-
tication and authorization. It supports enrollment and transaction authorization through public-key
certificates, and confidentiality for chaincode realized through in-band encryption.
More precisely, for connecting to the network every peer needs to obtain an enrollment certificate
from an enrollment CA that is part of the membership services. It authorizes a peer to connect to the
network and to acquire transaction certificates, which are needed to submit transactions. Transaction
certificates are issued by a transaction CA and support pseudonymous authorization for the peers sub-
mitting transactions, in the sense that multiple transaction certificates issued to the same peer (that is, to
the same enrollment certificate) cannot be linked with each other.
Confidentiality for chaincodes and state is provided through symmetric-key encryption of transac-
tions and states with a blockchain-specific key that is available to all peers with an enrollment certificate
for the blockchain. Extending the encryption mechanisms towards more fine-grained confidentiality for
transactions and state entries is planned for a future version.
Discussion. Consensus protocols for blockchain are currently being debated very actively, in re-
search [6, 10] but also by fintech startup companies (e.g., tendermint.com, kadena.io). The
fabric’s design uses a modular notion of consensus, which is aligned with the well-established concept
of consensus in distributed computing. This ensures that the blockchain-related features of the fabric
can be developed independently of the specific consensus protocol. The PBFT protocol [4] has been
implemented as the first one in the fabric because of its prominence: it benefits from the experience
of almost 20 years of systems-level research on Byzantine consensus, is closely related to well-known
protocols like viewstamped replication and Paxos [7], has been analyzed in many environments [5, 1],
and is described in textbooks [2].
Conclusion. The Hyperledger Fabric is a permissioned blockchain platform aimed at business use. It
is open-source and based on standards, runs user-defined smart contracts, supports strong security and
identity features, and uses a modular architecture with pluggable consensus protocols.
The fabric is currently evolving and being actively developed under the governance of the Hyper-
ledger Project. More information about the fabric is available online at
github.com/hyperledger/fabric/blob/master/docs/protocol-spec.md
References
[1] Y. Amir, B. A. Coan, J. Kirsch, and J. Lane. Prime: Byzantine replication under attack. IEEE
Transactions on Dependable and Secure Computing, 8(4):564–577, 2011.
[2] C. Cachin, R. Guerraoui, and L. Rodrigues. Introduction to Reliable and Secure Distributed Pro-
gramming (Second Edition). Springer, 2011.
[4] M. Castro and B. Liskov. Practical Byzantine fault tolerance and proactive recovery. ACM Trans-
actions on Computer Systems, 20(4):398–461, Nov. 2002.
[5] A. Clement, E. L. Wong, L. Alvisi, M. Dahlin, and M. Marchetti. Making Byzantine fault tolerant
systems tolerate Byzantine faults. In Proc. 6th Symp. Networked Systems Design and Implemen-
tation (NSDI), pages 153–168, 2009.
[6] J. A. Garay, A. Kiayias, and N. Leonardos. The bitcoin backbone protocol: Analysis and appli-
cations. In Advances in Cryptology: Eurocrypt 2015, volume 9057 of Lecture Notes in Computer
Science, pages 281–310. Springer, 2015.
[7] B. Liskov. From viewstamped replication to Byzantine fault tolerance. In B. Charron-Bost, F. Pe-
done, and A. Schiper, editors, Replication: Theory and Practice, volume 5959 of Lecture Notes in
Computer Science, pages 121–149. Springer, 2010.
[8] F. B. Schneider. Implementing fault-tolerant services using the state machine approach: A tutorial.
ACM Computing Surveys, 22(4):299–319, Dec. 1990.
[10] M. Vukolić. The quest for scalable blockchain fabric: Proof-of-work vs. BFT replication. In Open
Problems in Network Security, Proc. IFIP WG 11.4 Workshop (iNetSec 2015), volume 9591 of
Lecture Notes in Computer Science, pages 112–125. Springer, 2016.