> ## Documentation Index
> Fetch the complete documentation index at: https://docs.believe.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Proof Schema Definition

> Guidance on defining JSON Schemas for your proof types used with the Flywheel API.

## Flywheel Proof Mechanism

The Believe Flywheel API uses a robust proof system to ensure transparency and auditability for all tokenomic actions. When you register a flywheel and execute pipeline actions, you provide proof data that gets recorded on-chain via memo instructions.

## Proof Types Configuration

During flywheel registration, you define the proof types your project will use. Each proof type includes:

* **Type**: A unique identifier (e.g., `"PRODUCT_BUY"`, `"WATCH_AD"`, `"ENGAGEMENT_REWARD"`)
* **Description**: Human-readable explanation of what this proof type represents

### Example Proof Types Definition

```json theme={null}
{
  "proofTypes": [
    {
      "type": "PRODUCT_BUY",
      "description": "Proof of product purchase on the platform"
    },
    {
      "type": "WATCH_AD",
      "description": "Proof of advertisement viewing completion"
    },
    {
      "type": "ENGAGEMENT_REWARD",
      "description": "Proof of user engagement activity"
    },
    {
      "type": "REFERRAL_BONUS",
      "description": "Proof of successful user referral"
    }
  ]
}
```

## Pipeline Proof Data

When creating flywheel pipelines, each pipeline includes:

* **Type**: Matches one of your registered proof types
* **Payload**: JSON string containing the specific proof data for this operation

### Example Pipeline with Proof

```json theme={null}
{
  "type": "WATCH_AD",
  "payload": "{\"adId\":\"123\",\"adProvider\":\"google\",\"platform\":\"ios\",\"userId\":\"user456\",\"completionTime\":\"2025-01-27T12:00:00Z\"}",
  "actions": [
    {
      "action": "BURN",
      "amount": 100
    },
    {
      "action": "AIRDROP",
      "toAddress": "9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM",
      "amount": 50
    }
  ]
}
```

## Automatic Proof Recording

The Flywheel API automatically:

1. **Generates Proof Hash**: Creates a SHA-256 hash of your proof data
2. **Creates Proof Memo**: Combines the hash with the original proof data
3. **Prepends to Pipeline**: Adds the proof memo as the first action in your pipeline
4. **Records On-Chain**: Ensures proof data is permanently recorded on Solana

### Generated Proof Structure

```json theme={null}
{
  "hash": "a1b2c3d4e5f6...",
  "proof": {
    "type": "WATCH_AD",
    "payload": "{\"adId\":\"123\",\"adProvider\":\"google\",...}"
  }
}
```

## Proof Data Best Practices

### Essential Fields

Include key information that proves the validity of your action:

* **Unique Identifiers**: Transaction IDs, user IDs, session IDs
* **Timestamps**: When the triggering event occurred
* **Amounts/Values**: Relevant monetary or engagement metrics
* **Context**: Platform, device, location if relevant

### Example Proof Schemas

#### Product Purchase

```json theme={null}
{
  "transactionId": "txn_abc123",
  "userId": "user_456",
  "productId": "prod_789",
  "amount": 99.99,
  "currency": "USD",
  "timestamp": "2025-01-27T12:00:00Z",
  "platform": "web"
}
```

#### Advertisement Viewing

```json theme={null}
{
  "adId": "ad_123456",
  "adProvider": "google",
  "userId": "user_789",
  "duration": 30,
  "completionRate": 100,
  "platform": "mobile",
  "timestamp": "2025-01-27T12:00:00Z"
}
```

#### User Engagement

```json theme={null}
{
  "userId": "user_abc",
  "actionType": "daily_check_in",
  "streakCount": 7,
  "pointsEarned": 100,
  "timestamp": "2025-01-27T12:00:00Z"
}
```

## Validation and Compliance

* **Immutable Records**: All proof data is permanently recorded on Solana blockchain
* **Audit Trail**: Complete history of all flywheel actions with supporting evidence
* **Transparency**: Public verification of tokenomic operations
* **Compliance**: Detailed records for regulatory requirements

## Integration with Flywheel Actions

Proof data flows through the entire flywheel process:

1. **Registration**: Define your proof types and schemas
2. **Pipeline Creation**: Include proof data with each pipeline
3. **Batch Processing**: Multiple pipelines with their proofs processed together
4. **On-Chain Recording**: All proof data permanently stored via memos
5. **Verification**: Community and auditors can verify all actions

For detailed implementation, see the [Flywheel API endpoints](/api-reference/endpoint/flywheel/batch-init).
