KaiSign API Documentation

Learn how to query the KaiSign subgraph to retrieve contract specifications and blob metadata (EIP-4844).

✅ No API Key Required

The subgraph endpoint is public and doesn't require authentication. Just use the URL directly in your requests.

🔍 Query Any Blob

Test any blob hash to see API endpoints and fetch UTF-8 metadata directly in your browser.

Enter a 66-character blob versioned hash (0x + 64 hex characters)

API Endpoint

https://api.studio.thegraph.com/query/117022/kaisign-subgraph/version/latest

Available Fields

Spec Entity:

  • id - Unique identifier
  • user - Creator address
  • blobHash - Blob hash containing metadata (EIP-4844)
  • targetContract - Contract address
  • chainID - Blockchain chain ID
  • blockTimestamp - Creation timestamp
  • status - PROPOSED, SUBMITTED, FINALIZED, REJECTED

Examples

Get All Specs

Retrieve all contract specifications from the subgraph

curl -s -X POST \
  -H "Content-Type: application/json" \
  -d '{"query":"{ specs(first: 10) { id user blobHash targetContract chainID blockTimestamp status } }"}' \
  "https://api.studio.thegraph.com/query/117022/kaisign-subgraph/version/latest"

Get Specs by Contract Address

Get specifications for a specific contract

curl -s -X POST \
  -H "Content-Type: application/json" \
  -d '{"query":"{ specs(where: {targetContract: \"0x4dFEA0C2B472a14cD052a8f9DF9f19fa5CF03719\"}) { blobHash targetContract status } }"}' \
  "https://api.studio.thegraph.com/query/117022/kaisign-subgraph/version/latest"

Get Finalized Specs Only

Retrieve only specs that have been processed by handleResult

curl -s -X POST \
  -H "Content-Type: application/json" \
  -d '{"query":"{ specs(where: {status: FINALIZED}) { blobHash targetContract } }"}' \
  "https://api.studio.thegraph.com/query/117022/kaisign-subgraph/version/latest"

Fetch Blob Data (UTF-8 Metadata)

Get the actual UTF-8 blob data directly

curl -s "https://storage.googleapis.com/blobscan-production/11155111/01/96/d7/0196d7c56bbc18b22ea2ac4e65b968e39c918bfed9f7ac0c0fccabda8d0e2239.bin" | tr -d '\0'

Complete Shell Script

Save as query.sh and run to get specs and fetch their blob metadata

#!/bin/bash
URL="https://api.studio.thegraph.com/query/117022/kaisign-subgraph/version/latest"
CONTRACT_ADDRESS="0x4dFEA0C2B472a14cD052a8f9DF9f19fa5CF03719"

echo "Getting specs for contract $CONTRACT_ADDRESS..."
SPECS=$(curl -s -X POST \
  -H "Content-Type: application/json" \
  -d "{\"query\":\"{ specs(where: {targetContract: \\\"$CONTRACT_ADDRESS\\\"}) { blobHash targetContract status } }\"}" \
  "$URL")

echo "$SPECS"

BLOB_HASH=$(echo "$SPECS" | jq -r '.data.specs[0].blobHash')

if [ "$BLOB_HASH" != "null" ]; then
  echo -e "\n\nFetching UTF-8 metadata from blob: $BLOB_HASH"
  
  # Get storage URL from API
  STORAGE_URL=$(curl -s "https://api.sepolia.blobscan.com/blobs/$BLOB_HASH" | jq -r '.dataStorageReferences[] | select(.storage=="google") | .url')
  
  # Get actual UTF-8 blob data
  curl -s "$STORAGE_URL"
else
  echo "No specs found for this contract"
fi

Get Proposed Metadata for Contract

Fetch proposed ERC-7730 metadata for the KaiSign contract

curl -s -X POST \
  -H "Content-Type: application/json" \
  -d '{"query":"{ specs(where: {targetContract: \"0x4dfea0c2b472a14cd052a8f9df9f19fa5cf03719\", status: \"PROPOSED\"}) { blobHash blockTimestamp user } }"}' \
  "https://api.studio.thegraph.com/query/117022/kaisign-subgraph/version/latest"

Query Created Incentives

Get created incentives data from the subgraph

curl -s -X POST \
  -H "Content-Type: application/json" \
  -d '{"query":"{ logIncentiveCreateds(first: 10) { incentiveId creator targetContract amount deadline description blockTimestamp } }"}' \
  "https://api.studio.thegraph.com/query/117022/kaisign-subgraph/version/latest"

Query Claimed Incentives

Get claimed incentives data from the subgraph

curl -s -X POST \
  -H "Content-Type: application/json" \
  -d '{"query":"{ logIncentiveClaimeds(first: 10) { incentiveId claimer specID amount blockTimestamp } }"}' \
  "https://api.studio.thegraph.com/query/117022/kaisign-subgraph/version/latest"

Query User's Specs

Get all specs created by a specific user

curl -s -X POST \
  -H "Content-Type: application/json" \
  -d '{"query":"{ specs(where: {user: \"0x89839eF5911343a6134c28B96342f7fb3ae5D483\"}) { id blobHash targetContract status blockTimestamp incentiveId } }"}' \
  "https://api.studio.thegraph.com/query/117022/kaisign-subgraph/version/latest"

Combined Dashboard Query

Get multiple data types in one request

curl -s -X POST \
  -H "Content-Type: application/json" \
  -d '{"query":"{ proposedSpecs: specs(where: {status: \"PROPOSED\"}, first: 5) { id user blobHash targetContract blockTimestamp } finalizedSpecs: specs(where: {status: \"FINALIZED\"}, first: 5) { id user blobHash targetContract isAccepted } recentSpecs: specs(first: 5, orderBy: blockTimestamp, orderDirection: desc) { id status blockTimestamp } }"}' \
  "https://api.studio.thegraph.com/query/117022/kaisign-subgraph/version/latest"

How to Use the Script

Step-by-step instructions to run the shell script

# 1. Save the script to a file
echo '#!/bin/bash...' > query.sh

# 2. Make it executable
chmod +x query.sh

# 3. Run the script
./query.sh

# 4. To use a different contract address, edit the script:
# Change CONTRACT_ADDRESS="0x4dFEA0C2B472a14cD052a8f9DF9f19fa5CF03719"
# to your desired contract address

# 5. Requirements:
# - curl (usually pre-installed)
# - jq (install with: brew install jq on macOS or apt install jq on Ubuntu)

🔗 Blob Data Access Solutions

⚠️ Blob Data Access Methods

Multiple ways to access blob data with browser-friendly options:

✅ Recommended: Blobscan Web Interface

https://sepolia.blobscan.com/blob/[blobHash]

Click to open in new tab - works perfectly in browsers

🐝 Alternative: Swarm Gateway

https://api.gateway.ethswarm.org/bzz/[swarmReference]

Direct JSON viewing - browser friendly

📊 API Metadata

https://api.sepolia.blobscan.com/blobs/[blobHash]

Returns metadata and storage references

📥 For Developers (CLI)

curl -s "https://storage.googleapis.com/..." | tr -d '\0'

Command line access for developers