Mastering Blockchain
eBook - ePub

Mastering Blockchain

Imran Bashir

Buch teilen
  1. 656 Seiten
  2. English
  3. ePUB (handyfreundlich)
  4. Über iOS und Android verfügbar
eBook - ePub

Mastering Blockchain

Imran Bashir

Angaben zum Buch
Buchvorschau
Inhaltsverzeichnis
Quellenangaben

Über dieses Buch

Publisher's Note: This edition from 2018 is outdated and does not cover the latest insights on consensus algorithms, Ethereum 2.0, tokenization, and enterprise blockchains. A new and updated edition of this book that includes all the newest developments and improvements in Blockchain including the above topics is now available.

Learn about cryptography and cryptocurrencies, so you can build highly secure, decentralized applications and conduct trusted in-app transactions.

Key Features

  • Get to grips with the underlying technical principles and implementations of blockchain
  • Build powerful applications using Ethereum to secure transactions and create smart contracts
  • Explore cryptography, mine cryptocurrencies, and solve scalability issues with this comprehensive guide

Book Description

A blockchain is a distributed ledger that is replicated across multiple nodes and enables immutable, transparent and cryptographically secure record-keeping of transactions. The blockchain technology is the backbone of cryptocurrencies, and it has applications in finance, government, media and almost all other industries. Mastering Blockchain, Second Edition has been thoroughly updated and revised to provide a detailed description of this leading technology and its implementation in the real world.

This book begins with the technical foundations of blockchain technology, teaching you the fundamentals of distributed systems, cryptography and how it keeps data secure. You will learn about the mechanisms behind cryptocurrencies and how to develop applications using Ethereum, a decentralized virtual machine. You will also explore different other blockchain solutions and get an introduction to business blockchain frameworks under Hyperledger, a collaborative effort for the advancement of blockchain technologies hosted by the Linux Foundation. You will also be shown how to implement blockchain solutions beyond currencies, Internet of Things with blockchain, blockchain scalability, and the future scope of this fascinating and powerful technology.

What you will learn

  • Master the theoretical and technical foundations of the blockchain technology
  • Understand the concept of decentralization, its impact, and its relationship with blockchain technology
  • Master how cryptography is used to secure data - with practical examples
  • Grasp the inner workings of blockchain and the mechanisms behind bitcoin and alternative cryptocurrencies
  • Understand the theoretical foundations of smart contracts
  • Learn how Ethereum blockchain works and how to develop decentralized applications using Solidity and relevant development frameworks
  • Identify and examine applications of the blockchain technology - beyond currencies
  • Investigate alternative blockchain solutions including Hyperledger, Corda, and many more

Who this book is for

This book will appeal to those who wish to build fast, highly secure, transactional applications. It targets people who are familiar with the concept of blockchain and are comfortable with a programming language.

Häufig gestellte Fragen

Wie kann ich mein Abo kündigen?
Gehe einfach zum Kontobereich in den Einstellungen und klicke auf „Abo kündigen“ – ganz einfach. Nachdem du gekündigt hast, bleibt deine Mitgliedschaft für den verbleibenden Abozeitraum, den du bereits bezahlt hast, aktiv. Mehr Informationen hier.
(Wie) Kann ich Bücher herunterladen?
Derzeit stehen all unsere auf Mobilgeräte reagierenden ePub-Bücher zum Download über die App zur Verfügung. Die meisten unserer PDFs stehen ebenfalls zum Download bereit; wir arbeiten daran, auch die übrigen PDFs zum Download anzubieten, bei denen dies aktuell noch nicht möglich ist. Weitere Informationen hier.
Welcher Unterschied besteht bei den Preisen zwischen den Aboplänen?
Mit beiden Aboplänen erhältst du vollen Zugang zur Bibliothek und allen Funktionen von Perlego. Die einzigen Unterschiede bestehen im Preis und dem Abozeitraum: Mit dem Jahresabo sparst du auf 12 Monate gerechnet im Vergleich zum Monatsabo rund 30 %.
Was ist Perlego?
Wir sind ein Online-Abodienst für Lehrbücher, bei dem du für weniger als den Preis eines einzelnen Buches pro Monat Zugang zu einer ganzen Online-Bibliothek erhältst. Mit über 1 Million Büchern zu über 1.000 verschiedenen Themen haben wir bestimmt alles, was du brauchst! Weitere Informationen hier.
Unterstützt Perlego Text-zu-Sprache?
Achte auf das Symbol zum Vorlesen in deinem nächsten Buch, um zu sehen, ob du es dir auch anhören kannst. Bei diesem Tool wird dir Text laut vorgelesen, wobei der Text beim Vorlesen auch grafisch hervorgehoben wird. Du kannst das Vorlesen jederzeit anhalten, beschleunigen und verlangsamen. Weitere Informationen hier.
Ist Mastering Blockchain als Online-PDF/ePub verfügbar?
Ja, du hast Zugang zu Mastering Blockchain von Imran Bashir im PDF- und/oder ePub-Format sowie zu anderen beliebten Büchern aus Computer Science & Cryptography. Aus unserem Katalog stehen dir über 1 Million Bücher zur Verfügung.

