# Core Concept

### Visual Overview

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

### Core Functionalities

#### **1. Recording Pixel Changes**

Pixels are represented on a 100x100 grid. Each pixel's state is tracked using `pixelChanged`, a nested mapping:

```
mapping(uint256 => mapping(uint256 => mapping(uint256 => address))) public pixelChanged;
```

**Workflow:**

* A pixel change emits the `PixelChanged` event, including details of the sender, coordinates, color, and grid ID.
* The total pixels colored are tracked per user using `totalPixels` and `totalPixelsId`.

**Events:**

* **`PixelChanged`**: Triggered when a pixel is colored or erased.
* **`AmountPixel`**: Logs the number of pixels a user has contributed.

#### **Event Declaration**

```solidity
PixelChanged(address indexed sender, uint256 x, uint256 y, uint256 color, uint256 id);
```

```solidity
AmountPixel(address indexed sender, uint256 PixelAmount);
```

#### **Purpose**

The purpose of the event is to record and broadcast changes to the pixel data in a way that is immutable and queryable on the blockchain.&#x20;

This allows anyone to reconstruct the grid's state purely by retrieving and processing these events.

The only potential point of failure is the underlying blockchain itself, making the ArtGridz canvas a direct and tangible visualization of the blockchain's core principles.


---

# 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://artgridz.gitbook.io/artgridz-documentation/onchain-art-storage/core-concept.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.
