This repo provides the full claim logic for minting verifiable ERC-1155 badges based on context metadata and MCP eligibility criteria. Users can claim NFTs tied to their onchain or offchain activity — such as interacting with an AI agent, saving context, or reaching a milestone.
This module powers the eligibility checks, context validation, and ERC-1155 badge minting flow. It integrates with:
- Model Context Protocol (MCP)
- ERC-1155 badge contract
- Wallet signature or backend-verifiable logic
- 🧠 Eligibility checks: verifies model hash, context CID, user address
- 🖋️ Optional offchain proof verification (agent-signed, snapshot, DB)
- 🏷️ Mints ERC-1155 NFT with metadata linked to MCP data
- ⚙️ Supports single-claim per badge ID or reusable logic
- 🪙 Claim from front-end or script via wallet signature
- User interacts with agent (context is saved)
- System generates contextCID and modelHash
- Eligibility is evaluated (via backend or onchain logic)
- If eligible, contract mints ERC-1155 badge to user wallet
- Mint emits VerifiableBadgeMinted with MCP metadata
npm install
npx hardhat compileawait contract.mintBadge(
userAddress,
badgeId,
contextCID,
modelHash
);You can also implement signature-based minting:
await contract.claimWithSignature(
signature,
badgeId,
contextCID,
modelHash
);This repo can use or extend the mcp-nft1155-contract.
Function:
function mintBadge(
address to,
uint256 badgeId,
string calldata contextCID,
bytes32 modelHash
) external;Follows ERC-1155 standard with MCP-specific extensions:
{
"name": "Memory Saver",
"description": "Earned by storing context onchain with GPT",
"image": "ipfs://badge-memory.png",
"attributes": [
{ "trait_type": "Context CID", "value": "bafy..." },
{ "trait_type": "Model Hash", "value": "0x..." },
{ "trait_type": "Level", "value": "Bronze" }
]
}