non-fungible-agents-BAP-578 README

README проекта с github.com/ChatAndBuild/non-fungible-agents-BAP-578. Одним файлом markdown: README.md.

BAP578 - Non-Fungible Agents (NFA)

Non-Fungible Agents

Overview

BAP-578 introduces Non-Fungible Agents (NFAs)—programmable, autonomous tokens that act as on-chain "agents" capable of executing tasks, evolving, and interacting with other contracts. This standard merges the uniqueness of NFTs with autonomous functionality, positioning BNB Chain as the home for decentralized automation.

This implementation provides a complete framework for creating, managing, and governing autonomous agent tokens on the BNB Chain with optional learning capabilities that allow agents to evolve and improve over time.

For a comprehensive technical breakdown, read the Whitepaper

🚀 Enhanced Learning Capabilities

BAP-578 now offers two development paths to accommodate different use cases and developer preferences:

Path 1: JSON Light Experience (Default)

Perfect for most developers and immediate deployment:

Path 2: Merkle Tree Learning (Optional)

For advanced developers wanting truly evolving agents:

Key Benefits

Why a Token Standard?

The Need for Standardization

While traditional NFTs (BEP-721) provide uniqueness and ownership, they lack the standardized interfaces needed for autonomous behavior and cross-platform agent interactions. BAP-578 addresses this gap by defining:

  1. Consistent Agent Interfaces: Standardized methods for action execution, state management, and logic upgrades that enable predictable interactions across platforms.

  2. Interoperability Framework: Common patterns for how agents interact with other contracts, services, and each other, creating an ecosystem where agents from different developers can work together.

  3. Hybrid On-Chain/Off-Chain Architecture: Clear separation between on-chain identity and permissions versus off-chain extended experience and complex behaviors, optimizing for both gas efficiency and rich functionality.

  4. Optional Learning System: Standardized interfaces for agent learning and evolution, allowing developers to choose between simple static agents or sophisticated learning agents.

  5. Security Boundaries: Standardized circuit breaker patterns, permission systems, and access controls that protect users and their assets.

On-Chain vs. Off-Chain Components

BAP-578 carefully balances which components belong on-chain versus off-chain:

Component Storage Rationale
Agent Identity On-chain Core identity must be immutable and universally accessible
Ownership & Permissions On-chain Security and access control require consensus verification
Basic Metadata On-chain Essential for marketplace display and basic interactions
Logic Address On-chain Determines how the agent behaves when actions are executed
Learning Tree Root On-chain Cryptographic proof of learning state (32 bytes only)
Extended Experience Off-chain (with hash verification) Rich experience would be prohibitively expensive on-chain
Learning Tree Data Off-chain (with Merkle verification) Detailed learning data with cryptographic integrity
Complex Behaviors Off-chain Advanced AI behaviors require off-chain computation
Voice/Animation Off-chain (with URI reference) Media assets are too large for on-chain storage

This hybrid approach ensures that:

Ecosystem Benefits

Standardization through BAP-578 enables:

  1. Developer Ecosystem: Common interfaces allow developers to build agent-compatible applications without custom integration for each agent implementation.

  2. Marketplace Integration: Platforms can display, trade, and interact with agents using standardized methods, regardless of the agent's specific purpose or learning capabilities.

  3. Cross-Platform Compatibility: Agents can move between applications while maintaining their identity, experience, and learned behaviors.

  4. User Ownership: Clear separation of on-chain and off-chain components ensures users maintain control of their agents' data and behavior.

  5. Innovation Acceleration: Developers can focus on creating unique agent behaviors rather than reinventing infrastructure patterns.

  6. Learning Portability: Agents with learning enabled can carry their knowledge and experience across different platforms and applications.

Key Features

Token Structure

Architecture

The BAP-578 standard consists of the following components:

Core Contracts

Learning System

Interfaces and Examples

Agent Templates

Extended Metadata

BAP-578 tokens include an enhanced metadata structure with:

Basic Metadata

Learning Enhancements

Use Cases

Traditional Agents (JSON Light Experience)

Learning Agents (Merkle Tree Learning)

Quick Start

Installation

npm install

Compile Contracts

npm run compile

Run Tests

npm test

Deploy

# Local development
npm run deploy

# BSC Testnet
npm run deploy:testnet

# BSC Mainnet  
npm run deploy:mainnet

Interact with Contract

# Interactive CLI
npm run interact:testnet

Verify on BSCScan

# Automatic verification
npm run verify:testnet

# Manual verification guide
npm run verify:manual:testnet

BAP-578 Dev Kit (SkillsHub)

To streamline adapter design, vault safety checks, deployment sequencing, and test scaffolding, this repository includes a SkillsHub-based Dev Kit guide.

Install commands:

