Mastering Ethereum
eBook - ePub

Mastering Ethereum

Implement advanced blockchain applications using Ethereum-supported tools, services, and protocols

Merunas Grincalaitis

  1. 490 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Mastering Ethereum

Implement advanced blockchain applications using Ethereum-supported tools, services, and protocols

Merunas Grincalaitis

Book details
Book preview
Table of contents
Citations

About This Book

An expert guide to implementing fast, secure, and scalable decentralized applications that work with thousands of users in real time

Key Features

  • Implement advanced features of the Ethereum network to build powerful decentralized applications
  • Build smart contracts on different domains using the programming techniques of Solidity and Vyper
  • Explore the architecture of Ethereum network to understand advanced use cases of blockchain development

Book Description

Ethereum is one of the commonly used platforms for building blockchain applications. It's a decentralized platform for applications that can run exactly as programmed without being affected by fraud, censorship, or third-party interference.

This book will give you a deep understanding of how blockchain works so that you can discover the entire ecosystem, core components, and its implementations. You will get started by understanding how to configure and work with various Ethereum protocols for developing dApps. Next, you will learn to code and create powerful smart contracts that scale with Solidity and Vyper. You will then explore the building blocks of the dApps architecture, and gain insights on how to create your own dApp through a variety of real-world examples. The book will even guide you on how to deploy your dApps on multiple Ethereum instances with the required best practices and techniques. The next few chapters will delve into advanced topics such as, building advanced smart contracts and multi-page frontends using Ethereum blockchain. You will also focus on implementing machine learning techniques to build decentralized autonomous applications, in addition to covering several use cases across a variety of domains such as, social media and e-commerce.

By the end of this book, you will have the expertise you need to build decentralized autonomous applications confidently.

What you will learn

  • Apply scalability solutions on dApps with Plasma and state channels
  • Understand the important metrics of blockchain for analyzing and determining its state
  • Develop a decentralized web application using React.js and Node.js
  • Create oracles with Node.js to provide external data to smart contracts
  • Get to grips with using Etherscan and block explorers for various transactions
  • Explore web3.js, Solidity, and Vyper for dApps communication
  • Deploy apps with multiple Ethereum instances including TestRPC, private chain, test chain, and mainnet

Who this book is for

This book is for anyone who wants to build fast, highly secure, and transactional decentralized applications. If you are an Ethereum developer looking to perfect your existing skills in building powerful blockchain applications, then this book is for you. Basic knowledge of Ethereum and blockchain is necessary to understand the concepts covered in this book.

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is Mastering Ethereum an online PDF/ePUB?
Yes, you can access Mastering Ethereum by Merunas Grincalaitis in PDF and/or ePUB format, as well as other popular books in Ciencia de la computación & Tratamiento de datos. We have over one million books available in our catalogue for you to explore.

Information

Year
2019
ISBN
9781789537185

Section 1: Blockchain - Ethereum Refresher

In this section, you'll develop a solid understanding of how to program better smart contracts and dApps while reviewing assumptions to improve the psychology behind code.
The following chapters are included in this section:
  • Chapter 1, Blockchain Architecture
  • Chapter 2, Ethereum Ecosystem
  • Chapter 3, Ethereum Assets

Blockchain Architecture

Blockchain architecture covers the fundamentals when it comes to understanding how the blockchain works internally. It is essential to be able to work on different projects that use different areas of Ethereum, because once you have a solid understanding about how everything works together, your mind will begin to see things differently. You will get a high-level overview of what happens in the blockchain when you use it and when you program for it. The moving parts of this complex ecosystem will begin to make so much sense once you go through this chapter, because you'll receive a high-level overview of how smart contracts work and how they are related to the underlying structure.
In this chapter, we will cover the following topics:
  • Beyond Ethereum
  • The EEA
  • Understanding the Ethereum blockchain
  • A high-level overview of how smart contracts work
  • Essential smart contract programming

Beyond Ethereum

You probably understand what Ethereum is, but just to make sure that we are on the same page, it's important that you have some background knowledge about what Ethereum really is in order to progress further without too many distractions.

Explaining Ethereum

Ethereum is, first and foremost, a blockchain. Ethereum is a technology that runs on many computers and provides its consumers with a guarantee that they are trusting a solid system that will work as expected.
"Ethereum is the world computer."
-Vitalik Buterin
To learn more about the core Ethereum ideas, check their official website: https://ethereum.org.
A web of thousands of computers connected all over the world are called nodes and they allow others to get the information they need while trusting the code with the goal of decentralizing the internet as we know it.
Why is decentralization so important for the internet? Because we have come to a point where a few big companies control the information that you and I can produce or consume.
Governments have so much power that they are getting out of control with their rules. They are biased toward what benefits them and their governors. And it's understandable—whenever some entity is at the top of the food chain, it is inevitable that they end up controlling the entire system below it sooner or later.
Ethereum's goal is to create a censorship-resistant and open platform that allows people to trust smart contracts that enforce rules that cannot be controlled by third-party entities.
When you publish a smart contract, you have a 100% guarantee that the code will run at any point and nobody will be able to interfere with it, unless the rules of it say so.

