BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage Articles Book Review: Building Blockchain Projects

Book Review: Building Blockchain Projects

Leia em Português

Bookmarks

Key Takeaways

  • The book provides an introductory look at building Ethereum smart contracts
  • It covers both Solidity and web3.js
  • The last part of the book introduces enterprise-level smart contract development
  • Experienced developers may find the book somewhat entry-level
  • The book is aimed at developers that already know how to program in Javascript

 

"Building Blockchain Projects", by Narayan Prusty and published by Packt, is an introductory book aimed at developers who have some experience with programming (especially in Javascript) and an interest in cryptocurrencies and related technology.

The book roughly divides into 3 parts - an initial introduction (comprising chapters 1 and 2) to distributed applications and their associated cryptocurrency ecosystems. Next is a section of chapters 3 - 5, which cover the basics of core smart contract development - including the Solidity programming language and the web3j Javascript library that can be used to control contracts, e.g. from a Node.js web application. Finally, chapters 6-9 cover topics such as deployments, accessing information external to the Ethereum blockchain and truffle (a Javascript-based build system for more complex smart contracts).

Chapter 1 deals with basic terminology of distributed applications based on cryptocurrency foundations (DApps). Even early on, the book stumbles on some simple concepts, including a rather confused description of the distinction between "distributed" and "decentralised".

The order that concepts are introduced in is also somewhat odd. Rather than starting with a description of the (potentially more familiar) use case cases such as Bitcoin and Ethereum, the book instead tries to define DApps and decentralised organisations (DAOs) directly.

This leads to a section where the book gets rather lost in the detail of concerns such as managing identity in distributed applications and the attendant difficulties. This is a bit much to take in so early on, especially without all the relevant technical concepts being introduced.

From here, the concept of a digital currency (or as the book calls it, an "internal currency") is introduced. Only at this point are some examples of DApps introduced, including Bitcoin and Ethereum. The description of Bitcoin is very short and rather lacking in nuance, with several very standard positive talking points repeated without any real analysis as to whether they're actually true or not.

Next, Ethereum is introduced in a very short section. This again seems rather odd, as the building of smart contracts and related projects on the Ethereum platform is the subject of the entire rest of the book. A much fuller description of Ethereum is provided in the next chapter, but the overall effect is somewhat jarring.

The book may well have flowed considerably better if Ethereum was introduced first, with the concepts of decentralisation woven into the narrative being told and explained as necessary.

The second chapter is much better, and provides a concentrated, if rather high-level, introduction to the Ethereum platform and its core concepts. For the reader who is unfamiliar with cryptocurrencies (or with Ethereum specifically) this may be a useful overview. However, several more conceptually challenging aspects (e.g. POS and Casper) are not covered in any depth, leaving the reader with little understanding of these parts of the technology or why they are required or useful for Ethereum.

Chapter 3, "Writing Smart Contracts" addresses the Solidity programming language. This is a tricky subject to cover - as Solidity is quite different to most other programming languages that developers are likely to have used. Unfortunately, the coverage of the language is sometimes less than clear, and fails to call out exactly which aspects of the language may differ from a reader's expectations.

For example, the usage of the var keyword does not make it at all clear whether it is required and what the semantics are.

Nevertheless, there is useful material here, not least because the fast, unvarnished presentation of the language strips bare many of Solidity's shortcomings and occasionally bizarre language design decisions.

The following chapter provides a related, very high-level introduction to the web3.js Javascript interface to Ethereum. This chapter assumes previous knowledge of Javascript and Node, and moves quite quickly. The coverage here is a reasonable introduction, but also feels rather superficial in places - almost feeling like a repeat of the online docs at times.

Another aspect that seems unnecessary is the inline dumps of HTML that appear in this chapter. This seems to be present simply to allow the reader to cut and paste the code out into an IDE from the ebook, but does seem quite jarring in a modern technical book.

Chapter 5 deals with the basics of wallets, and introduces them via the teaching aid of building a wallet service. This again uses Node to produce a simple site that's capable of signing transactions offline and managing basic wallet functionality.

The last part of the book deals with more enterprise-level concerns. Even here, however, the primary language in use is Javascript, even to the point of recommending the Javascript cross-compiled form of the Solidity compiler.

The topics covered in this part include building a basic contract deployment platform, accessing external services using Oraclize (to build a betting app as an extended example) and using the truffle build platform to create and manage larger deployments of smart contracts.

The final chapter provides a whirlwind tour through the implementation of a private blockchain (referred to as a "consortium" blockchain throughout) based on Ethereum. The primary technology used is the parity node, and the book embarks on a very rapid set of steps on how to build this from scratch. Parity is written in Rust, a language that has not previously been used in the book, and the instructions are brief to say the least.

The end result is that it feels like parity has been chosen simply because it is based on Ethereum, rather than because it is a particularly good way to showcase private ("consortium") blockchains. The technology provides a reasonable place to end the book, however.

Overall, the book suffers from a number of production problems. For example, the quality of the copy-editing and indexing is noticeably below average - there are numerous examples of incorrect grammar and spelling, as well as more serious errors (e.g. the table of contents page does not correctly link to some chapters, etc).

The book also feels quite outdated already - not only are there obvious signs of age (e.g. in the version numbers of software), but the book simply does not cover many of the major developments in the Ethereum and smart contract space over the last year.

Some of the technical material is now also obsolete or no longer recommended. For example, the issues that the Ethereum network has had with providing stable testnets and allowing developers to test in a true distributed environment are not even mentioned.

In summary, this provides an entry point into smart contract and Ethereum development that some developers may fund useful. However, experienced programmers and those who already have some knowledge of Ethereum may find other works more suitable to their needs.

Use the code "ORIQE10" at checkout to get the recommended eBook for just $10 until May 31, 2018.

About the Book Author

Narayan Prusty is a Full-Stack developer. He works as a consultant for various startups around the world. He has worked on various technologies and programming languages but is very passionate about JavaScript, WordPress, Ethereum, Solr, React, Cordova, MongoDB and AWS.

Rate this Article

Adoption
Style

BT