# How It Works

**Grid AI** operates as a decentralized network that connects compute resource providers with AI engineers, researchers, and developers in need of scalable, affordable computing power. The **Grid AI** ecosystem is built on the principles of decentralization, transparency, and efficiency, leveraging blockchain technology to ensure secure and reliable operations.

***

## **1. The Grid AI Network** <a href="#id-1.-the-meshchain-network" id="id-1.-the-meshchain-network"></a>

At the heart of **Grid AI** is its decentralized compute network. The network comprises several key components, each playing a critical role in the distribution and execution of AI workloads:

* **Grid AI Orchestrator**: This is the control center that manages and distributes AI workloads across the network. When an AI engineer submits a task, such as model training or inference, the Orchestrator breaks the task down into smaller workloads (called **workload shards**) and assigns them to available nodes in the network.
* **Worker Nodes**: These nodes are devices—such as personal computers, MeshNode hardware, or systems running the MeshNode Extension—that process the workload shards. Each Worker Node completes its assigned tasks and sends the **intermediate results** back to the network.
* **Validator Nodes**: After the Worker Nodes process the AI workloads, Validator Nodes receive the intermediate results for validation. They ensure that the computations were performed correctly, adding an additional layer of accuracy and security to the process.
* **Grid AI Aggregator**: Once the intermediate results are validated, the **Grid AI** Aggregator collects and compiles them into the final output. This final result is then delivered back to the AI engineer or user who submitted the original task.
* **Blockchain Layer**: **Grid AI**’s blockchain layer ensures that all transactions and computations are secure, transparent, and immutable. Every contribution made by a node is recorded on the blockchain, ensuring that resource providers are accurately rewarded for their participation.

***

## **2. Submitting AI Workloads** <a href="#id-2.-submitting-ai-workloads" id="id-2.-submitting-ai-workloads"></a>

When an AI engineer or organization needs to train or run inference on a model, they submit their workloads to the **Grid AI Orchestrator**. This process can be done through **Grid AI**’s CLI (Command Line Interface).

Here’s how the process works:

1. **Task Submission**: The AI engineer submits a task (e.g., training a machine learning model) to the **Grid AI** Orchestrator.
2. **Workload Sharding**: The Orchestrator breaks the AI workload into smaller, manageable pieces (workload shards).
3. **Workload Distribution**: These workload shards are distributed to various Worker Nodes in the network.
4. **Task Processing**: The Worker Nodes process their assigned shards and send the intermediate results to the Validator Nodes.
5. **Validation**: Validator Nodes verify the correctness of the results and forward them to the Aggregator.
6. **Final Output**: The Aggregator compiles the validated results and sends the final output back to the AI engineer.

***

## **3. Earning Rewards** <a href="#id-3.-earning-rewards" id="id-3.-earning-rewards"></a>

For resource providers, participating in the **Grid AI** network means contributing compute resources in exchange for **GRID tokens**. Here’s how it works:

1. **Resource Allocation**: Resource providers (using Browser Nodes, Software Nodes, or Dedicated Hardware Nodes) allocate their idle computing power to the network.
2. **Processing Workloads**: Their systems are then assigned AI workloads from the network and process these tasks.
3. **Receiving Rewards**: After successfully processing workloads and having their results validated, resource providers earn **GRID tokens** based on the amount of compute power contributed.

The blockchain layer ensures that each provider’s contribution is recorded accurately and that rewards are distributed fairly.

***

## **4. The Role of Blockchain in Grid AI** <a href="#id-4.-the-role-of-blockchain-in-meshchain" id="id-4.-the-role-of-blockchain-in-meshchain"></a>

Blockchain technology plays a central role in ensuring the security, transparency, and integrity of **Grid AI**’s operations. The network leverages blockchain for several key purposes:

* **Immutable Records**: Every contribution, transaction, and validation is recorded on the blockchain, creating an immutable ledger of activity.
* **Security and Trust**: Blockchain ensures that all computations and data transfers are securely encrypted, preventing tampering or unauthorized access.
* **Smart Contracts**: **Grid AI** uses smart contracts to automate reward distribution and ensure that participants are paid fairly based on their contributions.
* **Decentralization**: By utilizing blockchain, **Grid AI** eliminates the need for centralized control, ensuring that the network operates fairly and efficiently without relying on a single entity.

***

## **5. Scalability and Flexibility** <a href="#id-5.-scalability-and-flexibility" id="id-5.-scalability-and-flexibility"></a>

One of **Grid AI**’s greatest advantages is its **scalability**. Unlike traditional centralized cloud services, **Grid AI** can dynamically adjust the number of resources allocated to a task based on the demand. As more resource providers join the network, **Grid AI**’s computational power grows, allowing it to support even larger and more complex AI workloads.

This flexibility is what makes **Grid AI** an ideal solution for AI engineers, developers, and businesses of all sizes. Whether you need compute power for small experiments or large-scale production tasks, **Grid AI** can scale with your needs.

***

## **6. How to Join Grid AI as a Resource Provider or Consumer** <a href="#id-6.-how-to-join-meshchain-as-a-resource-provider-or-consumer" id="id-6.-how-to-join-meshchain-as-a-resource-provider-or-consumer"></a>

**Resource Providers**: If you have unused computing resources (whether it’s a personal computer, **Grid AI** hardware, or a browser extension), you can join the **Grid AI** network and start earning rewards by contributing your compute power. More information, read our guide to become resource provider.

**Resource Consumers**: If you’re an AI engineer or organization looking for scalable, affordable compute power, you can submit your AI workloads to the **Grid AI** network. Our global network of Worker Nodes will process your tasks and deliver results quickly and securely. More information, read our guide to become resource consumer.

To get started as a resource provider or consumer, simply visit our **Getting Started** page for more details.

***

**Grid AI** offers a revolutionary way to access compute power for AI tasks by utilizing decentralized resources. This system enables more affordable, scalable, and secure AI development for users worldwide.
