This document specifies the format of evidence submissions in the Kleros V2 protocol. Evidence is submitted as a JSON-encoded string through the Evidence
event in the IEvidence
interface.
The evidence parameter must be a JSON string containing an object with the following properties:
{
name: string; // The title/name of the evidence
description: string; // The main content/description of the evidence
fileURI?: string; // Optional. URI pointing to additional evidence files, typically an IPFS URI
}
-
name (required)
- Type:
string
- Description: A title for the evidence submission
- Example:
"Evidence"
- Type:
-
description (required)
- Type:
string
- Description: The main content or argument of the evidence
- Example:
"This transaction was invalid because..."
- Type:
-
fileURI (optional)
- Type:
string
- Description: A URI pointing to additional evidence files, typically an IPFS URI
- Format: Usually an IPFS path starting with "/ipfs/"
- Example:
"/ipfs/QmWQV5ZFFhEJiW8Lm7ay2zLxC2XS4wx1b2W7FfdrLMyQQc"
- Type:
Evidence files are uploaded through the Atlas provider which enforces the following restrictions:
-
Role-Based Restrictions
- Files are validated against the
evidence
role in the Atlas provider - Each role has specific restrictions for:
- Maximum file size (in bytes)
- Allowed MIME types
- Files are validated against the
-
Validation Process
- Files are checked for:
- Valid MIME type against the allowed list
- File size against the maximum allowed size
- Validation occurs before IPFS upload
- Failed validation results in an error with a descriptive message
- Files are checked for:
-
Error Messages
- "Unsupported file type" - when file MIME type is not in the allowed list
- "File too big" - when file exceeds the maximum size limit
- Size limit message includes the maximum allowed size in MB
{
"name": "Evidence",
"description": "The respondent failed to deliver the agreed-upon services...",
"fileURI": "/ipfs/QmWQV5ZFFhEJiW8Lm7ay2zLxC2XS4wx1b2W7FfdrLMyQQc"
}
- The evidence string must be a valid JSON object when stringified
- The
name
anddescription
fields are mandatory - The
fileURI
field is optional and should only be included when additional files are provided - When submitting through the
Evidence
event, the JSON object must be stringified - File uploads are processed through the Atlas provider before being added to IPFS
- File restrictions are enforced by the Atlas provider at upload time
IEvidence.sol
: Defines theEvidence
event that accepts this formatSubmitEvidenceModal.tsx
: Frontend component that constructs evidence in this formatAtlasProvider
: Handles file uploads with role-based restrictions
- The evidence data is stored off-chain, with only the JSON string being emitted in the event
- File uploads are restricted by type and size through the Atlas provider
- Evidence submissions are immutable once submitted to the blockchain
- The
_party
address in the Evidence event is used to track the submitter