CS 261 Notes: Algorand

Similar documents
Algorand: Scaling Byzantine Agreements for Cryptocurrencies

Lecture 12. Algorand

Proof of Stake Made Simple with Casper

BlockFin A Fork-Tolerant, Leaderless Consensus Protocol April

Cryptocurrency and Blockchain Research

A Lightweight Blockchain Consensus Protocol

On the impact of propogation delay on mining rewards in Bitcoin. Xuan Wen 1. Abstract

ENEE 457: E-Cash and Bitcoin

Blockchains & Cryptocurrencies

Data Consistency and Blockchain. Bei Chun Zhou (BlockChainZ)

SpaceMint Overcoming Bitcoin s waste of energy

CS 4770: Cryptography. CS 6750: Cryptography and Communication Security. Alina Oprea Associate Professor, CCIS Northeastern University

SCP: A Computationally Scalable Byzantine Consensus Protocol for Blockchains

OUROBOROS PRAOS: AN ADAPTIVELY-SECURE, SEMI-SYNCHRONOUS

Practical Byzantine Fault Tolerance Consensus and A Simple Distributed Ledger Application Hao Xu Muyun Chen Xin Li

CS 4770: Cryptography. CS 6750: Cryptography and Communication Security. Alina Oprea Associate Professor, CCIS Northeastern University

Blockchain for Enterprise: A Security & Privacy Perspective through Hyperledger/fabric

Technical White Paper of. MOAC Mother of All Chains. June 8 th, 2017

Blockchain. CS 240: Computing Systems and Concurrency Lecture 20. Marco Canini

hard to perform, easy to verify

BYZANTINE CONSENSUS THROUGH BITCOIN S PROOF- OF-WORK

SOME OF THE PROBLEMS IN BLOCKCHAIN TODAY

Alternative Consensus

A Scalable Smart Contracts Platform

Problem: Equivocation!

Practical Byzantine Fault Tolerance. Miguel Castro and Barbara Liskov

Alternatives to Blockchains. Sarah Meiklejohn (University College London)

Hyperledger fabric: towards scalable blockchain for business

Bitcoin. CS6450: Distributed Systems Lecture 20 Ryan Stutsman

REM: Resource Efficient Mining for Blockchains

CONSENSUS PROTOCOLS & BLOCKCHAINS. Techruption Lecture March 16 th, 2017 Maarten Everts (TNO & University of Twente)

Dfinity Consensus, Explored

Analyzing Bitcoin Security. Philippe Camacho

Radix - Public Node Incentives

Solida: A Blockchain Protocol Based on Reconfigurable Byzantine Consensus

How Bitcoin achieves Decentralization. How Bitcoin achieves Decentralization

POLARIS ADAPTIVE STATE SHARDING TECHNOLOGY, A SECURE SHARDING PROTOCOL FOR BLOCKCHAINS.

I. Introduction. II. Security, Coinage and Attacks

Sybil defenses via social networks

ABOUT SOME OF THE BLOCKCHAIN PROBLEMS

Introduction to Cryptoeconomics

What is Proof of Work?

Computer Security. 14. Blockchain & Bitcoin. Paul Krzyzanowski. Rutgers University. Spring 2019

International Journal of Computer Engineering and Applications, Volume XIII, Issue II, Feb. 19, ISSN

Proof-of-Stake Protocol v3.0

Sharding. Making blockchains scalable, decentralized and secure.

GENESIS VISION NETWORK

Whitepaper Rcoin Global

Distributed Ledger Technology & Fintech Applications. Hart Montgomery, NFIC 2017

Formally Specifying Blockchain Protocols

Chapter 13. Digital Cash. Information Security/System Security p. 570/626

The Not-So-Short ZILLIQA Technical FAQ

CCP: Conflicts Check Protocol for Bitcoin Block Security 1

Key concepts of blockchain

SmartPool: practical decentralized pool mining. Loi Luu, Yaron Velner, Jason Teutsch, and Prateek Saxena August 18, 2017

EVALUATION OF PROOF OF WORK (POW) BLOCKCHAINS SECURITY NETWORK ON SELFISH MINING

