# How Does Truebit Work?

### Truebit Workflow

**Truebit Verify provides a transparent environment to develop, deploy, and execute both Truebit Functions and Truebit API Tasks.** Truebit's platform generates proof of the correct execution of your code and allows you to integrate safely with different APIs, move data between blockchains, and implement complex application code.

**There are two execution types**:

* [**Function Tasks**](/developing-truebit-tasks/how-to-create-function-tasks.md) – execute predefined functions.
* [**API Tasks**](/developing-truebit-tasks/how-to-create-api-tasks.md) – interact with external APIs.

Both task types are invoked through a standard REST interface, allowing seamless integration into your applications or workflows, moving data across different chains.

#### Function Tasks

<figure><img src="/files/0UUpYrA8GkUsdiQEH2zx" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
This diagram represents the Function Task execution from a Task Requester point of view.
{% endhint %}

As a Task Developer, you create **Truebit Function Tasks** —**self-contained functions that run on** [**Truebit Verify Node**](/architecture/introduction/truebit-verify-nodes.md)**.** These tasks act like microservices and are exposed via a **REST API**.

For Function Tasks, [**Truebit Verify Hub**](/architecture/introduction/truebit-verify-hub.md) makes these tasks internet-accessible and orchestrates node operations. Under the hood, **Truebit leverages blockchain-based ledgers** to secure execution, ensure full transparency, and manage system-level financial mechanics.

**Within Function Tasks, each of them is executed by multiple nodes**, with [**Truebit Transcripts**](/overview/what-is-a-transcript.md) certifying outputs and providing an immutable audit trail of task and node behavior. **In case of discrepancies** in node responses, the **Adjudication Process is triggered** to resolve them by re-executing the task under the **Truebit Control Node**. This process determines which node provided an incorrect result, ensuring discrepancies are resolved and all nodes execute tasks honestly.

#### API Tasks

<figure><img src="/files/P9Ca6KiTSdOCSz56zrBP" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
This diagram represents the API Task execution from a Task Requester point of view.
{% endhint %}

As a Task Developer, you create **Truebit API Tasks**. These tasks function like microservices and are accessible via a **REST API**.

**The** [**TEE**](/developing-truebit-tasks/how-to-create-api-tasks.md#trusted-execution-for-api-tasks) **(Trusted Executed Environment) executes API Tasks by directly calling an API endpoint.** **This keeps API credentials and data private. Truebit Verify Nodes use a shared session key to verify communication between the Hub and API endpoints.**

Transparency is also crucial when moving data across different blockchains. As blockchains don't naturally communicate, interoperability becomes complex in Web3. We simplify this by transparently coding interactions between blockchains, ensuring the validity of read and write operations. This certification makes the operation secure, resolving challenges in moving data between different blockchains.


---

# 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://devs.truebit.io/overview/how-does-truebit-work.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.