Ethereum's history

Ethereum was described in Vitalik Buterin's 2013 whitepaper, which can be found at: https://github.com/ethereum/wiki/wiki/White-Paper. He talked about the need of a scripting language that would run on top of Bitcoin, since he was involved in Bitcoin Magazine and he understood the limitations of the Bitcoin blockchain.
He saw an opportunity to create a platform that would run on decentralized technology to create new types of applications.
Not many believed in his vision, so he decided to create an entire new blockchain by himself with a small team that saw the potential in Vitalik's ideas. He founded the Ethereum Switzerland group and decided to run an Initial Coin Offering (ICO) in July 2014, where he sold Ether in exchange for Bitcoin, raising a total of about $18 million dollars.
He created the smart contracts technology, which is basically programs that run by themselves without requiring a trusted entity to execute them. They are always available, and they run without failure.
The fact that Ethereum provided a system that allows people to create their own applications on top of a blockchain is what made it successful. Before Ethereum, there was no simple way to create decentralized applications (dApps) in a decentralized platform. Bitcoin has a protocol to create simple applications using opcodes with a programming language called Script, but it's not capable of much since it is very low level and it's limited by the block size.

Ethereum's development

The development of Ethereum was planned to be done in four different stages, with major changes in each one:
  • Frontier
  • Homestead
  • Metropolis
  • Serenity
It was used to deliver and research innovative solutions as they were required, with a hard fork for functionality that is not backward compatible. In 2015, Frontier was launched as the first version of Ethereum. A year later, Homestead was launched, which included many improvements and made Ethereum a capable system with enough power to process smart contracts.
One of the biggest ICOs conducted on top of Ethereum was the decentralized autonomous organization ICO, also known as the DAO, which raised $150 million dollars with contributions from more than 11,000 people. The problem is that it got hacked by an unknown group of individuals that moved the funds to a different DAO. Interestingly enough, a group of programmers known as the White Hat Group saw the hack happening and extracted as many funds as possible into a separate decentralized organization known as the White Hat DAO, where they stored people's money to distribute them later.
This event originated a heated debate in the community that caused Ethereum to be divided in two groups, where some believed in the fact that Ethereum must be immutable and shouldn't be modified, while others believed in a hard fork to revert the damage done.
That was the beginning of Ethereum Classic and Ethereum as we know it. Ethereum Classic has a noticeable smaller user base, but it preserves the initial immutability ideals that they consider essential for a blockchain. In March 2017, several companies joined efforts to create the Ethereum Enterprise Alliance (EEA), which is currently a non-profit organization made of more than 500 members whose goal is as follows:
"To create open-source, standards-based blockchain specifications."
-Ethereum Enterprise Alliance
In other words, they created a group of people collaborating on solutions for future blockchains to come, so that they are better, faster, and more capable.
It suffered from several hacks, where millions of dollars were stolen. They had to do a hard fork to save people's funds and have a notorious price volatility, but the future looks bright and it continues, improve as demand increases.

The EEA

The EEA (entethalliance.org) is one of the most exciting projects being developed by the core Ethereum team, because they intend to help companies from all over the world to benefit from decentralized technology. By learning about this project, you'll be well positioned when it comes to working as an EEA expert.
In this section, we will cover the following topics:
  • The EEA's vision
  • The EEA membership
  • The EEA architecture
Vitalik funded the organization because he received a huge demand from executives to create software that could be used in big companies to handle demanding dApps. Those companies now want to build a private version of Ethereum to fulfill their research and development needs.
What's interesting about this initiative is that they work with hundreds of companies to research and develop solutions that are shared across them. For instance, if a company member of the EEA creates a new implementation protocol for better and faster dApps, they will share it with the other members so that they can also benefit from this cutting-edge research, while together growing the Ethereum ecosystem.

The EEA's vision

The EEA's four big public goals that they envision they will achieve in the longer term are as follows:
  • Be an open source standard, not a product:
They only work with open source code that can be shared with anybody publicly without restrictions in order to spread development advances that may or may not help others improve their blockchain products. You see, they are a non-profit organization that wants to move blockchain (as we know it) further by combining the efforts of many companies interested in private blockchain solutions.
  • Address enterprise development requirements:
The EEA helps companies incorporate the new innovations that are being discovered by others for free, so that they can enjoy the benefits of the latest requirements.
  • Share improvements between public and private Ethereum:
They want to improve what they are building by taking improvements from the public blockchain so that they can evolve faster while keeping a great product in mind.
  • Leverage existing standards:
When it comes to the blockchain technology, much is left to research and discover. Many problems regarding scalability, security, and transparency are being studied, since this type of decentralized structure is new to modern computing. So, the idea is to learn from existing standards, such as proof-of-stake (PoS), to improve faster than anyone else.
In essence, they are trying to fulfill the demands that many companies are making regarding privat...

Table of contents