Author: Harshil Patel
Affiliation: CHARUSAT, Anand, Gujarat, India
AgentChain provides decentralized verification of LLM-based agents using Ethereum smart contracts. It ensures tamper-proof logging, auditability, and multi-agent consensus.
- 42,310 gas/action
- 187 ms latency
- 84 actions/sec throughput
LLM agents introduce accountability and auditability issues due to centralized logs. AgentChain solves this using blockchain.
Existing systems lack verifiable logging and decentralized validation.
- AgentRegistry
- ActionLog
- ConsensusVerifier
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;
}
}- Gas: 42K per action
- Latency: 187 ms
- Throughput: 84 actions/sec
- Tamper-proof logs
- Sybil resistance
- Replay protection
AgentChain enables verifiable and decentralized AI agent execution.