Skip to content

chrsnikhil/MustaFair

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MustaFair

MustaFair is a decentralized identity and reputation protocol designed to bring Web2 and Web3 identities under a single on-chain identity. Users can mint their CARV ID (ERC-7231), authenticate across dApps, and build a publicly verifiable Reputation NFT (ERC-721) based on their digital contributions and trustworthiness.

This project was originally built during a hackathon, but it has since evolved into a long-term initiative. Over 230+ active users are currently using our SDK to power decentralized reputation and identity verification across apps.


What is CARV ID?

CARV ID is an identity NFT that complies with the ERC-7231 standard. It links your Web2 and Web3 accounts into a unified profile. Users can:

  • Mint a unique CARV ID NFT
  • Link GitHub and Google accounts
  • Authenticate using MetaMask or any EVM-compatible wallet
  • Store the identity as an NFT in their wallet

This identity is portable and interoperable across dApps and blockchains.


What is the Reputation NFT?

Once a CARV ID is minted, users can mint a Reputation NFT (ERC-721), which:

  • Represents a user's trust score
  • Tracks Web2 activity (e.g. GitHub contributions, Google data)
  • Tracks Web3 participation (on-chain interactions, smart contract usage)
  • Stores reputation on-chain as metadata

This allows applications to gate access, assign voting power, or build trust models based on provable, decentralized data.


SDK: @mustafair/reputation-sdk

We published a full-featured SDK to make integrating CARV ID and reputation NFTs dead simple for developers.

Features

  • CARV ID Authentication - Web3-native login with Web2 support
  • Reputation System - Fetch and validate reputation NFTs
  • Multi-chain Support - Currently supports BSC Testnet + local
  • Web2 Integration - GitHub and Google account binding
  • TypeScript Support - Fully typed with intellisense
  • API Access - Profiles, leaderboards, achievements, statistics
  • Optimized Performance - Supports batch operations and caching

Installation

npm install @mustafair/reputation-sdk
# or
yarn add @mustafair/reputation-sdk
# or
pnpm add @mustafair/reputation-sdk
Peer Dependencies
bash
Copy
Edit
npm install viem wagmi
Quick Start
Basic Usage
ts
Copy
Edit
import { Fair3ReputationSDK } from '@mustafair/reputation-sdk';

const sdk = new Fair3ReputationSDK('https://musta-fair.vercel.app');

// Get user's profile
const profile = await sdk.getProfile('0x742...');

// Check if user has CARV ID
const hasIdentity = await sdk.hasCarvId('0x742...');
With Authentication
ts
Copy
Edit
import { useAccount, useSignMessage } from 'wagmi';
import { Fair3ReputationSDK } from '@mustafair/reputation-sdk';

const sdk = new Fair3ReputationSDK('https://musta-fair.vercel.app', 10000, {
  contractAddress: '0x742...',
  chainId: 97
});

const { address, isConnected, chainId } = useAccount();
const { signMessageAsync } = useSignMessage();

await sdk.initialize({ address, isConnected, chainId });

const result = await sdk.authenticateWithCarvId(
  (message) => signMessageAsync({ message }),
  {
    fetchMetadata: true,
    fetchWeb2Achievements: true
  }
);

if (result.success) {
  console.log('Authentication successful:', result.user);
}
API Reference
Core Methods
getProfile(address)

getCarvIdProfile(address)

getReputation(address)

hasCarvId(address)

hasReputation(address)

getLeaderboard(filters?)

getStats()

getTopPerformers(tier, limit?)

checkReputationRequirements(address, requirements)

getBatchProfiles(addresses, options?)

formatScore(score)

validateAddresses(addresses)

Authentication
initialize(walletConnection)

authenticateWithCarvId(signMessage, options?)

isWalletReady()

setWalletConnection(connection)

Type Definitions
ReputationData
ts
Copy
Edit
interface ReputationData {
  tokenId: string;
  contributionScore: number;
  tier: 'Bronze' | 'Silver' | 'Gold' | 'Platinum';
  tierLevel: number;
  creationDate: string;
  carvIdLinked: boolean;
  carvIdHash: string;
  isActive: boolean;
  metadata: any;
  contractAddress: string;
}
Other types like CarvIdData, Web2Binding, FullProfileData etc., are available in the SDK’s source.

Example Integrations
React + Wagmi
tsx
Copy
Edit
const sdk = new Fair3ReputationSDK();
const { address, isConnected, chainId } = useAccount();

useEffect(() => {
  if (isConnected && address) {
    sdk.initialize({ address, isConnected, chainId });
    sdk.getProfile(address).then(setProfile);
  }
}, [address, isConnected]);
Node.js Express
ts
Copy
Edit
app.get('/api/reputation/:address', async (req, res) => {
  const data = await sdk.getReputation(req.params.address);
  if (!data) return res.status(404).json({ error: 'Not found' });
  res.json(data);
});
Vue + Viem
js
Copy
Edit
async authenticate() {
  const result = await this.sdk.authenticateWithCarvId(
    async (message) => {
      const [address] = await this.wallet.getAddresses();
      return await this.wallet.signMessage({ account: address, message });
    }
  );
  if (result.success) console.log(result.user);
}
Error Handling
The SDK provides clean error messages for:

Invalid addresses

Network failures

Timeout scenarios

Authentication errors

Use try/catch blocks to manage SDK calls safely.

Constants
ts
Copy
Edit
import { FAIR3_CONSTANTS } from '@mustafair/reputation-sdk';

FAIR3_CONSTANTS.SUPPORTED_CHAINS
FAIR3_CONSTANTS.TIER_VALUES
FAIR3_CONSTANTS.CONTRACT_ADDRESSES
Development
Build Locally
bash
Copy
Edit
git clone https://github.com/chrsnikhil/MustaFair.git
cd MustaFair/sdk
npm install
npm run build
Run Tests
bash
Copy
Edit
npm run test
Support
🔗 Demo: https://musta-fair.vercel.app

📘 Docs: https://musta-fair.vercel.app/docs

🐛 Report Bugs: GitHub Issues

Related Projects
MustaFair Platform – Frontend app to interact with CARV ID and reputation NFTs

CARV Protocol – ERC-7231 standard powering identity aggregation

Vision
MustaFair started during a hackathon, but our goal has always been more ambitious. We are building a modular identity and reputation layer for the decentralized world.

This is not a proof-of-concept. This is a product — and we’re just getting started.

About

A Modular Identity System for Web3 with CARVID

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors