Canvas & Badge Integration Guide

We are thrilled to have you join us in building unique badges on Scroll Canvas, a product designed for ecosystem projects to interact with users in a more personal way on-chain.

Background

Canvas

Each Canvas is a Profile smart contract, minted by the users through the ProfileRegistry contract on Scroll. Canvas is not transferrable and unique to each wallet. (You can check out Canvas contracts here)

Canvas is an open onchain profile database of user identities and achievements (check out dashboard built by community on Dune).

Badge

Badges are attestations of identities, achievements and traits issued through the Ethereum Attestation Service permissionlessly by different ecosystem projects. Badges are wallet-bound and non-transferable. Badges facilitate interactions between ecosystem projects and users.

Developers can issue badges in three methods:

Issuance MethodDescriptionExample
PermissionlessBadge checks eligibility based on smart contract.Badges attest to the completion of an on-chain transaction or holding of an NFT.
Backend-authorizedBadge checks eligibility based on the issuer’s API.Badges attest to the completion of off-chain actions or a certain allow list.
GiftedBadge checks eligibility based on the issuer’s API and automatically sends the badges to users’ canvas. There is no minting required for users to display the badge.Badges attest to the ownership or paid membership on other platforms / chains.

Developers can design badges in two ways:

Badge StructureDescription
Singleton badgesstatic attestations based on a certain user action/attribute.
Leveled badgesdynamic attestations based on the progression of the users’ onchain activities

Before you Start

Badge issuance and deployment of the contract is fully permissionless. Please follow the steps below to issue a Badge for your project.

Step 1 Design: Badge Design Guidelines

BadgeDetails
Example of badge detail page
BadgeLevels
Example of a Leveled Badge

Visual Format Request:

  • Minimum resolution: 480px x 480px
  • Optimal resolution: 600px x 600px
  • File size: Under 300KB

Decide on Badge Details

Badge DetailsAdditional Info
NameName your badge to be descriptive and creative
DescriptionBrief description of the purpose of this badge and who is eligible
StructureOne single attribute
Multiple Badges with levels trigged by different actions and traits
CategoryAchievement: tasks you have done. e.g. Scroll Origin NFTs, tasks completion badge
Identities: who you are. e.g. Ethereum year, Gitcoin passport, NFT community badge
Issuance methodFully permissionless: meaning your badge can be automatically issued by checking smart contract conditions
Gifted: Badges can also be issues with no user interaction, requires APIs
Backend-authorized: requires APIs to enable eligibility criteria
Support linkSupport channel link to your Discord/Telegram group

Step 2 Engineering: Deploying Badges & Go Live

  1. Understand Canvas and Badges: Read through this guide and understand how Canvas and Badges work together.

  2. Develop and Deploy Badge Contract (link to deployment contracts): Ensure it is verified on Scrollscan. For backend-authorized badges, you also need to deploy an AttesterProxy

  3. For backend-authorized badges, set up Check and Claim APIs. For gifted badges, set up Check API: Check eligibility and claim eligibility using provided schemas, confirm correct cross-origin configuration.

    Reference: Check and Claim API

    Check Eligibility For Minting Badge

    1. method: GET

    2. url: {{pathname}}/check?badge={{badgeContractAddress}}&recipient={{walletAddress}}

    3. contentType: data/json

    4. responseSchema

      // eligible
      {
      code: 1,
      message: "success",
      eligibility: true
      }
      // not eligible
      {
      code: 0,
      message: "why the recipient is not eligible",
      eligibility: false
      }
      // error
      // http code is not 200

    Claim Badge

    1. method: GET

    2. url: {{pathname}}/claim?badge={{badgeContractAddress}}&recipient={{walletAddress}}

    3. contentType: data/json

    4. responseSchema

      // success
      {
      code: 1,
      message: "success",
      tx: ...
      }
      // failure
      {
      code: 0,
      message: "some msg",
      }
      // error
      // http code is not 200
  4. Access Readiness: Ensure your badge contract implements ScrollBadgeDefaultURI, allowing retrieval of default display data (name, image, description, issuerName ) via bytes32(0) with informative name and description.

  5. Set up support: Prepare a channel for your badge holders can find you for support, get the url to join that channel ready.

