Book Image

Mastering Blockchain - Fourth Edition

By : Imran Bashir
5 (3)
Book Image

Mastering Blockchain - Fourth Edition

5 (3)
By: Imran Bashir

Overview of this book

Blockchain is the backbone of cryptocurrencies, it has had a massive impact in many sectors, including finance, supply chains, healthcare, government, and media. It’s also being used for cutting edge technologies such as AI and IoT. This new edition is thoroughly revised to offer a practical approach to using Ethereum, Hyperledger, Fabric, and Corda with step-by-step tutorials and real-world use-cases to help you understand everything you need to know about blockchain development and implementation. With new chapters on Decentralized Finance and solving privacy, identity, and security issues, as well as bonus online content exploring alternative blockchains, this is an unmissable read for everyone who wants to gain a deep understanding of blockchain. The book doesn’t shy away from advanced topics and practical expertise, such as decentralized application (DApp) development using smart contracts and oracles, and emerging trends in the blockchain space. Throughout the book, you’ll explore blockchain solutions beyond cryptocurrencies, such as the IoT with blockchain, enterprise blockchains, and tokenization, and gain insight into the future scope of this fascinating and disruptive technology. By the end of this blockchain book, you will have gained a thorough comprehension of the various facets of blockchain and understand the potential of this technology in diverse real-world scenarios.
Table of Contents (24 chapters)
23
Index

Blockchain

As we discussed in Chapter 1, Blockchain 101, a blockchain is a distributed ledger of transactions. Specifically, from Bitcoin's perspective, the blockchain can be defined as a public, distributed ledger holding a timestamped, ordered, and immutable record of all transactions on the Bitcoin network. Transactions are picked up by miners and bundled into blocks for mining. Each block is identified by a hash and is linked to its previous block by referencing the previous block's hash in its header.

The data structure of a Bitcoin block is shown in the following table:

Field Size Description
Block size 4 bytes The size of the block.
Block header 80 bytes This includes fields from the block header described in the next section.
Transaction counter Variable The field contains the total number of transactions in the block, including the coinbase transaction. Size ranges from 1-9 bytes.
Transactions Variable All transactions in the block.

The block header mentioned...