# W3bstream Outputs

A W3bstream proof can be directed to various destinations, referred to as "Outputs." Each configuration in the W3bstream project file must have an output specified. Below is an example configuration structure:

```json
{
  "defaultVersion": "0.1",
  "versions": [
    {
      "vmType": "halo2",
      "output": {
        "type": "..."
      },
      "version": "0.2",
      "code": "789cecb3bc5acda85509c609e9..."
    },
    {
      "vmType": "risc0",
      "output": {
        "type": "..."
      },
      "version": "0.1",
      "code": "789cecb3bc5acda85509c609e9..."
    }
  ]
}
```

Each output type has its own settings and parameters. Below are the supported output types and their respective configurations:

## Standard Output

**`stdout`** is the default output for a configuration and is ideal during the development phase. It allows developers to retrieve the proof from the W3bstream node log for local verification without writing it to an actual destination. This simplifies debugging and testing:

```json
"output": {
  "type": "stdout"
}
```

#### Explanation of Settings

* **type**: Specifies the output type. For standard output, this should be set to `stdout`.

By using the `stdout` output type, you can focus on ensuring that your proofs are generated correctly and efficiently before moving on to more complex output configurations.

## Ethereum Contract

When you need the W3bstream proof to be written to your Dapp contract (e.g., to trigger your DePIN token economy), you should use the **`ethereumContract`** output type. This output currently supports the IoTeX blockchain and requires some additional settings:

```json
"output": {
  "type": "ethereumContract",
  "ethereum": {
    "chainEndpoint": "https://babel-api.testnet.iotex.io",
    "contractAddress": "0xDea7f9b692cb90a2DF1860189BcAc428500c44f1",
    "receiverContract": "0x22D5B41b28E7f9739a3D0C984737174cC7e554dF",
    "contractMethod": "submitProof",
    "contractAbiJSON": "[{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"seal\",\"type\":\"bytes\"},{\"internalType\":\"bytes32\",\"name\":\"imageId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"postStateDigest\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"journal\",\"type\":\"bytes\"}],\"name\":\"submitProof\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]"
  }
}
```

#### Explanation of Settings

* **type**: Specifies the output type. For Ethereum contracts, this should be set to `ethereumContract`.
* **chainEndpoint**: The endpoint of the IoTeX blockchain where your Dapp operates.
* **contractAddress**: The address of the W3bstream router contract on the IoTeX blockchain.
* **receiverContract**: The address of your DePIN Dapp contract that is supposed to receive the W3bstream proofs.
* **contractMethod**: The method in the receiver contract that will handle the proof.
* **contractAbiJSON**: The ABI of the method in the receiver contract that will handle the proof.

By configuring the output as shown, you ensure that the proofs generated by W3bstream are correctly sent to your Dapp contract on the IoTeX blockchain, enabling your DePIN token economy to function as intended.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.iotex.io/depin/iotex-depin-modules/w3bstream/build-with-w3bstream/deploy-to-w3bstream/w3bstream-outputs.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
