Skip to content

Latest commit

 

History

History
233 lines (163 loc) · 8.6 KB

File metadata and controls

233 lines (163 loc) · 8.6 KB

Mainframe

Your NFT is probably worthless right now.

We know. You know. The market knows.

Mainframe transforms NFTs into an autonomous AI agent.

Anchor Solana Security Security.txt License

Documentation

Getting Started

Technical Reference

Overview

Mainframe is a Solana Anchor program that manages agent accounts linked to NFTs from verified collections. The program handles NFT ownership validation, fee collection and distribution, and emits events for the Mainframe Nodes.

Core Capabilities:

  • Agent lifecycle management (create, update, transfer, pause, close)
  • PDA-based agent accounts with deterministic derivation
  • Tiered fee structure with collection-based discounts (Genesis: FREE, Partners: 25-75% off)
  • Automatic fee distribution across treasuries (Protocol, Validators, Network)
  • Affiliate revenue sharing system (15-50% tier-based commission + 5% referral bonuses)
  • Event emission for off-chain consumption (agent lifecycle, affiliate tracking, protocol changes)
  • Two-step authority transfer for security
  • Protocol-level pause mechanism

See Program Specifications for detailed instruction and account documentation.

Fee Structure

Operation Standard Genesis Partners
Create Agent 0.05 SOL FREE 25-75% off
Update Config 0.005 SOL FREE 25-75% off
Transfer Agent 0.01 SOL FREE 25-75% off
Pause/Resume/Close FREE FREE FREE

Distribution: Configurable via basis points (default: 50% Protocol • 30% Validators • 20% Network)

See Economics & Fees for complete fee calculation logic.

🎯 Affiliate Revenue Sharing System

Permissionless participation - anyone can earn by referring users!

✨ Key Features

  • Permissionless - No pre-registration required, just provide wallet address
  • Auto-Initialize - First commission automatically creates your affiliate account
  • Tier-Based Commission - Earn 15-50% based on lifetime sales performance
  • Referral Bonuses - Earn 5% of your referrals' commissions
  • Custom Bonuses - Protocol can set special rates for promotions
  • Instant Payouts - Commission paid on-chain in real-time

💰 Commission Tiers

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

Tier Benefits:

  • Tiers based on lifetime sales (never decrease)
  • Automatic tier progression as you sell
  • Custom bonus rates can be added by protocol authority

🔗 Referral System

Single-Level Referrals - Earn 5% of your direct referrals' commissions:

  • Register with a referrer to give them 5% of your earnings
  • Build a network and earn from your referrals' sales
  • Prevents referral chain saturation attacks

📊 Revenue Examples (Bronze → Diamond)

Monthly Sales Bronze (15%) Silver (20%) Gold (30%) Platinum (40%) Diamond (50%)
100 agents 0.75 SOL 1 SOL 1.5 SOL 2 SOL 2.5 SOL
500 agents 3.75 SOL 5 SOL 7.5 SOL 10 SOL 12.5 SOL
1,000 agents 7.5 SOL 10 SOL 15 SOL 20 SOL 25 SOL
5,000 agents 37.5 SOL 50 SOL 75 SOL 100 SOL 125 SOL

*Based on 0.05 SOL standard activation fee

🚀 Getting Started as an Affiliate

It's dead simple:

  1. Share your wallet address with users
  2. Users create agents with your address as the affiliate
  3. Get paid commission instantly based on your tier
  4. Your affiliate account auto-initializes on first sale
  5. Climb tiers automatically as you make more sales

Optional: Register explicitly with a referrer to earn from their network too

Ready to start earning? See Affiliate Documentation for complete details and SDK integration.

Quick Start

For SDK Integration

Use the official Mainframe SDK for simplified integration:

📦 Mainframe SDK - TypeScript SDK with built-in encryption, storage, and transaction management

For Direct Program Integration

Documentation:

Development

Prerequisites: Anchor 0.31.1 • Solana CLI 1.18.26+ • Node.js 18+ • Rust

# Clone and build
git clone https://github.com/maikershq/maikers-mainframe
cd maikers-mainframe
yarn install
anchor build
anchor test

Local Testing with Dependencies

All tests run locally with Metaplex Token Metadata automatically cloned from mainnet:

anchor test  # Automatically clones required programs

The Anchor.toml configuration automatically clones required programs for testing.

See System Architecture and Security Model for implementation details.

License

Apache License 2.0 - see LICENSE file for details.

Mainnet Deployment

🚀 Live on Solana Mainnet

  • Program ID: mnfm211AwTDA8fGvPezYs3jjxAXgoucHGuTMUbjFssE
  • Status: ✅ Production
  • Deployment Date: 2025-11-02
  • Version: v1.0.0

📋 Deployment Documentation:

🔍 Verification:

  • Transaction: View on Solscan
  • Source Commit: efdd0c639381df7648ef60e02c4febba381222b6
  • Build Platform: macOS ARM64 (native build)
  • Verification Method: Manual (solana-verify incompatible due to platform difference)

Security & Verified Builds

Security.txt

This program embeds security contact information directly in the binary using Solana's security.txt standard:

# Update source_revision to current commit
yarn update:revision

# Check security info in binary
yarn check:security

# Check deployed program
yarn check:security <PROGRAM_ID>

Security Contacts:

Note: The source_revision field in security.txt is automatically updated during CI/CD builds to match the git commit being deployed. For local builds, run yarn update:revision before building.

Verified Builds

Run reproducible builds with verification:

# Build with verification (auto-updates source_revision)
yarn build:verified

# Full verification pipeline
yarn verify

This generates:

  • ✅ Build verification JSON with binary hash
  • ✅ Git commit and timestamp
  • ✅ Security.txt validation with source_revision verification

Documentation:

Related Repositories


Built by maikers - creators of realities