Skip to main content

Sybil Resistance

Prevent Sybil attacks using NEUS proof-based identity verification.

Strategy Overview

ApproachVerifierUse Case
Wallet uniquenessownership-basicBasic one-wallet-one-vote
Social verificationownership-socialLink social accounts
Human verificationproof-of-humanAnti-bot protection

Basic Implementation

Wallet-based (One wallet per user)

const result = await client.gateCheck({
  address: walletAddress,
  verifierIds: ['ownership-basic'],
  since: Date.now() - 24 * 60 * 60 * 1000, // 24 hours
});

Social verification

<VerifyGate
  requiredVerifiers={['ownership-social']}
  onVerified={(result) => {
    // Store the returned proof receipt ID for vote or claim replay protection
  }}
>
  <button>Verify to Vote</button>
</VerifyGate>

Best Practices

  • Always enforce recency windows for point-in-time checks
  • Store the proof receipt identifier to prevent replay attacks
  • Consider combining multiple verifiers for higher assurance

Multi-verifier approach

const result = await client.gateCheck({
  address: walletAddress,
  verifierIds: ['ownership-basic', 'proof-of-human'],
  since: Date.now() - 60 * 60 * 1000,
});

Airdrop Protection

// Check before airdrop claim
const proofs = await client.gateCheck({
  address: claimerAddress,
  verifierIds: ['proof-of-human'],
  since: Date.now() - 7 * 24 * 60 * 60 * 1000, // 7 days
});

if (!proofs.data?.eligible) {
  throw new Error('Human verification required');
}