For those who are not familiar with Hyperledger project, reading Blockchain Overview, Intro to Hyperledger Family and Hyperledger Blockchain Ecosystem, Hyperledger Design Philosophy and Framework Architecture, and Overview of Building Blockchain Smart Contracts in Hyperledger articles are strongly recommended.
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.
Sawtooth is also highly modular. This modularity enables enterprises and consortia to make policy decisions that they are best equipped to make. Sawtooth’s core design allows applications to choose the transaction rules, permissioning, and consensus algorithms that support their unique business needs.
Sawtooth is an open source project under the Hyperledger umbrella.
About Distributed LedgersA “distributed ledger” is another term for a blockchain. It distributes a database (a ledger) of transactions to all participants in a network (also called “peers” or “nodes”). There is no central administrator or centralized data storage. In essence, it is:
- Distributed: The blockchain database is shared among potentially untrusted participants and is demonstrably identical on all nodes in the network. All participants have the same information.
- Immutable: The blockchain database is an unalterable history of all transactions that uses block hashes to make it easy to detect and prevent attempts to alter the history.
- Secure: All changes are performed by transactions that are signed by known identities.
These features work together, along with agreed-upon consensus mechanisms, to provide “adversarial trust” among all participants in a blockchain network.
Distinctive Features of Sawtooth1- Separation Between the Application Level and the Core System
Sawtooth makes it easy to develop and deploy an application by providing a clear separation between the application level and the core system level. Sawtooth provides smart contract abstraction that allows application developers to write contract logic in a language of their choice.
An application can be a native business logic or a smart contract virtual machine. In fact, both types of applications can co-exist on the same blockchain. Sawtooth allows these design decisions to be made in the transaction-processing layer, which allows multiple types of applications to exist in the same instance of the blockchain network.
Each application defines the custom transaction processors for its unique requirements. Sawtooth provides several example transaction families to serve as models for low-level functions, such as maintaining chain-wide settings and storing on-chain permissions, and for specific applications such as performance analysis and storing block information.
2- Private Networks with the Sawtooth Permissioning Features
Sawtooth is built to solve the challenges of permissioned (private) networks. Clusters of Sawtooth nodes can be easily deployed with separate permissioning. There is no centralized service that could potentially leak transaction patterns or other confidential information.
The blockchain stores the settings that specify the permissions, such as roles and identities, so that all participants in the network can access this information.
3- Parallel Transaction Execution
Most blockchains require serial transaction execution in order to guarantee consistent ordering at each node on the network. Sawtooth includes an advanced parallel scheduler that splits transactions into parallel flows. Based on the locations in state which are accessed by a transaction, Sawtooth isolates the execution of transactions from one another while maintaining contextual changes.
When possible, transactions are executed in parallel, while preventing double-spending even with multiple modifications to the same state. Parallel scheduling provides a substantial potential increase in performance over serial execution.
4- Event System
Hyperledger Sawtooth supports creating and broadcasting events. This allows applications to:
- Subscribe to events that occur related to the blockchain, such as a new block being committed or switching to a new fork.
- Subscribe to application specific events defined by a transaction family.
- Relay information about the execution of a transaction back to clients without storing that data in state.
Subscriptions are submitted and serviced over a ZMQ Socket.
5- Ethereum Contract Compatibility with Seth
The Sawtooth-Ethereum integration project, Seth, extends the interoperability of the Sawtooth platform to Ethereum. EVM (Ethereum Virtual Machine) smart contracts can be deployed to Sawtooth using the Seth transaction family.
6- Pluggable consensus algorithms
In a blockchain, consensus is the process of building agreement among a group of mutually distrusting participants. Algorithms for achieving consensus with arbitrary faults generally require some form of voting among a known set of participants. General approaches include Nakamoto-style consensus, which elects a leader through some form of lottery, and variants of the traditionalByzantine Fault Tolerance (BFT) algorithms, which use multiple rounds of explicit votes to achieve consensus.
Sawtooth abstracts the core concepts of consensus and isolates consensus from transaction semantics. The interface supports plugging in various consensus implementations. More importantly, Sawtooth allows different types of consensus on the same blockchain. The consensus is selected during the initial network setup and can be changed on a running blockchain with a transaction.
Sawtooth currently supports these consensus implementations:
- Proof of Elapsed Time (PoET), a Nakamoto-style consensus algorithm that is designed to be a production-grade protocol capable of supporting large network populations. PoET relies on secure instruction execution to achieve the scaling benefits of a Nakamoto-style consensus algorithm without the power consumption drawbacks of the Proof of Work algorithm.
- PoET simulator, which provides PoET-style consensus on any type of hardware, including a virtualized cloud environment.
- Dev mode, a simplified random-leader algorithm that is useful for development and testing.
7- Sample Transaction Families
In Sawtooth, the data model and transaction language are implemented in a transaction family. While we expect users to build custom transaction families that reflect the unique requirements of their ledgers, we provide several core transaction families as models:
- IntegerKey - Used for testing deployed ledgers.
- Settings - Provides a reference implementation for storing on-chain configuration settings.
- Identity - Handles on-chain permissioning for transactor and validator keys to streamline managing identities for lists of public keys.
Additional transaction families provide models for specific areas:
- Smallbank - Handles performance analysis for benchmarking and performance testing when comparing the performance of blockchain systems. This transaction family is based on the H-Store Smallbank benchmark.
- BlockInfo - Provides a methodology for storing information about a configurable number of historic blocks.
After finishing this article, you can work on these recipes: Blockchain Developer Guide- How to Install and work with Hyperledger Sawtooth and Configuring Hyperledger Sawtooth Validator and REST API.
To conclude this article, we like to recommend our Blockchain Hyperledger Development in 30 hours course to those interested in pursuing a blockchain development career. Indeed, as of this writing, Hyperledger Foundation offers the following two Hyperledger certifications: The Certified Hyperledger Fabric Administrator (CHFA) and The Certified Hyperledger Sawtooth Administrator (CHSA), both of which are highly regarded in the industry. Hyperledger Foundation is in the process of creating Hyperledger Developer certification program, which may be released in early or middle of 2020. In short, by taking our hands-on online Hyperledger class, you would be able to obtain CHFA certification.