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

# maikers'mainframe

> Permissionless Solana protocol for creating AI agents from verified NFTs

## The Agent Protocol

**maikers'mainframe** is a **permissionless Solana protocol** built with Anchor that transforms verified NFTs into autonomous AI agents. It's the on-chain infrastructure where verified human identity meets autonomous AI execution.

<CardGroup cols={2}>
  <Card title="Permissionless" icon="unlock">
    Any verified NFT collection can participate—no approval required
  </Card>

  <Card title="FrameClaw Powered" icon="brain">
    200+ plugins for DeFi, social, content, and automation
  </Card>

  <Card title="NFT-Anchored" icon="link">
    Agents cryptographically linked to verified Solana NFTs
  </Card>

  <Card title="Revenue Sharing" icon="money-bill">
    15-50% affiliate commissions built into the protocol
  </Card>
</CardGroup>

## Protocol Status

| Property       | Value                                         |
| -------------- | --------------------------------------------- |
| **Program ID** | `mnfm211AwTDA8fGvPezYs3jjxAXgoucHGuTMUbjFssE` |
| **Network**    | Solana Mainnet-Beta                           |
| **Version**    | v1.0.0                                        |
| **Audit**      | In Progress                                   |

***

## Architecture Overview

```mermaid theme={null}
graph TB
    subgraph "User Layer"
        User[👤 Human Owner]
        NFT[🖼️ Verified NFT]
    end

    subgraph "Identity Layer"
        ID[🆔 maikers'ID]
        SAS[🛡️ SAS Verification]
    end

    subgraph "Protocol Layer (On-Chain)"
        Program[🔗 Mainframe Program]
        AgentPDA[📄 Agent Account PDA]
        Events[📡 Program Events]
    end

    subgraph "Execution Layer (Off-Chain)"
        Cloud[☁️ maikers'cloud]
        Runtime[🤖 FrameClaw Runtime]
        Console[🖥️ Management Console]
    end

    User --> ID
    ID --> SAS
    User --> NFT
    NFT --> Program
    ID --> Program
    Program --> AgentPDA
    Program --> Events
    Events --> Cloud
    Cloud --> Runtime
    Runtime --> Console
    User --> Console

    style Program fill:#e74c3c,stroke:#c0392b,stroke-width:2px,color:#fff
    style Cloud fill:#3498db,stroke:#2980b9,stroke-width:2px,color:#fff
    style ID fill:#9b59b6,stroke:#8e44ad,stroke-width:2px,color:#fff
```

### Layer Responsibilities

| Layer         | Responsibility                                          |
| ------------- | ------------------------------------------------------- |
| **Identity**  | Verifies human ownership via maikers'ID + SAS           |
| **Protocol**  | Stores agent metadata, emits events, enforces ownership |
| **Execution** | Runs agent logic via FrameClaw on maikers'cloud         |

***

## 7-Step Activation Flow

<Steps>
  <Step title="Verify Identity">
    User completes SAS verification and mints maikers'ID (one-time)
  </Step>

  <Step title="Select NFT">
    Choose any NFT from a verified collection (`Collection.verified = true`)
  </Step>

  <Step title="Configure Agent">
    Define capabilities using FrameClaw plugins and skill configuration
  </Step>

  <Step title="Submit Transaction">
    Call `create_agent` instruction with NFT mint and configuration
  </Step>

  <Step title="Pay Activation Fee">
    Protocol collects 0.05 SOL fee and creates Agent Account PDA
  </Step>

  <Step title="Event Emitted">
    `AgentCreated` event broadcast with agent metadata
  </Step>

  <Step title="Cloud Instantiation">
    maikers'cloud monitors events and spins up FrameClaw instance
  </Step>
</Steps>

***

## On-Chain Data Model

### Agent Account PDA

```rust theme={null}
#[account]
pub struct AgentAccount {
    pub owner: Pubkey,           // maikers'ID holder
    pub nft_mint: Pubkey,        // Source NFT mint address
    pub agent_mint: Pubkey,      // Minted Agent-NFT
    pub config_uri: String,      // Arweave URI to encrypted config
    pub status: AgentStatus,     // Active, Paused, Closed
    pub created_at: i64,         // Unix timestamp
    pub updated_at: i64,         // Last modification
    pub bump: u8,                // PDA bump seed
}

#[derive(AnchorSerialize, AnchorDeserialize, Clone, PartialEq)]
pub enum AgentStatus {
    Active,
    Paused,
    Closed,
}
```

### PDA Derivation

```rust theme={null}
// Agent Account PDA
seeds = [b"agent", nft_mint.as_ref()]

// Config Account PDA
seeds = [b"config", agent_account.as_ref()]
```

***

## Protocol Instructions

### create\_agent

Creates a new agent from a verified NFT.

```typescript theme={null}
await program.methods
  .createAgent({
    configUri: "ar://...", // Encrypted config on Arweave
    name: "My Agent",
    framework: "FrameClaw",
  })
  .accounts({
    owner: wallet.publicKey,
    nftMint: nftMintAddress,
    nftTokenAccount: nftAta,
    maikersId: maikersIdMint,
    // ... other accounts
  })
  .rpc();
```

### update\_config

Modifies agent configuration (owner only).

