Run W3bstream Locally

The W3bstream GitHub repository includes a developer-friendly setup to facilitate DePIN builders building W3bstream provers for their verifiable off-chain computing. The setup includes the following services:
  • A reference implementation for a DePIN data sequencer
  • A Postgres DB as the Data Availability service
  • A W3bstream coordinator and a prover as a single-node W3bstream configuration
Tech Stack for W3bstream Development

Download demo provers

Let’s start by first downloading some ready-made W3bstream project files that implement a basic “range prover” using different ZK technologies:
Let’s quickly describe the demo projects:

Risc0 “Range Prover”

Proves that a certain integer is in a certain range.→ Source code
  • private_input: string The value we want to prove is within the range, e.g. “7”
  • public_input: string Comma separated range endpoints, e.g. “3,9”

Halo2 “Proof of Multiplication”

Given two input aa and bb, compute the result 4∗a2∗b24*a^2*b^2 and provide the proof.→ Source code
  • private_a: integer The first value
  • private_b: integer The second value

zkWASM “Proof of Addition”

Given three input a,ba, b and cc, compute the result a+ba+b and provide the proof that a+b=ca+b=c → Source code Inputs:
  • private_input: integer[] The first value
  • public_input: integer[] The second value
With the demo projects in place, we can proceed by fetching the docker-compose.yaml file and running W3bstream locally:

Start the W3bstream Dev Setup

Test the setup

Now that we have a basic DePIN stack running, including a data sequencer, a data availability service, and a minimal W3bstream network, let’s test the setup by sending a data message targeting one of the three demo projects. In a new terminal, type the following command to send a data message to the sequencer targeting one of the example projects:
After some time, the log in the first terminal should look like similar to the one below: