Phase 10: Ecosystem & Marketplace
This phase builds the economic layer of the AgenC protocol, enabling agents to offer services to humans, charge for premium skills, participate in a reputation
Phase 10: Ecosystem & Marketplace
Overview
This phase builds the economic layer of the AgenC protocol, enabling agents to offer services to humans, charge for premium skills, participate in a reputation economy, bridge to other agent frameworks, and participate in on-chain governance. This creates a sustainable ecosystem where agent operators and skill developers can monetize their work.
Dependencies
TaskBidMarketplace - Required for bidding patternsIssue Dependency Graph
Implementation Order
- 1109 - Service marketplace first - enables human-agent economic interaction
- 1107 - Skill monetization next - creates revenue streams for developers
- 1110 - Reputation economy - adds staking and delegation
- 1108 - Cross-protocol bridges - expands ecosystem reach
- 1106 - Governance last - requires mature economic foundation
Issue Details
10.1: Service Marketplace (#1109)
- runtime/src/marketplace/service-marketplace.ts
- runtime/src/marketplace/service-types.ts
- runtime/src/marketplace/service-marketplace.test.ts
- programs/agenc-coordination/src/instructions/create_service_request.rs
- programs/agenc-coordination/src/instructions/bid_on_service.rs
- programs/agenc-coordination/src/instructions/accept_service_bid.rs
- programs/agenc-coordination/src/state/service.rs
- tests/service-marketplace.ts
- programs/agenc-coordination/src/instructions/mod.rs (add service instructions)
- programs/agenc-coordination/src/lib.rs (export instructions)
- programs/agenc-coordination/src/state.rs (export service accounts)
- programs/agenc-coordination/src/events.rs (add service events)
- runtime/src/marketplace/marketplace.ts (extend for services)
- runtime/src/marketplace/matching.ts (add service matching)
- Extends existing TaskBidMarketplace with human-facing requests
- PDA seeds: ["service", requester, nonce] for ServiceRequest
- PDA seeds: ["service_bid", service_pda, bidder] for ServiceBid
- Uses same bidding mechanics as task marketplace
- Payment escrow follows task completion pattern
- Follow runtime/src/marketplace/marketplace.ts marketplace pattern
- Use runtime/src/marketplace/matching.ts bid scoring pattern
- Follow programs/agenc-coordination/src/instructions/create_task.rs escrow pattern
interface ServiceMarketplace {
createRequest(request: ServiceRequest): Promisestring>;
bidOnService(serviceId: string, bid: ServiceBid): Promisestring>;
acceptBid(serviceId: string, bidId: string): Promisevoid>;
completeService(serviceId: string, proof?: Uint8Array): Promisevoid>;
}
interface ServiceRequest {
title: string;
description: string;
requiredCapabilities: bigint;
budget: bigint;
budgetMint?: PublicKey;
deadline?: number;
deliverables: string[];
}
interface ServiceBid {
price: bigint;
deliveryTime: number;
proposal: string;
portfolioLinks?: string[];
}- Test service request creation (escrow funding)
- Test agent bidding (multiple bids per service)
- Test bid acceptance (escrow lock)
- Test service completion (payment release)
- Test dispute flow (same as task disputes)
- Use LiteSVM pattern
10.2: Skill Monetization (#1107)
- runtime/src/skills/monetization.ts
- runtime/src/skills/monetization-types.ts
- runtime/src/skills/monetization.test.ts
- programs/agenc-coordination/src/instructions/subscribe_skill.rs
- programs/agenc-coordination/src/instructions/unsubscribe_skill.rs
- programs/agenc-coordination/src/state/subscription.rs
- tests/skill-subscription.ts
- programs/agenc-coordination/src/instructions/mod.rs (add subscription instructions)
- programs/agenc-coordination/src/lib.rs (export instructions)
- programs/agenc-coordination/src/state.rs (export subscription accounts)
- programs/agenc-coordination/src/state/skill.rs (add subscription fields)
- runtime/src/skills/registry/client.ts (add subscription API)
- PDA seeds: ["subscription", skill_pda, subscriber] for SkillSubscription
- Time-locked access: subscription expiry checked on skill execution
- Revenue split: 80% developer, 20% protocol
- Automatic renewal via time-based token lock
- Free tier: basic skills remain free
- Follow runtime/src/team/payouts.ts revenue sharing pattern
- Use programs/agenc-coordination/src/instructions/token_helpers.rs for token transfers
- Follow time-based access pattern from task deadlines
interface SkillMonetization {
subscribe(skillId: string, duration: number, paymentMint?: PublicKey): Promisestring>;
unsubscribe(skillId: string): Promisevoid>;
checkAccess(skillId: string): Promiseboolean>;
claimRevenue(skillId: string): Promisevoid>;
}
interface SubscriptionModel {
pricePerMonth: bigint;
pricePerYear?: bigint;
paymentMint?: PublicKey;
freeTier: boolean;
trialDays?: number;
}- Test subscription creation (payment + time lock)
- Test access checks (expired vs active)
- Test revenue claiming (80/20 split)
- Test auto-renewal (time-based)
- Test free tier (no payment required)
- Mock SPL token operations
10.3: Agent Reputation Economy (#1110)
- runtime/src/reputation/economy.ts
- runtime/src/reputation/economy-types.ts
- runtime/src/reputation/economy.test.ts
- programs/agenc-coordination/src/instructions/stake_reputation.rs
- programs/agenc-coordination/src/instructions/delegate_reputation.rs
- programs/agenc-coordination/src/instructions/withdraw_reputation.rs
- programs/agenc-coordination/src/state/reputation.rs
- tests/reputation-economy.ts
- programs/agenc-coordination/src/instructions/mod.rs (add reputation instructions)
- programs/agenc-coordination/src/lib.rs (export instructions)
- programs/agenc-coordination/src/state.rs (export reputation accounts)
- programs/agenc-coordination/src/state.rs (add reputation_staked field to AgentRegistration)
- runtime/src/agent/capabilities.ts (integrate reputation staking)
- PDA seeds: ["reputation_stake", agent_pda] for ReputationStake
- PDA seeds: ["reputation_delegation", delegator, delegatee] for ReputationDelegation
- Staking increases agent visibility in discovery
- Slashing reduces staked reputation on disputes
- Delegation allows agents to "lend" reputation to trusted peers
- Portable reputation: on-chain score follows agent across platforms
- Follow existing reputation system from programs/agenc-coordination/src/instructions/complete_task.rs
- Use staking pattern similar to agent registration stake
- Follow delegation pattern from team payouts
interface ReputationEconomy {
stake(amount: bigint): Promisevoid>;
delegate(delegatee: Uint8Array, amount: number): Promisevoid>;
withdraw(amount: bigint): Promisevoid>;
getStake(): PromiseReputationStake>;
getDelegations(): PromiseReputationDelegation[]>;
}
interface ReputationStake {
agent: Uint8Array;
stakedAmount: bigint;
reputationScore: number;
slashCount: number;
lockedUntil?: number;
}
interface ReputationDelegation {
delegator: Uint8Array;
delegatee: Uint8Array;
amount: number;
expiresAt?: number;
}- Test reputation staking (increases visibility)
- Test delegation (temporary reputation transfer)
- Test slashing (reduces stake + score)
- Test withdrawal (cooldown period)
- Test portable reputation (cross-platform)
- Use LiteSVM pattern
10.4: Cross-Protocol Bridges (#1108)
- runtime/src/bridges/openclaw.ts
- runtime/src/bridges/langchain.ts
- runtime/src/bridges/crewai.ts
- runtime/src/bridges/farcaster.ts
- runtime/src/bridges/types.ts
- runtime/src/bridges/index.ts
- runtime/src/bridges/openclaw.test.ts
- runtime/src/bridges/langchain.test.ts
- runtime/src/bridges/crewai.test.ts
- runtime/src/bridges/farcaster.test.ts
- runtime/src/index.ts (export bridges)
- runtime/src/skills/markdown/compat.ts (add bridge compat layers)
- runtime/src/tools/registry.ts (expose tools to bridges)
- OpenClaw: expose AgenC skills as OpenClaw tools
- LangChain: wrap AgenC tools as LangChain tools
- CrewAI: expose AgenC agents as CrewAI agents
- Farcaster: enable Farcaster Frames to invoke AgenC agents
- Bridges use existing tool registry and skill system
- Follow runtime/src/skills/openclaw/bridge.ts OpenClaw pattern
- Use runtime/src/tools/registry.ts tool exposure pattern
- Follow runtime/src/skills/markdown/compat.ts namespace mapping
interface ProtocolBridge {
expose(): void;
mapTool(tool: Tool): unknown;
mapSkill(skill: Skill): unknown;
}
interface OpenClawBridge extends ProtocolBridge {
mapTool(tool: Tool): OpenClawTool;
mapSkill(skill: Skill): OpenClawSkill;
}
interface LangChainAdapter extends ProtocolBridge {
mapTool(tool: Tool): LangChainTool;
}
interface CrewAIAdapter extends ProtocolBridge {
mapAgent(runtime: AgentRuntime): CrewAIAgent;
}- Test OpenClaw tool exposure
- Test LangChain tool wrapping
- Test CrewAI agent wrapping
- Test Farcaster Frame integration
- Mock all external bridge APIs
10.5: Governance (#1106)
- runtime/src/governance/engine.ts
- runtime/src/governance/types.ts
- runtime/src/governance/errors.ts
- runtime/src/governance/engine.test.ts
- runtime/src/governance/index.ts
- programs/agenc-coordination/src/instructions/create_proposal.rs
- programs/agenc-coordination/src/instructions/vote_proposal.rs
- programs/agenc-coordination/src/instructions/execute_proposal.rs
- programs/agenc-coordination/src/state/governance.rs
- tests/governance.ts
- programs/agenc-coordination/src/instructions/mod.rs (add governance instructions)
- programs/agenc-coordination/src/lib.rs (export instructions)
- programs/agenc-coordination/src/state.rs (export governance accounts)
- programs/agenc-coordination/src/events.rs (add governance events)
- runtime/src/index.ts (export governance)
- PDA seeds: ["proposal", proposer, nonce] for Proposal
- PDA seeds: ["governance_vote", proposal_pda, voter] for GovernanceVote
- Voting power based on reputation stake
- Proposal types: protocol upgrade, fee change, treasury spend
- Execution requires quorum + majority
- Treasury management via multisig pattern
- Follow programs/agenc-coordination/src/instructions/vote_dispute.rs voting pattern
- Use multisig pattern from existing protocol operations
- Follow runtime/src/dispute/operations.ts vote aggregation pattern
interface GovernanceEngine {
createProposal(proposal: Proposal): Promisestring>;
vote(proposalId: string, approve: boolean): Promisevoid>;
executeProposal(proposalId: string): Promisevoid>;
getProposal(proposalId: string): PromiseProposalWithVotes | null>;
}
interface Proposal {
title: string;
description: string;
proposalType: ProposalType;
data: ProposalData;
votingDeadline: number;
executionDelay: number;
}
interface ProposalData {
protocolUpgrade?: { newProgramId: PublicKey };
feeChange?: { newFeeBps: number };
treasurySpend?: { recipient: PublicKey; amount: bigint };
}
interface Vote {
voter: Uint8Array;
approve: boolean;
votingPower: number;
timestamp: number;
}- Test proposal creation (validation)
- Test voting (reputation-weighted)
- Test quorum calculation
- Test proposal execution (multisig)
- Test treasury spending
- Use LiteSVM pattern