```typescript theme={null}
await program.methods
  .updateConfig({ configUri: "ar://new-config..." })
  .accounts({ agentAccount, owner: wallet.publicKey })
  .rpc();
```

### pause\_agent / resume\_agent

Emergency controls for agent operation.

### close\_agent

Permanently deactivates agent and closes accounts.

***

## Fee Structure

| Operation          | Fee       | Description                          |
| ------------------ | --------- | ------------------------------------ |
| **Create Agent**   | 0.05 SOL  | One-time activation, mints Agent-NFT |
| **Update Config**  | 0.005 SOL | Modify parameters or settings        |
| **Transfer Agent** | 0.01 SOL  | On NFT ownership change              |
| **Pause/Close**    | FREE      | Emergency controls                   |

### Fee Distribution

```mermaid theme={null}
pie title Fee Distribution
    "Protocol Treasury" : 50
    "Validators" : 30
    "Network Operations" : 20
```

### Special Pricing

| Collection Type          | Discount               |
| ------------------------ | ---------------------- |
| **maikers'collectibles** | 100% (free activation) |
| **Partner Collections**  | 50-75% off             |

***

## Affiliate System

Anyone can earn by referring agent activations—no registration required.

| Tier         | Activations | Commission |
| ------------ | ----------- | ---------- |
| 🥉 Bronze    | 0-99        | 15%        |
| 🥈 Silver    | 100-499     | 20%        |
| 🥇 Gold      | 500-1,999   | 30%        |
| 💎 Platinum  | 2,000-9,999 | 40%        |
| 💎💎 Diamond | 10,000+     | 50%        |

<Note>
  **Referral Bonus**: Earn an additional 5% on commissions generated by
  affiliates you refer.
</Note>

```typescript theme={null}
// Include affiliate in agent creation
await sdk.createAgent(nftMint, config, {
  affiliate: "AFFILIATE_WALLET",
  referrer: "REFERRER_WALLET", // Optional
});
```

***

## Event System

The protocol emits events for off-chain systems to monitor.

### AgentCreated

```rust theme={null}
#[event]
pub struct AgentCreated {
    pub agent_account: Pubkey,
    pub owner: Pubkey,
    pub nft_mint: Pubkey,
    pub agent_mint: Pubkey,
    pub config_uri: String,
    pub timestamp: i64,
}
```

### ConfigUpdated

```rust theme={null}
#[event]
pub struct ConfigUpdated {
    pub agent_account: Pubkey,
    pub old_config_uri: String,
    pub new_config_uri: String,
    pub timestamp: i64,
}
```

### AgentStatusChanged

```rust theme={null}
#[event]
pub struct AgentStatusChanged {
    pub agent_account: Pubkey,
    pub old_status: AgentStatus,
    pub new_status: AgentStatus,
    pub timestamp: i64,
}
```

***

## Security Model

### Ownership Verification

```mermaid theme={null}
graph LR
    TX[Transaction] --> Signer[Signer Check]
    Signer --> IDCheck[maikers'ID Ownership]
    IDCheck --> NFTCheck[NFT Ownership]
    NFTCheck --> CollectionCheck[Collection.verified]
    CollectionCheck --> Execute[Execute Instruction]
```

### Permission Levels

| Action        | Required                   |
| ------------- | -------------------------- |
| Create Agent  | maikers'ID + NFT ownership |
| Update Config | Agent owner signature      |
| Pause/Resume  | Agent owner signature      |
| Close Agent   | Agent owner signature      |

### Security Features

* **Wallet Isolation** — Each agent has dedicated wallet, separate from owner
* **Spending Limits** — Configurable daily and per-transaction caps
* **Emergency Stop** — Instant pause via protocol instruction
* **Encrypted Config** — Agent secrets encrypted client-side before storage

***

## Integration Patterns

### SDK Usage

```typescript theme={null}
import { createMainnetSDK } from "@maikers/mainframe-sdk";

const sdk = createMainnetSDK();
await sdk.initialize("Phantom");

// Create agent
const result = await sdk.createAgent(nftMint, {
  name: "DeFi Agent",
  framework: "FrameClaw",
  capabilities: [{ type: "defi", plugins: ["jupiter-swap", "raydium-lp"] }],
});

// Manage agent
await sdk.pauseAgent(agentAccount);
await sdk.updateConfig(agentAccount, newConfig);
await sdk.closeAgent(agentAccount);
```

### Direct Program Interaction

For advanced use cases, interact directly with the Anchor program:

```typescript theme={null}
import { Program } from "@coral-xyz/anchor";
import { Mainframe } from "./idl/mainframe";

const program = new Program<Mainframe>(idl, programId, provider);
await program.methods.createAgent(params).accounts(accounts).rpc();
```

***

## Resources

<CardGroup cols={2}>
  <Card title="SDK Documentation" icon="code" href="/sdk/overview">
    Build with the Mainframe SDK
  </Card>

  <Card title="GitHub" icon="github" href="https://github.com/maikershq/maikers-mainframe">
    View protocol source code
  </Card>

  <Card title="Agent Skills" icon="puzzle-piece" href="/core/skills">
    Configure agent capabilities
  </Card>

  <Card title="AI Agents" icon="robot" href="/core/ai-agents">
    Agent management guide
  </Card>
</CardGroup>
