Blockchain and Cryptocurrency
It is a common belief that the bankruptcy filed by Lehman Brothers, a Wall Street banking giant, on September 15, 2008, triggered the global financial crisis in 2008-2009. Excessive risk exposure in subprime mortgage and financial derivatives by large banks almost brought down global financial systems. The crisis was the ultimate consequence of a fundamental breakdown of trust in the relationship between customers and the financial institutions that should have been serving them.
Shortly after that, Satoshi Nakamoto, a mysterious and anonymous entity, published a whitepaper on October 31, 2008, called Bitcoin: A Peer-to-Peer Electronic Cash System, which is considered the origin of Bitcoin and all cryptocurrencies. Satoshi proposed a completely decentralized approach for Peer-to-Peer (P2P) payment without central banks or intermediaries. He outlined...
Technical Requirements
For all the source code of this book, please refer the following GitHub link: github.com/Packt-Publishing/Learn-Ethereum.
Introducing blockchain technology
You might have heard the parable of the blind men and an elephant. It is a folk tale about each of six blind men's individual descriptions of the same elephant based on their own touch and feel of the animal. It highlights the fact that different perspectives may lead to distinct viewpoints, emphasizing the limits of perception and the importance of a complete context.
When Satoshi invented Bitcoin, the fundamental concept in its vision was to build a blockchain, a shared public ledger (longest proof-of-work (PoW) chain), that verifies and records immutably all transactions through a decentralized computer network (P2P network) and a consensus mechanism with computational proof. Satoshi came up with an elegant solution solving the double-spend problem of electronic monies. A double-spend is an attack when someone tries to spend money through...
Rehashing cryptography
Cryptography is the study of secure communication techniques that prevent third parties or the public from reading private messages and allow only the intended recipient of a message to view its contents. It is the cornerstone of information security, which serves as the basis for delivering secure business applications and services. Modern cryptography concerns itself with the following five objectives of information security:
- Confidentiality: This is the concept of preventing sensitive data from being accessible by any unauthorized entities.
- Integrity: This means protecting sensitive data from unauthorized changes during transit from one party to another party.
- Authentication: This is the process of ensuring that user identity is truly what the user claims it to be, whether the user is human or a system.
- Authorization: This is the concept of determining...
Anatomizing a blockchain consensus mechanism
A fundamental problem in large-scale distributed systems is how to achieve overall system reliability in the presence of failures. Systems need to be fault-tolerant. This requires a process for distributed, often heterogeneous systems to reach a consensus and agree on the network state, whether it is a database commit or an action to take. In this section, we will discuss two types of consensus algorithms, PoW and proof-of-stake (PoS).
What is consensus?
Consensus in a blockchain is the process by which a network of mutually distrusted nodes reaches an agreement on the global state of the chain of blocks. In blockchain, transactions or data are shared and distributed across the...
Understanding Bitcoin and cryptocurrency
Blockchain is the technology behind Bitcoin, which is considered the origin of all cryptocurrencies. In this section, we will introduce the basics of Bitcoin and discuss the digital payment mechanism with Bitcoin.
Bitcoin basics
Bitcoin is a decentralized electronic cash system that makes peer-to-peer payment possible without going through an intermediary. The original Bitcoin software was developed by Satoshi Nakamoto, released under the MIT license in 2009, following the Bitcoin whitepaper, Bitcoin: A Peer-to-Peer Electronic Cash System. Bitcoin is the first successful implementation of a distributed cryptocurrency. Ten years after Bitcoin was born, as of February 16, 2019, it has...
Technical Requirements
For all the source code of this book, please refer the following GitHub link :
Introducing Ethereum architecture
Vitalik Buterin, the creator of Ethereum and co-founder of the Ethereum Foundation, envisioned Ethereum as a decentralized computing platform that enables anyone to create, store, and run smart contract-based Decentralized Applications, or DApps.
As the following diagram shows, an Ethereum blockchain network is a decentralized Peer-to-Peer (P2P) network of Ethereum clients, representing network nodes. An Ethereum client refers to any node that can verify the new transaction, execute the smart contract, and process new blocks of the chain. It is a kind of enclave, residing in thousands of computers or devices on the internet, and connected through the Ethereum P2P network. What is enclaved is the EVM and the runtime environment in the P2P network for smart contract execution. The following diagram shows the P2P network:
Ethereum clients run...