Sol.College

Full lesson

agenteco-multichain

The economic layer for AI agents: on-chain escrow, disputes and portable reputation.

What it does

From the project README:

AgentEco The economic layer for AI agents. The escrow, dispute and reputation layer for work between AI agents: one hire() call locks the payment on-chain, checks the result and pays or disputes. Live on BNB Smart Chain Testnet, and deployed, each with a three-deal proof run, on Base Sepolia, Ethereum Sepolia, Arbitrum Sepolia, Tempo, BOT Chain Testnet and Solana devnet, all served by one live website and API.
Original
SannyDermawan/agenteco-multichain
SuperStack fork
Blockchains/agenteco-multichain @ 172edc3
Stars
0
Last push (original)
2026-10-16
Languages
TypeScript, Solidity, Rust, Python, CSS, Shell
Detected stack
@solana/kitAnchorNext.js
Categories
AI & Agents
Licence
MIT
Homepage
https://agenteco-multichain.vercel.app

Architecture

379 source files. By extension: .ts ×255, .tsx ×107, .sol ×14, .rs ×2, .py ×1.

Top-level directorySource files
frontend151
backend94
agent-runtime82
cli29
test8
seller-agent4
script3
contracts3

On-chain programs: solana/programs/agenteco_escrow

Dapp: devnet deploy pending

⏳ Devnet deploy pending — goes live when the devnet wallet is topped up. This fork's own dapp is not deployed yet, so there is no program address or transaction to show. It is queued in dapp-queue.txt; once devnet SOL is available it is deployed, exercised with real devnet transactions, and this section switches to the live dapp at /dapps/agenteco-multichain/. Until then, the lesson and step-by-step guide below are complete, and you can run it locally with the commands below.

Key code, explained

Excerpts chosen automatically where the code uses the most Solana concepts, pinned to the fork's commit.

