blockchain | 2018-05-09T07:00:00+05:30

Know Hyperledger Fabric? Then moving to Sawtooth is easy

Hellonext, Inc.

Varun Raj

I've been using both Hyperledger Fabric and Sawtooth for sometime now. While they're both great frameworks, they each have their own nicks and workarounds. In this article I aim to draw both the framework differences so that you can choose what suits you best.

Transaction Processor & Chaincode

One of the main advantages of Sawtooth is that the "smart contract" or transaction processors (as called in the Sawtooth world) can be written in wide verity of languages like Rust, Python or JavaScript. Migrating transaction processors to the chain is also different compared to Fabric.

Validators vs Endorsement Peers

The process of validating a transaction in Fabric involves a set of endorsing peers defined by the endorsement policy. After validation, the distribution of the transaction is handled by ordering services.

However in the Sawtooth architecture, there are validators which take care of validating the transactions in the network as well as distributing the transaction to other peers.

The State Store

Each framework handles maintaining the state of the blockchain network in its own way.

Hyperledger Fabric stores the data in either leveldb or couchdb based on the setup and manages a ledger per channel.

In the case of Sawtooth, all the data is stored in a specific address and this address is generated based on the corresponding transaction processor's prefix. For handling rich queries an instance of rethinkdb is setup and the ledger is replicated and synced with rethinkdb.

Component Topology

Hyperledger Fabric has a lot of components which function together to form a blockchain network. This includes Orderers, Peers, CAs, CouchDB and Tools.

But in the case of Sawtooth there is only three majors components which are Sawtooth Validator, Transaction Processors and the REST API for the Transaction Processors. This reduces the complexity of the network and brings more scalability.

Language Support

In order to write a Smart Contract on Hyperledger Fabric one has to rely on either GoLang or Javascript as no other languages are supported.

In Sawtooth, there is support for a wide variety of languages which helps organisations adopt it much more quickly. The support languages include Go, JavaScript, Python, Java and Rust. The most preferred language by the Sawtooth team is Rust since it provides native multi threading and comes with C level performance.

Last updated: September 7th, 2023 at 7:42:06 AM GMT+0

Hellonext Blogpost Author Profile

Varun Raj

Varun is one of the founders of Hellonext. He has helped companies like Google build large-scale developer communities to build strong developer relationships. He has build over 50 SaaS products in his career.