Mastering Blockchain
eBook - ePub

Mastering Blockchain

Imran Bashir

Condividi libro
  1. 656 pagine
  2. English
  3. ePUB (disponibile sull'app)
  4. Disponibile su iOS e Android
eBook - ePub

Mastering Blockchain

Imran Bashir

Dettagli del libro
Anteprima del libro
Indice dei contenuti
Citazioni

Informazioni sul libro

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.

Domande frequenti

Come faccio ad annullare l'abbonamento?
È semplicissimo: basta accedere alla sezione Account nelle Impostazioni e cliccare su "Annulla abbonamento". Dopo la cancellazione, l'abbonamento rimarrà attivo per il periodo rimanente già pagato. Per maggiori informazioni, clicca qui
È possibile scaricare libri? Se sì, come?
Al momento è possibile scaricare tramite l'app tutti i nostri libri ePub mobile-friendly. Anche la maggior parte dei nostri PDF è scaricabile e stiamo lavorando per rendere disponibile quanto prima il download di tutti gli altri file. Per maggiori informazioni, clicca qui
Che differenza c'è tra i piani?
Entrambi i piani ti danno accesso illimitato alla libreria e a tutte le funzionalità di Perlego. Le uniche differenze sono il prezzo e il periodo di abbonamento: con il piano annuale risparmierai circa il 30% rispetto a 12 rate con quello mensile.
Cos'è Perlego?
Perlego è un servizio di abbonamento a testi accademici, che ti permette di accedere a un'intera libreria online a un prezzo inferiore rispetto a quello che pagheresti per acquistare un singolo libro al mese. Con oltre 1 milione di testi suddivisi in più di 1.000 categorie, troverai sicuramente ciò che fa per te! Per maggiori informazioni, clicca qui.
Perlego supporta la sintesi vocale?
Cerca l'icona Sintesi vocale nel prossimo libro che leggerai per verificare se è possibile riprodurre l'audio. Questo strumento permette di leggere il testo a voce alta, evidenziandolo man mano che la lettura procede. Puoi aumentare o diminuire la velocità della sintesi vocale, oppure sospendere la riproduzione. Per maggiori informazioni, clicca qui.
Mastering Blockchain è disponibile online in formato PDF/ePub?
Sì, puoi accedere a Mastering Blockchain di Imran Bashir in formato PDF e/o ePub, così come ad altri libri molto apprezzati nelle sezioni relative a Computer Science e Cryptography. Scopri oltre 1 milione di libri disponibili nel nostro catalogo.

Informazioni

Anno
2018
ISBN
9781788838672
Edizione
2
Categoria
Cryptography

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 ...

Indice dei contenuti