Step 3 Test: Sanity Check

  1. Once your badge has been deployed on Scroll, you can auto-check some (but not all) of these requirements by running yarn check-badge (link to check badge script).

    • If your badge minting transaction reverts, we recommend debugging using cast:
    cast run --rpc-url https://rpc.scroll.io [txhash]

    This call will simulate the transaction in a local environment and show you the call stack and revert reason.

    • For badgeTokenURI link returned, ensure correct cross-origin configuration
    Reference: CORS

    CORS

    Please ensure the provided API supports the cross-origin requirements.

    Sepolia

    • localhost: This allows for development and testing directly from your local machine environment.
    • Domains containing the substring ‘scroll’: Any domain that includes the substring ‘scroll’ in its name is allowed to make requests.

    Mainnet

    • scroll.io domain: requests originating from scroll.io are permitted.
  2. Review the information on the badge detail page:

    • Confirm that all basic badge information and redirect links are correct and match the information you provided.
    • Verify that the check API is operational. Test it with 2-4 wallet addresses eligible/ineligible to mint this badge and confirm that the claim API is functioning properly.
    • If you have created a badge that can be upgraded, please use wallets that meet different level requirements to attempt minting it. Ideally, find at least one wallet per level requirement to ensure the badge mints correctly.
  3. To maintain the availability of the check API and claim API, Scroll recommends maintaining a TPS of approximately 300. Adjust this rate accordingly if your API handles multiple badges simultaneously.

  4. If your badge image is stored on IPFS, due to the distributed nature of IPFS, the request time for users in different regions to access content on IPFS can be unpredictable. If they want a better user experience, they can self-host the content.

Step 4 Announce: Reveal Your Badge

  1. To get the word out faster, you are encouraged to embed badge mint and discovery in your product! Scroll provides an example code for anthropomorphic “assistants” to pop up when the user meets the badge minting requirements.

    Scroll Canvas - Anthropomorphic “assistants” Integration Guide for Developers

  2. Share on social media about your badge launch and the eligibility criteria. Use #BadgeonScroll and tag @Scroll_ZKP to boost more visibility.

  3. Monitor your community / support channel for user feedback. If there is any Canvas backend related issues, please reach out to Scroll Discord channel.


Get listed on Canvas & Badges
  1. Ensure that your project is listed on the Scroll Ecosystem Page. If you cannot find it yet, please fill out this form to discuss onboarding your Badges with Scroll Partnerships team.
  2. Application Portal: https://scroll.io/canvas/listing
    • General Badge Review Criteria :
      • Project is indexed on Scroll’s ecosystem page. If you cannot find it yet, please fill out this form.
      • Complete and clear badge description including Badge name, Issuer name, Issuer URL (website/official link), Support URL (support channel link).
      • Clear and reasonable eligibility criteria. Scroll holds discretion on not featuring badges with criteria that can be exploitive to users.
      • Badge design is high-resolution, representative of the issuer’s branding.
      • Two badges will be on display from the same project on Canvas & Badges page. If there are new and innovative new use cases for badges from the same project, Scroll team will consider making exceptions to allow up to two more badges.
      • Once your project is visible on the ecosystem page, after they submit the listing request form, Scroll team will review submission and approve on a weekly basis.
    • Badge Swaps and Withdrawal
      • After reaching the 2 badge quota, if a project team wants to add new badges, they can raise the request in Discord with link to the new badge information.
Stay up-to-date on the latest Scroll Developer news
Roadmap updates, virtual and live events, ecosystem opportunities and more
Thank you for subscribing!

Resources

Follow Us