Skip to main content

Community Integration

Communities integrate with on-chain markets through the CommunityRegistry contract.

On-Chain Community Data

The CommunityRegistry stores:

  • Community ownership (who can manage the community)
  • Community ID mapping (links off-chain community to on-chain ID)

When creating a market:

  • Creator can specify a communityId (uint256)
  • Market contract stores this ID
  • Used for permission checks and filtering

Hybrid Model

On-Chain (Critical)

  • Community ownership
  • Voting rights (who can vote on community markets)
  • Market-community association

Off-Chain (Metadata)

  • Community name, description, icon
  • Membership lists
  • Invite links
  • Community settings

Why Hybrid

  • Security: Critical permissions on-chain prevent manipulation
  • Flexibility: Rich metadata off-chain for better UX
  • Cost: Avoids gas fees for non-critical updates
  • Performance: Fast queries for community features

Permission Flow

  1. User wants to create community market
  2. System checks on-chain: Does user own community?
  3. If yes, market created with community ID
  4. Off-chain: Market appears in community feed
  5. Voting: On-chain checks if user has voting rights