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 Method | Description | Example |
---|---|---|
Permissionless | Badge checks eligibility based on smart contract. | Badges attest to the completion of an on-chain transaction or holding of an NFT. |
Backend-authorized | Badge checks eligibility based on the issuer’s API. | Badges attest to the completion of off-chain actions or a certain allow list. |
Gifted | Badge 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 Structure | Description |
---|---|
Singleton badges | static attestations based on a certain user action/attribute. |
Leveled badges | dynamic 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
Visual Format Request:
- Minimum resolution: 480px x 480px
- Optimal resolution: 600px x 600px
- File size: Under 300KB
Decide on Badge Details
Badge Details | Additional Info |
---|---|
Name | Name your badge to be descriptive and creative |
Description | Brief description of the purpose of this badge and who is eligible |
Structure | One single attribute Multiple Badges with levels trigged by different actions and traits |
Category | Achievement: 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 method | Fully 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 link | Support channel link to your Discord/Telegram group |
Step 2 Engineering
: Deploying Badges & Go Live
-
Understand Canvas and Badges: Read through this guide and understand how Canvas and Badges work together.
-
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
-
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 APICheck Eligibility For Minting Badge
-
method: GET
-
url:
{{pathname}}/check?badge={{badgeContractAddress}}&recipient={{walletAddress}}
-
contentType:
data/json
-
responseSchema
Claim Badge
-
method: GET
-
url:
{{pathname}}/claim?badge={{badgeContractAddress}}&recipient={{walletAddress}}
-
contentType:
data/json
-
responseSchema
-
-
Access Readiness: Ensure your badge contract implements
ScrollBadgeDefaultURI
, allowing retrieval of default display data (name, image, description, issuerName
) viabytes32(0)
with informative name and description. -
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
-
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
:
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: CORSCORS
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 fromscroll.io
are permitted.
- If your badge minting transaction reverts, we recommend debugging using
-
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.
-
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.
-
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
-
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
-
Share on social media about your badge launch and the eligibility criteria. Use
#BadgeonScroll
and tag@Scroll_ZKP
to boost more visibility. -
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
- 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.
- 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.
- General Badge Review Criteria :