Skip to main content
Version: 0.1.0

OpenClaw Integration

Give your OpenClaw agent the ability to check any human's on-chain and social reputation before granting access.

Overview

BaseCred provides an OpenClaw Skill that teaches agents to:

  • Self-register autonomously (no human needed to create API keys)
  • Identify humans by wallet address
  • Call the BaseCred API to evaluate reputation across all 5 contexts
  • Receive natural language summaries alongside structured decisions
  • Optionally request ZK proofs for cryptographic verification
  • Receive webhook notifications for verification, reputation checks, and revocation events
  • Handle errors gracefully (never default to ALLOW)

Quick Start (Self-Registration)

The recommended flow is fully autonomous — the agent registers itself and sends a verification link to its owner.

Step 1: Register

curl -X POST https://www.zkbasecred.xyz/api/v1/agent/register \
-H "Content-Type: application/json" \
-d '{
"agentName": "my_agent",
"contactHandle": "@owner_telegram",
"ownerAddress": "0x1234...abcd",
"webhookUrl": "https://your-endpoint.com/webhook"
}'

The webhookUrl is optional. If provided, zkBaseCred will POST events (verification, reputation checks, revocation) to that URL. Must be HTTPS, max 512 chars.

Response:

{
"apiKey": "bc_...",
"claimId": "abc123...",
"claimUrl": "https://www.zkbasecred.xyz/agent/claim/abc123...",
"verificationCode": "BASECRED-X7K2",
"message": "SAVE YOUR API KEY! It will not be shown again."
}

Send the claimUrl to your owner (via Telegram, Discord, etc.). The owner visits the link, posts a tweet containing the verificationCode, and submits the tweet URL on the claim page.

Step 3: Poll for Verification

curl https://www.zkbasecred.xyz/api/v1/agent/register/{claimId}/status

Once status is "verified", your API key is active.

Step 4: Check Owner Reputation

curl -X POST https://www.zkbasecred.xyz/api/v1/agent/check-owner \
-H "x-api-key: bc_your_api_key" \
-H "Content-Type: application/json"

No body needed — the owner's wallet is derived from the API key.

Response:

{
"ownerAddress": "0x1234...abcd",
"agentName": "my_agent",
"zkEnabled": false,
"summary": "Your reputation is strong. You have high trust on Ethos, solid builder credentials via Talent Protocol. You're approved for allowlist access, commenting, publishing, applications, governance voting.",
"results": {
"allowlist.general": { "decision": "ALLOW", "confidence": "HIGH", "constraints": [] },
"comment": { "decision": "ALLOW", "confidence": "HIGH", "constraints": [] },
"publish": { "decision": "ALLOW", "confidence": "HIGH", "constraints": [] },
"apply": { "decision": "ALLOW", "confidence": "HIGH", "constraints": [] },
"governance.vote": { "decision": "ALLOW", "confidence": "HIGH", "constraints": [] }
}
}

Step 5: Deliver Results

Forward the summary to your owner. It's written in natural language — no technical interpretation needed.

Alternative: Manual API Key

If you prefer, you can still create API keys manually:

  1. Visit zkbasecred.xyz/agent
  2. Connect your wallet
  3. Generate a new API key
  4. Set BASECRED_API_KEY=bc_... in your agent config

Install the Skill

Option A: OpenClaw CLI

npx zkbasecredagent-skill

Option B: Manual

curl -s https://www.zkbasecred.xyz/skill.md > ~/.openclaw/workspace/skills/basecred-reputation/SKILL.md

Available Contexts

ContextUse Case
allowlist.generalGeneral access or allowlist checks
commentComment or message permission
publishContent publishing rights
applyApplication or submission gating
governance.voteGovernance participation

Decision Values

DecisionMeaning
ALLOWGood reputation — proceed
ALLOW_WITH_LIMITSMixed signals — proceed with restrictions
DENYInsufficient reputation — block action

ZK Proofs (Optional)

Add ?withProof=true to the check-owner request for cryptographic verification:

curl -X POST "https://www.zkbasecred.xyz/api/v1/agent/check-owner?withProof=true" \
-H "x-api-key: bc_your_api_key"

Each context result will include a Groth16 proof, public signals, and verified: true. This adds ~3-4 seconds to the response time.

See the Agent API Reference for full endpoint documentation.

Error Handling

StatusMeaningAction
401Invalid or inactive API keyCheck configuration or verify claim
409Agent name already takenChoose a different name
422Tweet verification failedCheck tweet is public and contains the code
429Rate limitedWait for Retry-After header
503ZK circuits unavailableRetry without withProof
5xxServer errorNever default to ALLOW — retry later

Webhook Notifications (Optional)

If you provided a webhookUrl during registration, zkBaseCred sends event notifications to that URL:

EventWhen It Fires
agent.verifiedOwner verifies the agent via tweet
reputation.checkedAgent calls check-owner or /decide
agent.revokedOwner revokes the agent

Delivery is fire-and-forget (no retries). The webhook URL must be HTTPS, must not point to private/local addresses, and must respond within 5 seconds.

See the Agent API Reference for payload examples and full details.

Security

  • API keys are hashed (SHA-256) before storage — never stored in plaintext
  • Keys are inactive until tweet verification completes
  • Activity logs let key owners see who's checking their reputation
  • Owners can revoke agents at any time from the dashboard
  • Store your API key securely — rotate immediately if exposed