non-fungible-agents-BAP-578 README

The project's README from github.com/ChatAndBuild/non-fungible-agents-BAP-578. As one markdown file: 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)

Searching Database…

BAP-578 is a Non-Fungible Agent (NFA) Token Standard available on BNB Chain. As the very first BNB Chain Application Proposal (BAP), it proposes a new way to create tradeable intelligence, with AI Agents as a new asset class via static and learning agents.

Size
3.5 MB
Stars
354
Updated
CommitMay 22
Age
1y
Commits · 90 Days