SannyDermawan/agenteco-multichain · solana/programs/agenteco_escrow/src/lib.rs L145–168 @ 172edc3 · MIT · original
        escrow.fee_bps = config.fee_bps;        escrow.created_at = now;        escrow.funded_at = now;        escrow.execution_window = execution_window;        escrow.review_window = review_window;        escrow.accept_deadline = now + config.accept_timeout;        escrow.task_hash = task_hash;        escrow.bump = ctx.bumps.escrow;        escrow.vault_bump = ctx.bumps.vault;         ctx.accounts.reputation.seller = ctx.accounts.seller.key();         emit!(EscrowFunded {            escrow_id: id,            buyer: ctx.accounts.buyer.key(),            seller: ctx.accounts.seller.key(),            mint: ctx.accounts.mint.key(),            amount,            task_hash,        });         token::transfer(            CpiContext::new(                ctx.accounts.token_program.key(),
  1. Line 152 escrow.bump = ctx.bumps.escrow;: Uses the bump seed, the extra byte that pushes the derived address off the ed25519 curve.
  2. Line 157 emit!(EscrowFunded {: Emits an Anchor event that clients can parse from the logs.
  3. Line 166 token::transfer(: An SPL token transfer through the Token Program.
  4. Line 167 CpiContext::new(: Makes a cross-program invocation into another program.
SannyDermawan/agenteco-multichain · agent-runtime/src/chain/solana-rpc.ts L85–108 @ 172edc3 · MIT · original
    const { value: blockhash } = await this.rpc.getLatestBlockhash({ commitment: this.commitment }).send()    const transaction = await pipe(      createTransactionMessage({ version: 0 }),      (tx) => setTransactionMessageFeePayerSigner(feePayer, tx),      (tx) => setTransactionMessageLifetimeUsingBlockhash(blockhash, tx),      (tx) => appendTransactionMessageInstructions(instructions, tx),      (tx) => signTransactionMessageWithSigners(tx)    )    const signature = getSignatureFromTransaction(transaction)    try {      // Simulated against the same commitment the reads use, so a rejection is the program's own.      await this.rpc        .sendTransaction(getBase64EncodedWireTransaction(transaction), { encoding: 'base64', preflightCommitment: this.commitment })        .send()    } catch (error) {      throw new Error(`transaction rejected: ${describe(error)}`, { cause: error })    }    const deadline = Date.now() + this.confirmTimeoutMs    while (Date.now() < deadline) {      const [status] = (await this.rpc.getSignatureStatuses([signature]).send()).value      if (status?.err) throw new Error(`transaction failed: ${JSON.stringify(status.err, (_, v) => (typeof v === 'bigint' ? v.toString() : v))}`)      if (status && reached(status.confirmationStatus, this.commitment)) return signature      await sleep(this.pollMs)    }
  1. Line 85 const { value: blockhash } = await this.rpc.getLatestBlockhash({ commitment: this.commitme: Fetches a recent blockhash. Transactions expire if it gets too old.
  2. Line 97 .sendTransaction(getBase64EncodedWireTransaction(transaction), { encoding: 'base64', prefl: Submits the signed transaction to the cluster.
SannyDermawan/agenteco-multichain · agent-runtime/scripts/solana-initialize.ts L97–120 @ 172edc3 · MIT · original
  const mintAccount = await rpc.getAccountInfo(mint, { encoding: 'base64' }).send()  if (!mintAccount.value || mintAccount.value.owner !== SPL_TOKEN_PROGRAM_ID) {    console.error('refusing: the mint does not exist on this cluster or is not an SPL Token mint')    process.exit(1)  }  if ((await rpc.getAccountInfo(config as Address, { encoding: 'base64' }).send()).value) {    console.error('refusing: this program is already initialized')    process.exit(1)  }   const { value: blockhash } = await rpc.getLatestBlockhash().send()  const transaction = await pipe(    createTransactionMessage({ version: 0 }),    (tx) => setTransactionMessageFeePayerSigner(admin, tx),    (tx) => setTransactionMessageLifetimeUsingBlockhash(blockhash, tx),    (tx) => appendTransactionMessageInstruction(instruction, tx),    (tx) => signTransactionMessageWithSigners(tx)  )  const signature = await rpc.sendTransaction(getBase64EncodedWireTransaction(transaction), { encoding: 'base64' }).send()  for (let i = 0; i < 60; i++) {    const [status] = (await rpc.getSignatureStatuses([signature]).send()).value    if (status?.err) throw new Error(`initialize failed: ${JSON.stringify(status.err, (_, v) => (typeof v === 'bigint' ? v.toString() : v))}`)    if (status?.confirmationStatus === 'confirmed' || status?.confirmationStatus === 'finalized') {      console.log(`initialized: ${signature}`)
  1. Line 107 const { value: blockhash } = await rpc.getLatestBlockhash().send(): Fetches a recent blockhash. Transactions expire if it gets too old.
  2. Line 115 const signature = await rpc.sendTransaction(getBase64EncodedWireTransaction(transaction), : Submits the signed transaction to the cluster.

How to run, build and test

These commands come from the repo's own manifests (package.json scripts, Anchor.toml, Cargo, go.mod, Makefile). Check the README for prerequisites and environment variables.

DirectoryCommandRuns
.npm run startnpm run start:api
clinpm run buildtsup
clinpm run testnode --import tsx --test "test/**/*.test.ts"
frontendnpm run devnext dev
frontendnpm run startnext start
frontendnpm run buildnext build
frontendnpm run linteslint
backendnpm run devtsx watch --env-file-if-exists=.env src/index.ts
backendnpm run starttsx --env-file-if-exists=.env src/index.ts
backendnpm run testnode --import tsx --test "src/**/*.test.ts"
buyer-agentnpm run devtsx watch --env-file=.env src/index.ts
buyer-agentnpm run starttsx --env-file=.env src/index.ts
seller-agentnpm run devtsx watch --env-file=.env src/index.ts
seller-agentnpm run starttsx --env-file=.env src/index.ts
agent-runtimenpm run testnode --import tsx --test "src/**/*.test.ts"
solanaanchor buildcompile programs and generate IDLs

What you could build from it

Used in lessons