Essential Developer Guide for Building Blockchain Applications Using Hyperledger Sawtooth
Tags: blockchain, hyperledger, sawtooth
Published: 2019-07-08 14:02:30

<p align="center"></p>
<p>Hyperledger Sawtooth is an enterprise blockchain platform  for building distributed ledger applications and networks. The design  philosophy targets keeping ledgers&nbsp;distributed&nbsp;and making smart  contracts&nbsp;safe, particularly for enterprise use.<br>
  <br>
  Sawtooth simplifies blockchain application development by separating the core  system from the application domain. Application developers can specify the  business rules appropriate for their application, using the language of their  choice, without needing to know the underlying design of the core system.<br>
  <br>
  Sawtooth is also highly modular. This modularity enables enterprises and  consortia to make policy decisions that they are best equipped to make.  Sawtooth&rsquo;s core design allows applications to choose the transaction rules,  permissioning, and consensus algorithms that support their unique business  needs.<br>
  <br>
  For those who are not familiar with Hyperledger  project&nbsp;<a href="https://weg2g.com/application/touchstonewords/article-intro-to-hyperledger-family-and-hyperledger-blockchain-ecosystem.php">Intro  to Hyperledger Family and Hyperledger Blockchain Ecosystem</a>&nbsp;and&nbsp;<a href="https://weg2g.com/application/touchstonewords/article-overview-of-hyperledger-design-philosophy-and-framework-architecture.php">Hyperledger  Design Philosophy and Framework Architecture</a>&nbsp;articles are strongly recommended.</p>
<p>The  features offered by Hyperledger Sawtooth are the following:</p>
<ul>
  <li><strong>A truly distributed DLT</strong>:  The Hyperledger Sawtooth blockchain network is<strong> </strong>made up of validator nodes. The ledger is shared between all  validator nodes and each node has the same information. They participate in a  consensus to manage the network.</li>
  <li><strong>Proof of Elapsed Time (PoET) consensus and support for  large-scale networks</strong>:<strong> </strong>Hyperledger Sawtooth includes a novel consensus algorithm, PoET.  PoET is a <strong>Byzantine Fault-tolerance </strong>(<strong>BFT</strong>) consensus algorithm that supports  large-scale<strong> </strong>networks with minimal  computing and much more efficient resource consumption compared to proof of  work algorithms. PoET was invented by Intel and utilizes the special CPU  instruction set called <strong>Software Guard  Extensions</strong> (<strong>SGX</strong>), to achieve the  scaling benefits of the Nakamoto-style consensus algorithms. Each node waits  for a random period of time and the first node to finish is the leader and  commits the next block.</li>
  <li><strong>Fast transaction performance</strong>: Hyperledger Sawtooth keeps the latest version of<strong> </strong>assets in the global state and  transactions in the block chain on each network node. This means that you can  look up the state quickly to carry out CRUD actions, which provides fast  transaction processing. Sawtooth requires transactions to be processed in  batches and supports parallel scheduling of transactions. Parallel transaction  execution not only accelerates the execution of transactions but also correctly  handles the double spending problem known as <strong>Unspent Transaction Output </strong>(<strong>UTXO</strong>).</li>
  <li><strong>Support for a broad variety of  languages</strong>: Sawtooth  supports the<strong> </strong>implementation of  transaction families (safe and smart contracts) in a wide variety of  programming languages, including Python, Go, Rust, Java, and JavaScript.</li>
  <li><strong>The ability to configure private,  public, and consortium blockchain networks</strong>:</li>
</ul>
<p>&nbsp;</p>
<p>Sawtooth  can be configured with different permissions to build private, consortium, or  public networks by specifying which nodes are allowed to join the validator  network and participate in the consensus, and which clients are allowed to  submit batches and transactions. </p>
<p>In this article, I give  step-by-step guide for building blockchain applications using Hyperledger  Sawtooth. Good knowledge of blockchain concepts, JavaScript and Python as well  as basic skills in Linux OS is required in order to complete tutorials listed  on this article. <br>
  <br>
  In short, we follow below  steps:</p>
<ul>
  <li>Install Hyperledger Sawtooth on a cloud service  like AWS</li>
  <li>Configure Sawtooth validators and REST API</li>
  <li>Design a namespace and address for a transaction  family</li>
  <li> Implement a transaction family</li>
  <li>Build a transaction processor</li>
  <li> Grant  permission on the Sawtooth network </li>
  <li>Develop client applications with the Sawtooth  REST API and SDK</li>
</ul>
<p>To help blockchain  developers to find their feet in Hyperledger Sawtooth development, I&rsquo;ve written  a series of hands-on tutorials to cover each topic in depth as follows. </p>
<p><strong>Install </strong><strong>Hyperledger Sawtooth</strong><br>
  Follow <a href="https://myhsts.org/tutorial-learn-how-to-install-and-work-with-blockchain-hyperledger-sawtooth.php">Install  and Work with Hyperledger Sawtooth</a> recipe.<br>
  <br>
  <strong>Configure Sawtooth Validators and REST API</strong><br>
  Follow <a href="https://myhsts.org/tutorial-learn-how-to-configure-hyperledger-sawtooth-validator-and-rest-api-on-aws.php">Configuring  Hyperledger Sawtooth Validator and REST API on AWS</a> recipe. <br>
  <br>
  <strong>Design a Namespace and Address for Transaction  Family and Implement Transaction Family</strong><br>
  Follow <a href="https://developer.ibm.com/recipes/tutorials/designing-namespace-and-address-for-hyperledger-sawtooth-transaction-family/">Designing  Namespace and Address for Hyperledger Sawtooth Transaction Family</a> recipe</p>
<p><strong>Build a Transaction Processor and Grant  Permission on the Sawtooth Network</strong><br>
  Follow <a href="https://developer.ibm.com/recipes/tutorials/building-transaction-handler-and-processor-for-hyperledger-sawtooth-with-python-sdk/">Building  Transaction Handler and Processor for Hyperledger Sawtooth with Python SDK</a> recipe</p>
<p><strong>Develop Client Applications with the Sawtooth  REST API and SDK</strong><br>
  Follow <a href="https://myhsts.org/tutorial-learn-how-to-build-transaction-processor-as-a-service-and-python-egg-for-hyperledger-sawtooth.php">Transaction Processor and Python Egg For Hyperledger Sawtooth</a> recipe. </p>
<p><strong>About Authors</strong><br>
  This article  is written by Matt Zand (Founder of <a href="https://myhsts.org">High School Technology Services</a>) in collaboration with Brian Wu who  is a senior blockchain instructor at <a href="https://coding-bootcamps.com/">Coding Bootcamps</a>. </p>