Skip to content

vizzzix/tempokey

Repository files navigation

TempoKey

AI Agent Payment Platform on Tempo blockchain. Give AI agents autonomous spending power with on-chain limits, real-time monitoring, and instant revocation.

TempoKey Dashboard

Overview

TempoKey lets developers create delegated P256 access keys for AI agents with built-in spending limits and expiry. Agents can make payments using a single API call from any language: Python, JavaScript, cURL.

Key features:

  • P256 access keys with on-chain spending limits
  • Gasless transactions (fees sponsored by the owner)
  • Sub-second finality on Tempo
  • Instant one-tx revocation
  • Token swaps and batch payments
  • Agent templates for quick setup
  • REST API with Bearer token auth
  • Real-time activity monitoring

Live Demo

https://www.tempokey.xyz

Tech Stack

Frontend: React 18, TypeScript, Vite, Tailwind CSS, shadcn/ui, wagmi/viem

SDK: @tempokey/sdk - TypeScript SDK for agent payments (docs)

API Server: Hono, Node.js, viem, Zod validation

Blockchain: Tempo Network (testnet), PathUSD stablecoin

Getting Started

Prerequisites

  • Node.js 18+
  • npm

Install & Run

git clone https://github.com/vizzzix/tempokey.git
cd tempokey
npm install
npm run dev

Open http://localhost:5173

REST API (optional)

cd api
npm install

# Configure environment
cp .env.example .env
# Edit .env - set KEY_SECRET to a random string

npm run dev

API runs on http://localhost:3001

Project Structure

src/
  components/
    dashboard/     # Agent cards, detail view, modals, playground
    landing/       # Landing page sections
    ui/            # shadcn/ui components
  hooks/           # React hooks (agents, transactions, balances)
  lib/             # Storage, keychain, transfer watcher, utilities
  config/          # Tempo chain and token configuration
  pages/           # Dashboard, Landing
api/
  src/
    routes/        # API endpoints
    services/      # Crypto, blockchain interactions
    middleware/     # Auth, rate limiting
    storage/       # Agent data store
  tests/           # Unit & integration tests
sdk/               # @tempokey/sdk - TypeScript SDK
  src/             # SDK source (TempoKey class, operations, tokens)
  tests/           # SDK tests

How It Works

  1. Connect Wallet - Owner connects via MetaMask or any EVM wallet
  2. Create Agent - Pick a template or configure manually (name, limit, expiry)
  3. On-Chain Auth - authorizeKey registers the P256 key in Tempo's Keychain precompile
  4. Use Agent - Send payments, swap tokens, batch pay via dashboard or API
  5. Monitor - Track spending, limits, and transaction history in real time
  6. Revoke - Instantly freeze any agent with one transaction

Key Concepts

Concept Description
Keychain Precompile Tempo's native precompile (0xaAAAaaAA...) for access key management
P256 Keys ECDSA keys on the P-256 curve, generated client-side
Spending Limits Per-token allowances enforced on-chain (6 decimal precision for pathUSD)
Expiry Unix timestamp-based key expiration (supports "no limit" mode)

Scripts

Command Description
npm run dev Start frontend dev server
npm run build Production build
npm run preview Preview production build
npm run lint Run ESLint
npm test Run frontend tests

API Scripts (cd api)

Command Description
npm run dev Start API with hot reload
npm run build Compile TypeScript
npm test Run tests
npm run test:coverage Run tests with coverage

SDK Scripts (cd sdk)

Command Description
npm run build Build SDK
npm test Run SDK tests
npm run typecheck Type check

Environment Variables

API (api/.env)

Variable Description Required
KEY_SECRET Encryption key for agent private keys Yes
PORT API server port (default: 3001) No
CORS_ORIGIN Allowed CORS origin (default: http://localhost:5173) No

Network

License

MIT

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages