This tutorial shows how to use the Sawtooth JavaScript SDK to develop a simple application (also called a transaction family). A transaction family includes these components:

  • A transaction processor to define the business logic for your application. The transaction processor is responsible for registering with the validator, handling transaction payloads and associated metadata, and getting/setting state as needed.

  • A data model to record and store data.

  • A client to handle the client logic for your application. The client is responsible for creating and signing transactions, combining those transactions into batches, and submitting them to the validator. The client can post batches through the REST API or connect directly to the validator via ZeroMQ.

The client and transaction processor must use the same data model, serialization/encoding method, and addressing scheme.

In this tutorial, you will construct a transaction handler that implements XO, a distributed version of the two-player game tic-tac-toe.

This tutorial also describes how a client can use the JavaScript SDK to create transactions and submit them as Sawtooth batches.


This tutorial demonstrates the relevant concepts for a Sawtooth transaction processor and client, but does not create a complete implementation.

For a full JavaScript implementation of the XO transaction family, see https://github.com/hyperledger/sawtooth-sdk-javascript/tree/master/examples/xo.