CSE 486/586 Distributed Systems

BBc-1 : Beyond Blockchain One - An Architecture for Promise-Fixation Device in the Air -

RepuCoin: Your Reputation is Your Power

Alternative Consensus Algorithms. Murat Osmanoglu

Bitcoin, Security for Cloud & Big Data

Analyzing the Effects of Network Latency on Blockchain Performance and Security Using the Whiteblock Testing Platform

Scaling Nakamoto Consensus to Thousands of Transactions per Second

THE SWIRLDS HASHGRAPH CONSENSUS ALGORITHM: FAIR, FAST, BYZANTINE FAULT TOLERANCE

The security and insecurity of blockchains and smart contracts

Decentralized prediction game platform, powered by public

Lecture 3. Introduction to Cryptocurrencies

As a 3rd generation currency, not only are transactions secured, private and fast, you actually get paid for holding DigitalPrice coins.

Distributed Consensus Protocols

Smalltalk 3/30/15. The Mathematics of Bitcoin Brian Heinold

Hawk: The Blockchain Model of Cryptography and Privacy-Preserving Smart Contracts. Yashar Dehkan Asl

A Scalable Proof-of-Stake Blockchain in the Open Setting

Hybrid Consensus. Tai-Ning Liao, Xian-Ming Pan, Zhao-Heng Chiu, Imu Lin 1/65

CISC859: Topics in Advanced Networks & Distributed Computing: Network & Distributed System Security. A Brief Overview of Security & Privacy Issues

Adapting Blockchain Technology for Scientific Computing. Wei Li

The Ripple Protocol Consensus Algorithm

Adapting Blockchain Technology for Scientific Computing. Wei Li

arxiv: v2 [cs.cr] 14 Nov 2018

Formal Expression of BBc-1 Mechanism and Its Security Analysis

Enhanced Immutability of Permissioned Blockchain Networks by Tethering Provenance with a Public Blockchain Network

Blockchain Beyond Bitcoin. Mark O Connell

EECS 498 Introduction to Distributed Systems

Consensus & Blockchain

Blockchain! What consultants should know about it. Daniel

Blockchain, Cryptocurrency, Smart Contracts and Initial Coin Offerings: A Technical Perspective

Introduction to Blockchain

Blockchain Basics A. Introduction B. Key Properties

BITCOIN PROTOCOL & CONSENSUS: A HIGH LEVEL OVERVIEW

Transactions as Proof-of-Stake! by Daniel Larimer!

arxiv: v2 [cs.dc] 12 Sep 2017

Smart Transactions: An In-To-Out Manageable Transaction System

BAR gossip. Antonio Massaro. May 9, May 9, / 40

The ZILLIQA Technical Whitepaper

Byzantine fault tolerance. Jinyang Li With PBFT slides from Liskov

Darkcoin: Peer to Peer Crypto Currency with Anonymous Blockchain Transactions and an Improved Proof of Work System

ECC: Peer-to-Peer Electronic Cash with Trustless Network Services

BLOCKCHAIN ARCHITECT Certification. Blockchain Architect

Security Analysis of Bitcoin. Dibyojyoti Mukherjee Jaswant Katragadda Yashwant Gazula

A definition. Byzantine Generals Problem. Synchronous, Byzantine world

Ergo platform: from prototypes to a survivable cryptocurrency

Transcription:

