Abstract:
Hyperledger Sawtooth is an open-source blockchain platform under the Hyperledger enterprise initiative of the Linux foundation. This article starts with a brief introduction to Sawtooth, followed by detailed architecture. The key features of Sawtooth, and the operations of each module in the blockchain node are discussed here. 
Blockchain is a decentralized, distributed, immutable ledger system shared across a network introduced in 2008.

1. Introduction 
Blockchain is a decentralized, distributed, immutable ledger system shared across a network introduced in 2008. The Hyperledger foundation is “an open-source collaborative effort to advance cross-industry blockchain technologies. It is a global collaboration, hosted by The Linux Foundation, including leaders in finance, banking, IoT, supply chain, manufacturing, and technology” [1]. One of the most popular Hyperledger products is Hyperledger Sawtooth. One of the most popular Hyperledger products is Hyperledger Sawtooth. A key goal of Sawtooth is to make Smart Contract execution safe, which is crucial for enterprise applications [2]. Hyperledger Sawtooth is gaining popularity for smart contract execution because of its highly modular approach. It facilitates the Sawtooth core design such that the transaction rules, permissions, and consensus algorithms can be customized according to the particular area of application.

 

Fig 1: Block structure in Hyperledger Sawtooth

Sawtooth has some distinctive features:

Separation:The separation between the application level and the core system. With Sawtooth, users can build their models based on their business needs. Transaction rules, permissions, and consensus settings are handled in the Transaction Processing part. The Transaction Processors are the Server side of the application, while validators manage the core functionalities like verifying the transactions submitted using the particular consensus algorithm. 

Multi Language SupportOne of the striking features and the reason for the popularity of Sawtooth is the multiple language support, including Python, JavaScript, Go, Rust, C++, etc., for the client and server sides. The language best suited for the desired operation can be chosen using one of the SDKs among the ones provided.     

Parallel transaction ExecutionParallel transaction execution is one of the most sought-after features in blockchain to enhance speed and performance. Hyperledger Sawtooth facilitates that by splitting transactions into parallel flows. 

ConsensusThe consensus algorithm provides a way to ensure mutual agreement and trust among a group of participants. As Sawtooth separates consensus from transaction semantics, the user can implement multiple types of consensus on the same blockchain. In addition, it allows the user to change the consensus algorithm on a running blockchain.  

Other notable features of Sawtooth include permissioned and permissionless architecture, compatibility with Seth Ethereum Contracts. 

2. Architecture 

In Sawtooth, the modular design separates the application and core levels. Sawtooth views smart contracts as a state machine or transaction processor [3]. By creating and applying transactions, the state can be modified. One or more transactions wrapped together form a batch. A batch is the atomic unit of change in the system. Multiple batches are combined to form a block (Figure: 1). The principal modules observed in Figure. 2 of the Sawtooth blockchain node are

 Validator: A validator is made up of the state management, transaction handling, and interconnection network components of a Sawtooth node.

 Global State: Sawtooth uses an addressable Radix Merkle tree to store data for transaction families. Like a Merkle tree the successive node hashes are stored from leaf-to-root and like a Radix tree, the addresses uniquely identify the paths to leaf nodes.

 Journal: The Block Completer, Block Validator, and Chain Controller modules make up the Journal of the node. All these modules work together to produce and validate blocks in the network. The blocks under processing are stored in BlockCache and BlockStore.

Transaction Scheduler: Transaction scheduler selects the transaction for execution. Sawtooth parallel scheduler utilizes a tree structure to keep track of dependencies using a Merkle tree. Each data location has read and write lists that contain the ID of the transactions that are accessing them.

Transaction Executor: The transaction executor invokes the scheduler to select a transaction for execution either for block production or block validation. The context is collected from the context manager and submitted along with the transaction to the transaction processor by the executor.

Transaction Families: Smart contracts are called transaction families in Hyperledger Sawtooth. The logic of the smart contracts is encoded into the transaction processor. Each smart contract has its own transaction processor and client. The transaction client checks the syntax of the transaction submitted and wraps them into a batch before submitting to the rest API.

Rest API: The clients interact with Sawtooth validator through Rest API module. Clients can submit transactions to the network or read the blocks added to the chain. Verifying the validity of the requests is the responsibility of the validator of the Sawtooth node while the Rest API acts as an intermediary.

                 

               Fig 2: Blockchain node architecture of Hyperledger Sawtooth

The basic flow of execution can be, in short, described as:

1. The client builds transactions and batches and signs them using the user’s private key.

2. The explicit dependencies within a batch are indicated through dependencies filed in the transaction header.

3. The transaction travels through a journal and is included in a block.

4. The parallel scheduler calculates implicit dependencies.

5. The batches are submitted to the validator via REST API.

6. The validator combines the batches into blocks through the block publisher

7. Block publisher gives the batches to the scheduler

8. The scheduler submits the transactions to the executor

9. The executor gives the transaction and the related context to the transaction processor

10. The transaction processor validates the transaction using the business logic given

11. Then the consensus protocol is implemented to see if the valid block should be added to the chain or not.

In Figure. 2, the blue path is the block production and the green path is the block validation process. 

3. References

1.       https://www.hyperledger.org/ 

2.       https://sawtooth.hyperledger.org/ 

3.       https://sawtooth.hyperledger.org/docs/1.2/ 

4. Autobiography

Piduguralla Manaswini is currently studying under the guidance of Dr. Sathya Peri in Indian Institute of Hyderabad (IITH) as a PhD student of computer science department. She is working on the National Blockchain Framework (NBF) on improving the efficiency of smart contracts execution in Hyperledger Sawtooth. Her research interests include blockchains, parallel transaction execution, consensus and federated learning. She is currently working on designing distributed architecture for Sawtooth node. 

MeitY Logo
CDAC Logo
SETS India Logo
idrbt Logo
iit-hydrabad Logo
iiit Logo
NIC Logo
digital-india
Azadi
G20 logo

CONTACT ADDRESS

C-DAC
C-DAC Innovation Park, Panchavati, Pashan, Pune - 411 008, Maharashtra (India)
Phone: +91-20-25503314/15
Email : bct[at]cdac[dot]in
TPL_BACKTOTOP