Bullish.social
Project/Technical Documentation/Backend Architecture

Backend Architecture

Bullish Social integrates traditional server architecture with Web3 components to deliver a seamless and decentralized social experience.

🔁 Summary - Off-chain & On-chain Workflow

Weekly Data - Claiming Rewards

  1. Users engage with the platform (posting, liking, referring others).
  2. The backend records and ranks user activity off-chain.
  3. At the end of each week, a snapshot hash is generated for each user.
  4. Merkle trees are constructed from these hashes and submitted to the smart contract.
  5. Users submit their signed snapshot to the smart contract.
  6. The contract verifies signatures using the Merkle Root, distributes rewards.

Voting Power - Creating Proposals

  1. The user claims rewards if eligible.
  2. The user calls the propose function with including their ranking to the governor contract.
  3. The governor contract queries the rewarder contract to verify the user's rank.
    • The rewarder contract checks the s_usedIndividualRanks or s_usedClubMemberRank mappings to confirm rank ownership.
    • The rewarder contract cannot verify the rank if the user has not already claimed their reward.
    • The rewarder contract checks if the week of the rank is within the eligibleWeekCount range.
    • The rewarder contract checks if the rank is within the votingMaximumRank range.
  4. If the rank is valid and within the votingMaximumRank range, the user is granted voting power.
  5. The governor contract creates the proposal on-chain.

On this page