Kutip Deployment Log
Tracks on-chain deployments as they happen.
Kite Testnet
| Component | Address | TX | Block | Date |
|---|---|---|---|---|
| AttributionLedger | 0xbC4eeC2f75a0DCf61509842e1c18Abff7236A338 | 0x1681bae9…b0a221 | 21421528 | 2026-05-15 |
| Deployer EOA | 0x5C91B851…bF40c | — | — | — |
| Agent AA | 0x4da7f4cF…1776 | pending first UserOp | — | — |
Gas used (actual)
| Action | Gas | KITE cost @ 0.002 gwei |
|---|---|---|
| Deploy AttributionLedger | 710,763 | ~0.0000014 KITE |
Deploy Steps
1. Fund wallets
- Create (or reuse) a dev wallet in MetaMask.
- Add Kite testnet network:
- RPC:
https://rpc-testnet.gokite.ai/ - Chain ID:
2368 - Currency:
KITE - Explorer:
https://testnet.kitescan.ai/
- RPC:
- Visit
https://faucet.gokite.ai→ claim KITE (gas). - Acquire mock USDC (address
0x0fF5393387ad2f9f691FD6Fd28e07E3969e27e63). Options:- Mint via the contract's public mint on KiteScan (if exposed).
- Ask in Kite Discord
#testnet-supportfor a drip. You need roughlyDEFAULT_QUERY_PRICE × demo queries ≈ 10 USDCfor the service wallet.
2. Fill Kutip/.env
From Kutip/ root:
# Already gitignored — just edit in place
notepad .env # Windows
# or: nano .env
Required keys:
| Key | Value |
|---|---|
PRIVATE_KEY | Deployer EOA, 0x + 64 hex chars |
NEXT_PUBLIC_AGENT_OPERATOR_ADDRESS | Wallet that receives 15% of each query |
NEXT_PUBLIC_ECOSYSTEM_FUND_ADDRESS | Wallet that receives 5% of each query |
OPENROUTER_API_KEY | LLM access (free tier OK for hackathon) |
OPENROUTER_MODEL | e.g. z-ai/glm-4.5-air:free (primary) |
OPENROUTER_FALLBACK_MODEL | e.g. openai/gpt-oss-120b:free (retry) |
For a solo hackathon demo it's fine to use the same address for deployer + operator + ecosystem fund.
3. Deploy contract
# From Kutip/contracts
forge script script/Deploy.s.sol:Deploy \
--rpc-url $KITE_RPC_URL \
--private-key $PRIVATE_KEY \
--broadcast -vvv
On Windows PowerShell, $KITE_RPC_URL expands only if you source .env first. Easiest:
Get-Content ..\.env | ForEach-Object {
if ($_ -match '^([A-Z_]+)=(.*)$') { Set-Item -Path "env:$($Matches[1])" -Value $Matches[2] }
}
forge script script/Deploy.s.sol:Deploy --rpc-url $env:KITE_RPC_URL --private-key $env:PRIVATE_KEY --broadcast -vvv
The script logs AttributionLedger deployed at: 0x.... Copy that address.
4. Wire address back into env
In Kutip/.env:
NEXT_PUBLIC_ATTRIBUTION_LEDGER=0x<address from step 3>
ATTRIBUTION_LEDGER_ADDRESS=0x<address from step 3>
Sync into the web app:
# From Kutip/
pnpm run env:sync
5. Fund the ledger's operator with USDC
The service wallet (= PRIVATE_KEY) must hold enough mock USDC to cover each query's
totalPaid. Every attestAndSplit call:
transferthe full query fee to the ledger.- Ledger fans out 80 / 15 / 5 to authors / operator / ecosystem.
For a 2-USDC query the service wallet spends 2 USDC and receives 0.30 USDC back (15% operator
share), so budget at least ~5 × queries × 2 USDC to run a smooth demo.
6. Verify on KiteScan
Visit https://testnet.kitescan.ai/address/<ledger> — you should see the constructor
values (paymentToken = KITE_TESTNET_USDC, operator = ..., etc.).
7. Run the web app
cd web
pnpm dev
Visit http://localhost:3000/research → run a sample query → watch the 5-step agent
progress → confirm step 5 lands a real tx on KiteScan.
Wallets
| Role | Address | Purpose |
|---|---|---|
| Deployer | — | Deploys contracts, holds initial KITE |
| Operator | — | Receives 15% of each query revenue |
| Ecosystem Fund | — | Receives 5% of each query revenue |
Fill these in after step 2.
Web app — Vercel + Blob storage
The Next.js app deploys to Vercel. Research summaries are persisted to
Vercel Blob so /dashboard/history, /verify, and the receipt /
reverse-x402 endpoints survive serverless cold starts.
- Vercel dashboard → project → Storage → Create Database → Blob → connect to the project (all environments).
- This injects the
BLOB_READ_WRITE_TOKENenv var automatically. - Redeploy so the running deployment picks the token up.
The store is optional — without BLOB_READ_WRITE_TOKEN the summary
store degrades to in-memory (per-instance, lost on cold start) and the
app still runs. See web/lib/summary-store.ts.
Gas Estimates
| Action | Estimated gas | KITE cost |
|---|---|---|
| Deploy AttributionLedger | ~1.2M | ~0.002 |
| attestAndSplit (5 citations) | ~180K | ~0.0004 |
| attestAndSplit (1 citation) | ~80K | ~0.0002 |
Troubleshooting
InvalidSplitrevert at deploy —OPERATOR_BPS + AUTHORS_BPS + ECOSYSTEM_BPSmust equal10000.WeightMismatchrevert at attestAndSplit — agent sends malformed citation weights. CheckflattenCitationsForContractoutput sums to10000.ERC20: insufficient balance— service wallet hasn't been pre-funded with mock USDC (step 5).- Frontend says "not deployed" —
NEXT_PUBLIC_ATTRIBUTION_LEDGERempty inweb/.env.local. Runpnpm run env:syncafter editing root.env.