Authority-Ledger

Authority Ledger

A permission state machine for AI agents with full audit trail on-chain

License: MIT Network: Base

๐ŸŽฏ Problem

When an AI agent acts on your behalf, how do you know it had permission to do what it did?

Current AI agent systems lack:

โœจ Solution

Authority Ledger records every permission change as an on-chain event with cryptographic evidence.

Authority Levels

Level Name Description
3 EXECUTE Full autonomous execution
2 SUGGEST Agent suggests, human confirms
1 OBSERVE Read-only access
0 REVOKED No permissions

Event Types

๐Ÿš€ Quick Start

# Clone the repo
git clone https://github.com/your-username/authority-ledger.git
cd authority-ledger

# Install dependencies
forge install

# Build
forge build

# Test
forge test

# Deploy
forge script script/Deploy.s.sol --rpc-url $RPC_URL --broadcast

๐Ÿ“‹ Contracts

Base Sepolia Testnet

Contract Address
AuthorityState 0xe7da77beBf85a0b3BEDf46c056e7Fb4f77AC2aD8
EvidenceStore 0xe70c84F38A5dB8A5c3cF22112036dab70cad16DD

๐Ÿ”ง Usage

Register an Agent

authority.registerAgent(agentAddress);

Grant Authority

authority.grantAuthority(
    agentAddress,
    AuthorityLevel.EXECUTE,  // level
    0x0,                      // scope (all permissions)
    86400                     // duration (24 hours)
);

Check Authority

(bool hasAuth, uint8 level) = authority.checkAuthority(agentAddress, AuthorityLevel.SUGGEST);

Revoke Authority

authority.revokeAuthority(
    agentAddress,
    RevokeReason.DRIFT_DETECTED,
    evidenceId  // reference to evidence
);

๐Ÿ—๏ธ Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    Authority Ledger                              โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                                  โ”‚
โ”‚   AuthorityState.sol              EvidenceStore.sol             โ”‚
โ”‚   โ”œโ”€โ”€ Authority levels            โ”œโ”€โ”€ Evidence storage          โ”‚
โ”‚   โ”œโ”€โ”€ State transitions           โ”œโ”€โ”€ Diversity checks          โ”‚
โ”‚   โ”œโ”€โ”€ Audit logging               โ””โ”€โ”€ IPFS integration          โ”‚
โ”‚   โ””โ”€โ”€ ERC-8004 integration                                      โ”‚
โ”‚                                                                  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿงช Testing

# Run all tests
forge test

# Run with gas report
forge test --gas-report

# Run specific test
forge test --match-test testGrantAuthority -vvv

All 11 tests passing โœ…

๐Ÿ“ Project Structure

authority-ledger/
โ”œโ”€โ”€ contracts/
โ”‚   โ”œโ”€โ”€ AuthorityState.sol
โ”‚   โ””โ”€โ”€ EvidenceStore.sol
โ”œโ”€โ”€ test/
โ”‚   โ””โ”€โ”€ AuthorityState.t.sol
โ”œโ”€โ”€ script/
โ”‚   โ””โ”€โ”€ Deploy.s.sol
โ”œโ”€โ”€ frontend/
โ”‚   โ””โ”€โ”€ index.html
โ”œโ”€โ”€ DESIGN.md
โ”œโ”€โ”€ DEPLOYMENT.md
โ””โ”€โ”€ SUBMISSION.md

๐Ÿ† Target Prizes

Track Prize
Agents With Receipts โ€” ERC-8004 $4,000
Private Agents, Trusted Actions $5,750
Best Use of Delegations $3,000
Synthesis Open Track $14,059

๐Ÿ“„ License

MIT


Authority Ledger โ€” Because every permission change deserves a receipt.