CS 261 Notes: Algorand Scribe: Rachel Lawrence September 17, 2018 1 Introduction: Why Algorand? Algorand [6] is a cryptocurrency that works to reach consensus on transactions with a system based on Proof of Stake. One of the main attractions of Algorand is its lack of forks that is, unlike in Bitcoin and many other blockchains, users will never 1 see divergent versions of the cryptocurrency s transaction history. Algorand achieves this through a Byzantine Agreement protocol called BA, in which users are privately and pseudo-randomly selected to participate in a committee to execute one step of the protocol. The privately selected committee members then broadcast a message which includes their proof of selection, followed by a consensus procedure. This creates a more scalable system than Proof of Work based coins, since the transaction confirmations are much more efficient. Algorand vs. Bitcoin et al. Both Algorand and many other commonly used cryptocurrencies consist of cryptographic transactions plus a ledger which records all the transactions that have taken place. The primary difference in Algorand is the way the ledger is updated and modified to accommodate new transactions; while in Bitcoin [8] and Ethereum [4], miners solve cryptographic puzzles as a proof of work in order to add new blocks, Algorand replaces this with a Byzantine Agreement protocol based on proof of stake. Why does Algorand use a different ledger than Bitcoin, Ethereum, etc? There are a few reasons: Bitcoin doesn t scale : In Bitcoin, transaction throughput is severely limited: in a given unit of time, there is an upper bound on how many transactions can be processed. Transaction latency: It takes a long time to confirm a Bitcoin transaction it would be better if you could confirm a transaction on the order of seconds, instead of in minutes or hours. Wastefulness: Proof of work wastes huge amounts of electricity and computing power! Coupling a user s influence to their computational resources is not the only option a user s stake in the system (how many coins they own) is also a reasonable metric, and is much more efficient to prove. For a more detailed discussion of Proof of Work vs. Proof of Stake (and other alternatives), see [3]. Forks: Bitcoin and others allow temporary forks in the ledger, which means it is hard to be sure that a transaction is confirmed even after it has been added to one fork. It would be preferable if we could be sure that every participant has the same view of the ledger. 1 By never what we really mean is forks are vanishingly unlikely, so that the expected length of time between forks is 10 18 seconds on par with the time elapsed since the big bang [1]. 1

2 Algorand at a Glance Threat model Fraction honest: We assume at least 2 3 of all coins2 are held by honest users. To be considered honest includes correctness of client software an honest user is one who follows the Algorand protocol exactly as prescribed. Network synchrony: Algorand also relies on assumptions about the connectivity of participants, to ensure that the network cannot get too out-of-sync due to users failing to participate in the protocol for long intervals of time. Algorand uses the concepts of strong and weak synchrony to describe these assumptions: Goals Strong synchrony: Within a set time interval, most honest users ( 95%) can send and receive messages from most other honest users ( 95%). Weak synchrony: In every time period of length b ( a few days), there must be a strongly synchronous period of length s < b ( a few hours). That is, an adversary might completely control the network connectivity for a long, but bounded, period of time, but the network must always return to being mostly connected again for long enough to recover. The analysis of Algorand is simpler in the case of strong synchrony, but the protocol is designed to guarantee safety as long as at least weak synchrony holds. The primary goals of Algorand are improving scalability (increasing transaction throughput), decreasing transaction latency to 1 minute per transaction, and making more efficient use of computational resources by avoiding Proof of Work. Additionally, in order to function reliably, the system should have Safety and Liveness properties, as defined below. Safety: All honest users agree on the same set of transactions. Specifically, if one honest user accepts transaction A, then any future transactions agreed upon by any honest users will be in a log already containing A. Liveness: The system should make progress on confirming valid transactions within a fixed time bound; that is, the process should never get stuck in a deadlock that it can t resolve. Protocol Overview Every user is assigned a private key p k and a secret key s k. The system also includes a log of cryptographic transactions stored as a chain of blocks, and a gossip protocol for broadcasting transactions. 3. At each round of the protocol, the following procedure is executed: 1. Cryptographic sortition is used to select a committee (usually on the order of 1000 users). Users are elected to the committee with probability proportional to their stake in the system (that is, how many coins they own). 2 Food for thought: As of 2007, 1% of the US population owned > 1 of the total wealth [7]. Is the incentive to maintain 3 integrity of the network in order to protect their investments be enough to prevent them from colluding adversarially? 3 It was mentioned in class that the gossip protocol itself could be vulnerable to attacks, and its security properties haven t been investigated as rigorously as they could be. [2] provides an introduction to the topic. 2

