Clarity & JSON Implementation

To create a Reputation (REP) badge using Clarity and JSON, you need to manage onchain logic with Clarity and define metadata with JSON.

Clarity

Clarity Contract

The Clarity contract facilitates batch endorsements, allowing authorized users to issue badges to multiple recipients. It verifies the issuer's authority and manages the process of adding badges (endorsements) to users' profiles. Key functions include add-badge (adds a badge to a user) and endorse (issues badges to multiple users at once).

JSON

JSON Metadata

The JSON metadata defines the badge's attributes, such as its name, description, image, and criteria. It helps visually represent the badge and provides context, like the number of events engaged in or the date issued.

Example structure:

{
  "name": "Community Engagement Badge",
  "description": "Awarded for actively engaging in community events.",
  "image": "https://example.com/badges/community-engagement.png",
  "attributes": [{"trait_type": "Engagement", "value": "5 events"}]
}

Together, Clarity handles issuing the badge, and JSON defines its visual and contextual properties.

Last updated