Skip to content

Latest commit

 

History

History
103 lines (73 loc) · 1.96 KB

File metadata and controls

103 lines (73 loc) · 1.96 KB

AgentChain: Decentralized Verification of LLM-Based Autonomous Agents via Smart Contracts

Author: Harshil Patel
Affiliation: CHARUSAT, Anand, Gujarat, India

Abstract

AgentChain provides decentralized verification of LLM-based agents using Ethereum smart contracts. It ensures tamper-proof logging, auditability, and multi-agent consensus.

Key Results

  • 42,310 gas/action
  • 187 ms latency
  • 84 actions/sec throughput

I. Introduction

LLM agents introduce accountability and auditability issues due to centralized logs. AgentChain solves this using blockchain.


II. Related Work

Existing systems lack verifiable logging and decentralized validation.


III. Architecture

Components:

  • AgentRegistry
  • ActionLog
  • ConsensusVerifier

IV. Implementation

Solidity Contract (ActionLog)

pragma solidity ^0.8.20;

interface IAgentRegistry {
function isRegistered(address a) external view returns (bool);
}

contract ActionLog {

struct LogEntry {
bytes32 contentHash;
string ipfsCid;
uint8 actionType;
uint256 timestamp;
address agentAddr;
}

IAgentRegistry public registry;
mapping(uint256 => LogEntry) public logs;
uint256 public logCount;

event ActionCommitted(
uint256 indexed logId,
address indexed agent,
bytes32 contentHash,
string ipfsCid,
uint8 actionType,
uint256 timestamp
);

constructor(address _registry) {
registry = IAgentRegistry(_registry);
}

function commit(bytes32 _hash,string calldata _cid,uint8 _type) external returns (uint256) {

require(registry.isRegistered(msg.sender));

uint256 id = logCount++;

logs[id] = LogEntry(_hash,_cid,_type,block.timestamp,msg.sender);

emit ActionCommitted(id,msg.sender,_hash,_cid,_type,block.timestamp);

return id;
}
}

V. Evaluation

  • Gas: 42K per action
  • Latency: 187 ms
  • Throughput: 84 actions/sec

VI. Security

  • Tamper-proof logs
  • Sybil resistance
  • Replay protection

VII. Conclusion

AgentChain enables verifiable and decentralized AI agent execution.