npx @skillshub/bap578-adapter-blueprint
npx @skillshub/bap578-vault-checklist
npx @skillshub/bap578-deploy-plan
npx @skillshub/bap578-test-template
npx @skillshub/bap578-contract-idea-sprint

Optional local skeletons included:

Contract Structure

AgentMetadata

struct AgentMetadata {
    string persona;       // JSON traits/style
    string experience;    // Agent's role/expertise
    string voiceHash;     // Voice identifier
    string animationURI;  // Animation resource
    string vaultURI;      // Vault resource
    bytes32 vaultHash;    // Vault identifier
}

Key Functions

Environment Setup

Create a .env file:

DEPLOYER_PRIVATE_KEY=your_private_key_here
TESTNET_RPC_URL=https://data-seed-prebsc-1-s1.binance.org:8545/
MAINNET_RPC_URL=https://bsc-dataseed.binance.org/
BSCSCAN_API_KEY=your_bscscan_api_key_here

Network Configuration

Available Scripts

Command Description
npm test Run test suite
npm run compile Compile contracts
npm run deploy Deploy to local network
npm run deploy:testnet Deploy to BSC testnet
npm run deploy:mainnet Deploy to BSC mainnet
npm run interact Interactive CLI
npm run verify:testnet Verify on testnet BSCScan
npm run clean Clean artifacts
npm run coverage Generate test coverage

License

MIT

non-fungible-agents-BAP-578 (ChatAndBuild/non-fungible-agents-BAP-578)

Ищем в базе…

Что это такое?BAP-578 — это стандарт токенов Non-Fungible Agent (NFA) для BNB Chain: программируемые автономные токены, которые работают как агенты в блокчейне, умеют выполнять задачи, хранить состояние и при желании учиться и развиваться со временем.
Это просто стандарт токенов или полноценная среда разработки?И то, и другое: это стандарт токенов, который расширяет BEP-721 функциями для агентов, а также полноценный фреймворк для смарт-контрактов с фабрикой, системой управления, казной, модулем обучения и готовыми шаблонами агентов.
Как начать создавать и развертывать агента?Раздел Quick Start описывает установку зависимостей, компиляцию контрактов, запуск тестов, развертывание в BNB Chain и проверку развернутого контракта в BSCScan. Также включен SkillsHub Dev Kit с документацией и руководством по знакомству на 15 минут для проектирования адаптеров и создания каркаса тестов.
Что нужно для работы с агентами BAP-578?Нужен BNB в BNB Chain, чтобы развернуть и пополнить агентов, поскольку минтинг стоит 0,01 BNB после первых трех бесплатных агентов, а также инструментарий в стиле Solidity/Hardhat для компиляции, тестирования и развертывания смарт-контрактов.
Все ли агенты по умолчанию имеют возможности обучения?Нет, обучение включается по желанию. По умолчанию агенты используют простой путь JSON Light Experience, а путь Merkle Tree Learning, который позволяет агентам по-настоящему развиваться, является необязательным и более продвинутым вариантом.
Для кого предназначен этот стандарт?Он рассчитан на разработчиков смарт-контрактов BNB Chain, которые создают автономных агентов в блокчейне для таких сценариев, как менеджеры DeFi-портфелей, участники DAO, игровые NPC и ИИ-помощники для брендов или личного использования.
Какие готовые шаблоны агентов входят в состав?В репозитории есть StrategicAgent, DeFiAgent, GameAgent, DAOAgent, CreatorAgent, DAOAmbassadorAgent, LifestyleAgent, FanCollectibleAgent и шаблон MockAgentLogic для тестирования базового взаимодействия с агентами.
Как Merkle Tree Learning снижает затраты на газ?В блокчейне хранится только 32-байтовый корень Меркла дерева обучения агента, а подробные данные обучения хранятся вне сети с криптографической проверкой по этому корню.
Зачем предлагать новый стандарт, а не просто использовать NFT по BEP-721?Обычные NFT по BEP-721 обеспечивают уникальность и владение, но не имеют стандартизированных интерфейсов для автономного поведения, межплатформенной совместимости агентов и необязательного обучения в блокчейне, которые BAP-578 добавляет поверх них.
Какие механизмы безопасности есть в стандарте?В стандарт входят контракт CircuitBreaker для общих или точечных экстренных остановок, VaultPermissionManager для делегирования доступа к внешним данным на ограниченное время и отдельный контракт управления для изменений на уровне протокола.
Какие есть похожие проекты?stellar-trade, linten, metamask-extension, pons-copy-trading-bot, gun, hashsigs-rs, WTF-Solidity, ethereumbook
Автор
ChatAndBuild
Размер
3.5 MB
Звёзды
423
Обновлён
КоммитMay 22
Возраст
1 г
Коммиты · 90 дней