2. Each member of the committee proposes a block, and the committee attempts to come to a consensus about which proposed block to validate. When multiple blocks are proposed, the committee is to choose the block from the highest weight user. 3. BA is used to reach consensus on a block (either a block containing correct transactions, or an empty block). During this protocol, new committees are chosen after each voting step, and each time, the votes are broadcast to all users. 3 Committee Selection Committees are selected via Cryptographic Sortition; that is, a cryptographic procedure for randomly selecting a representative set of voters. The procedure has three important properties: 1. It must select users to join the committee with probability proportional to their weights (as measured by their stake in the system the percentage of all Algorand coins owned by that user) 2. Committees must be unpredictable. This is crucial so that an adversary cannot target the committee members until after they are revealed by broadcasting their votes (at which point the committee is already disbanded). 3. Committee members must be able to privately check whether they are selected, and also be able to provide a checkable proof for others to verify the selection. Verifiable Random Functions A Verifiable Random Function, or VRF, is a pseudo-random function computed based on a secret key, whose output can be publicly verified to be correct without compromising the secret key. Figure 1: Illustration of committee selection (Source: Algorand homepage [1]) For a given input x, and parameterized by a private key, the Verifiable Random Function can be expressed as V RF sk (x) (hash, proof) where the hash is deterministic, and unpredictable to anyone without knowledge of s k. Given the hash, p k, and the proof, any user can check that the hash does in fact correspond to value x. Weighted Proof of Stake To implement Proof of Stake cryptographic sortition using VRFs, each user with weight w is thought of as a collection of w sub-users. To decide how many subusers will participate in the round, Algorand computes the VRF based on a shared seed: (hash, proof) V RF sk (seed role) and normalizes hash to a value h [0, 1): h = hash 2 length(hash) 1 3

Then to determine the number of subusers chosen, divide [0, 1) into consecutive intervals: So that the width B(k) of the k th interval satisfies B(x) = P[exactly k of the w subusers are chosen]. That is, B is distributed binomially. From here, the user can simply determine in which interval h falls, and declare the number of subusers corresponding to that interval, along with p k, hash, and proof. With this, other participants can verify that each user has declared the correct number of subusers for that round based on the VRF. 4 Byzantine Consensus and BA The BA algorithm is used to answer the question: Which block should be added to the ledger next? The algorithm relies on the votes of the rotating committee, and is essentially a more scalable, faster version of the original Byzantine Agreement protocol. Byzantine Agreement In the simplest protocol, each user broadcasts a vote to every user, and in turn receives the votes from every other user. Byzantine agreement protocols such as PBFT [5] work well for a relatively small, constant number of servers, but it becomes difficult to handle a set of users that may vary over time, and as the set of users becomes large, it is inefficient to share O(n 2 ) messages per round. Protocols relying on a fixed list of users are also vulnerable to targeted attacks on known servers, which is important to avoid in Algorand. BA In a single step of BA, the following two procedures occur: 1. Set up a new committee and vote; broadcast votes to all users via gossip protocol 2. Users process and verify the message, and tally votes received Generally, if the votes tallied exceed a certain prespecified threshold (as a fraction of the total committee members), consensus has been reached on the topic that was voted on. Note that the above specification does not say what the votes represent; this differs among the phases of BA. fix spacing fix spacing Figure 2: Cryptographic Sortition followed by gossip of votes to all users (Source: Algorand paper [6]) 4

Phases of BA 1. Reduction: In this phase, the committee selects at most 1 out of the list of possible blocks. In the case that multiple different proposed blocks exist, the committee is to choose the one corresponding to the highest-weight user. 2. BinaryBA In this phase, the committee chooses to either accept the single proposed block, or no block. 3. Finalize Sometimes, BA is unable to guarantee safety, due to asynchrony or malicious users. In this case, a block can reach what is called tentative consensus, where the votes in favor of the block reach only the lower of two thresholds. This allows the protocol to move on to new transactions, even if there is a potential fork in the ledger temporarily. When the network returns to a safe state, the committee will be able to achieve final consensus by reaching the higher vote threshold, which certifies that BA will not reach consensus on any other block that round. Once one block is finalized, all blocks above it in the chain are finalized as well. Figure 3: (Source: Algorand paper [6]) Resolving Conflicts If a user does not receive the expected number of votes, either due to poor network connectivity or an adversary withholding votes, the user continues to wait a pre-determined length of time, and then times out to allow the protocol to continue. Another possibility is that an adversarial user sends different votes to different users, causing some users to agree on block A, and others on block B. In this case, BinaryBA is used to break the tie: Committee members compute a hash function, and choose the least significant bit of the lowest hash to be the common coin, which will be broadcast in the next vote. Using the coin-flip value in the place of votes, the community can reach consensus within each successive round of BinaryBA with probability 1 2. Because the adversary has no way to increase their probability of having the lowest hash in any given round, they cannot consistently interfere with this process. 5 Discussion Defense against Common Attacks Sybil Attacks Algorand defends against Sybil (or Pseudonymous ) Attacks in which a single malicious user masquerades as several participants. In Algorand, it is irrelevant whether a user has multiple accounts their influence will always be exactly proportional to the total fraction of coins 5