Information

Jahr
2018
ISBN
9781788838672

Further Ethereum

This chapter is the continuation of the previous chapter. We will examine more concepts of Ethereum such as programming languages that can be used to program smart contracts on Ethereum.
We will also cover both a practical and theoretical in-depth introduction to wallet software, mining, and setting up Ethereum nodes. Material on various challenges, such as security and scalability faced by Ethereum, will also be introduced. Additionally, trading and market dynamics will be discussed. Moreover, prominent advanced supporting protocols such as Swarm and Whisper will also be introduced in this chapter.
Ethereum has several programming languages built-in to support smart contract development. We will start with programming languages and will gradually discuss other relevant topics.
This chapter includes discussion of the elements of Ethereum blockchain that we started in the previous chapter, Chapter 10, Ethereum 101. These elements include
  • Programming languages
  • Blocks and Blockchain
  • Nodes and miners
  • Wallets and client software
  • APIs (Web3)
  • Supporting protocols
First, we will introduce programming languages which are used to develop smart contracts on the Ethereum blockchain.

Programming languages

Code for smart contracts in Ethereum is written in a high-level language such as Serpent, LLL, Solidity, or Viper and is converted into the bytecode that EVM understands for it to be executed.
Solidity is one of the high-level languages that has been developed for Ethereum with JavaScript like syntax to write code for smart contracts. Once the code is written, it is compiled into bytecode that's understandable by the EVM using the Solidity compiler called solc.
Official Solidity documentation is available at http://solidity.readthedocs.io/en/latest/.
Low-level Lisp-like Language (LLL) is another language that is used to write smart contract code. Serpent is a Python-like high-level language that can be used to write smart contracts for Ethereum. Vyper is a newer language which has been developed from scratch to achieve a secure, simple, and auditable language.
More information regarding Vyper is available at https://github.com/ethereum/vyper.
LLL and Serpent are no longer supported by the community and their usage has almost diminished. Most commonly used language is Solidity, which we will discuss at length in this chapter.
For example, a simple program in Solidity is shown as follows:
pragma solidity ^0.4.0; contract Test1 { uint x=2; function addition1(uint x) returns (uint y) { y=x+2; } } 
This program is converted into bytecode, as shown in the following subsection. Details on how to compile Solidity code with examples will be given in Chapter 13, Development Tools and Frameworks.

Runtime bytecode

Raw hex codes:
606060405260e060020a6000350463989e17318114601c575b6000565b346000576029600435603b565b60408051918252519081900360200190f35b600281015b91905056 
Opcodes:
PUSH1 0x60 PUSH1 0x40 MSTORE PUSH1 0x2 PUSH1 0x0 SSTORE CALLVALUE PUSH1 0x0 JUMPI JUMPDEST PUSH1 0x45 DUP1 PUSH1 0x1A PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN PUSH1 0x60 PUSH1 0x40 MSTORE PUSH1 0xE0 PUSH1 0x2 EXP PUSH1 0x0 CALLDATALOAD DIV PUSH4 0x989E1731 DUP2 EQ PUSH1 0x1C JUMPI JUMPDEST PUSH1 0x0 JUMP JUMPDEST CALLVALUE PUSH1 0x0 JUMPI PUSH1 0x29 PUSH1 0x4 CALLDATALOAD PUSH1 0x3B JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD SWAP2 DUP3 MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x20 ADD SWAP1 RETURN JUMPDEST PUSH1 0x2 DUP2 ADD JUMPDEST SWAP2 SWAP1 POP JUMP 

Opcodes and their meaning

There are different opcodes that have been introduced in the EVM. Opcodes are divided into multiple categories based on the operation they perform. The list of opcodes with their meaning and usage is ...

Inhaltsverzeichnis