# Secure and Privacy-Aware Blockchain Design: Requirements, Challenges and Solutions
## 2 Blockchain: Background Knowledge
### Development of Blockchain Implementations  
Over time, it has been observed that the development of blockchain can be organized into 3 generations [19; 20; 21], as follows.  
* **First generation: digital currency.** The first generation of blockchain is a decentralized digital currency (e.g., bitcoin or digital coin) that allows participants to make transactions directly without the involvement of a centralized party [19]. The first blockchain generation solved major issues to create decentralized currency, this generation mainly relied on proof of work consensus algorithm. The main advantages of this generation are to provide decentralized storage, to enable nodes to share data directly, and to ensure transparency during transaction processing [20]. The main drawbacks are related to the energy consumption of consensus algorithms and the fact that proof-of-work gives rewards to the participants who already have the most computation power, which can be a security issue.
* **Second generation: smart contracts.** The concept of smart contract was proposed to support the self-execution of programs that execute when specific terms are met [22]. The smart contract code is stored on a public ledger and cannot be changed. The transactions that occur in a smart contract are run by the blockchain without a third party. A contract is comprised of three main parts: a unique contract address to identify them on the blockchain, private storage and amount of balance (for example, Ethereum the first implementation to provide smart contracts uses the Ether cryptocurrency). A smart contract can be written in high-level languages, for example, Ethereum uses the Solidity programming language, which can compile into low-level bytecode for the Ethereum virtual machine (EVM) code [23]. Smart contracts guarantee tamper-proof fraud prevention and reduce verification costs. It is important to highlight that some blockchain implementations do not fully, or at all, implement a smart contract. However, this second-generation still remains limited in terms of performance and scalability, as witnesses, for example, the low number to process transactions per second [21].
* **Third generation: scalability.** The third generation of blockchain focuses on improving the scalability identified in previous generations. Most limitations relate to mining delay, energy consumption, low number of transactions, mostly related to the use of proof of work type of consensus and application of smart contracts. We have also observed a growth in the number and variety of applications, such as e-Health [24] and supply chain management systems [25]. For example, the third generation of blockchain platforms includes Dfinity [26] and NEO [27], that aim at supporting different programming languages and the development of mobile-based applications [20].  
Generally, blockchain has different types depending on data availability and on what actions are allowed to perform on data by the user [28]. Thus, the following types of blockchain are available nowadays: public, private and consortium.  
* **Public blockchain:** is a permissionless ledger that is available to everyone on the network and anyone can view, read and write data on the blockchain [29]. Examples of public blockchain include Ethereum and bitcoin [30].
* **Private blockchain:** is a permissioned blockchain, which allows only specific people to verify and add transaction blocks to the blockchain [31]. Monax and multichain are private blockchain [30].
* **Consortium blockchain:** is known as federated or public permission blockchain, which allows only a group of organizations to verify and add data to the blockchain. It can be an open ledger or restricted to a particular group. R3 and Corda are consortium blockchain [32].  
Although blockchain brings several advantages such as trust, traceability, transparency, and secure distributed storage, it also has specific privacy and security requirements, as described below.