they own across all accounts, and the only way to increase their influence is to earn more coins through consensus-verified transactions. DoS Attacks Algorand is also robust to targeted Denial of Service attacks. If an influential committee member s identity is known to an adversary, the adversary might be able to target that user and disrupt their connection to the rest of the network. The rotating committees make this impossible the adversary must take down a large portion of the network in order to be sure it reaches a committee member, since committee membership is secret until after the vote has already taken place. Potential pitfalls Incentives One potential shortcoming of Algorand comes from its lack of incentives. In Bitcoin and Ethereum, users are incentivized to participate in the mining pool by a reward for validating blocks. In Algorand, participating in the consensus protocol is much less computationally intensive than in Proof of Work based systems, so it is conceivable that users might participate in the protocol without any incentive (other than the incentive to add an extra honest user to help protect against adversaries). However, users might also choose not to participate without some form of reward, which could bring the system to a standstill or leave it vulnerable to adversarial committees. Cost of Storing Ledger While Algorand is more scalable than Proof of Work systems due to its relatively efficient block validation process, it does not address the memory cost inherent to storing the entire ledger on every individual server. Since Algorand is able to handle a very high transaction throughput, the ledger length could grow quickly to the point where the storage space is too high for casual users to participate. Algorand in Practice In tests, Algorand achieves its efficiency goal as compared to Bitcoin; Algorand can commit a 2 MByte block in 22 seconds, whereas to commit the same size of data in Bitcoin takes 20 minutes. With a 10 MByte block size, Algorand achieves 125x the throughput of Bitcoin. The security properties of Algorand have not yet been tested in practice; as of September 2018, Algorand has not yet been deployed as a usable cryptocurrency. However, interested users can participate in its upcoming test network [9]. References [1] Algorand contributors. Algorand : Homepage. https://www.algorand.com/, 2018. [Online; accessed 27-September-2018]. [2] Lorenzo Alvisi, Jeroen Doumen, Rachid Guerraoui, Boris Koldehofe, Harry Li, Robbert Van Renesse, and Gilles Tredan. How robust are gossip-based communication protocols? ACM SIGOPS Operating Systems Review, 41(5):14 18, 2007. [3] Shehar Bano, Alberto Sonnino, Mustafa Al-Bassam, Sarah Azouvi, Patrick McCorry, Sarah Meiklejohn, and George Danezis. Consensus in the age of blockchains. arxiv preprint arxiv:1711.03936, 2017. [4] Vitalik Buterin et al. A next-generation smart contract and decentralized application platform. white paper, 2014. [5] Miguel Castro, Barbara Liskov, et al. Practical byzantine fault tolerance. In OSDI, volume 99, pages 173 186, 1999. 6

[6] Yossi Gilad, Rotem Hemo, Silvio Micali, Georgios Vlachos, and Nickolai Zeldovich. Algorand: Scaling byzantine agreements for cryptocurrencies. In Proceedings of the 26th Symposium on Operating Systems Principles, pages 51 68. ACM, 2017. [7] Charles E Hurst, Heather M Fitz Gibbon, and Anne M Nurse. Social inequality: Forms, causes, and consequences. Routledge, 2016. [8] Satoshi Nakamoto. Bitcoin: A peer-to-peer electronic cash system. 2008. [9] David Shoots. Algorand testnet launch. https://medium.com/algorand/ algorand-testnet-launch-6fe6c5865fcf, 2018. [Online; accessed 27-September-2018]. 7