Both Hyperledger Fabric and Hyperledger Sawtooth are platforms for building distributed ledger applications, supporting pluggable consensus mechanisms and smart contracts (chaincodes).
What are the main differences between then? When to choose one over the other to implement a blockchain solution?
Here are the important differences to consider when choosing between Hyperledger Fabric and Hyperledger Sawtooth:
Permissioned/Permissionless
Hyperledger Sawtooth supports both permissioned and permissionless blockchain networks. Sawtooth has a flexible approach using roles and permissions.
Hyperledger Fabric supports only permissioned blockchain networks. Fabric has a prescriptive/well-defined approach through pluggable membership service providers (MSPs) that enables a tighter governance framework.
Consensus algorithms
Sawtooth uses Proof of Elapsed Time (PoET) based on Intel's Software Guard Extensions (SGX) to elect leaders to cut blocks based on random wait times, a more energy efficient approach than the traditional Proof of Work, which enables scaling to very large networks.
Fabric supports pluggable consensus algorithms to order transactions into blocks, with Kafka support available since version v1.0, and Raft and BFT implementations in development.
Smart contract language
Hyperledger Sawtooth supports Go, JavaScript, Java, Python, Rust, and Ethereum Solidity based contracts.
Hyperledger Fabric supports Go, JavaScript, Java, and Ethereum Solidity based contracts.
Privacy
In Hyperledger Sawtooth, peers have access to all transaction data.
In Hyperledger Fabric, there are multiple levels of privacy. You can define ‘channels' for complete data isolation between a set of participants, where each channel is essentially its own private blockchain. Or you can use 'private data collections’ when participants need to transact on the same blockchain, but keep data private to a subset of transactors (and potentially regulators/auditors). Private data is shared peer-to-peer, with hashes stored on the blockchain as evidence so that all peers can validate transactions. Additionally, you can utilize Identity Mixer to preserve anonymity of transaction submitters.
Transaction flow
Hyperledger Sawtooth supports the traditional blockchain flow of Order-Execute-Commit.
Hyperledger Fabric supports a unique endorsement model where transactions are initially executed on a set of peers and follows a Execute-Order-Commit model. The set of required endorsers can be defined at the contract level or at the data level. This approach improves scalability, prevents nondeterminism in contract code, and enables transactions to be executed in private between a set of transactors as mentioned above.
Miscellaneous
Hyperledger Sawtooth supports transaction batches as a unit of work i.e. either all the transactions in a batch are committed or none of them is committed.
Hyperledger Sawtooth includes a (generic) REST API server
Hyperledger Fabric supports queries from smart contract chaincode, either using key range queries or JSON queries (when using CouchDB as a state database)