Skip to content

Start typing to search the documentation.

Key Concepts (Legacy)

On this page

Choose Your Verification Path

Every Self Pass integration has two parts: a frontend that displays a QR code (or deeplink) for users to scan with the Self app, and a verification method that checks the proof. You must choose one verification method:

Smart Contract VerificationBackend Verification
How it worksProof is verified on-chain by the IdentityVerificationHubProof is verified on your Node.js server using SelfBackendVerifier
Trust modelTrustless — anyone can verify the result on-chainTrust assumption — users trust your backend verifies correctly
Best forDeFi, airdrops, token gates, on-chain access controlWeb apps, APIs, off-chain services, rapid iteration
Trade-offsGas costs per verification; config changes require redeploymentNo gas costs; easier to update; requires a running server
GuideSmart Contract IntegrationBackend Integration
ExampleBoilerplate repoBackend branch

Choose Your Environment

EnvironmentDocumentsNetworkendpointTypeWhen to use
StagingMock passportsCelo Sepoliastaging_celo (contract) or staging_https (backend)Development and testing
ProductionReal passportsCelo Mainnetcelo (contract) or https (backend)Live applications

Configuration Values

  • scopeSeed — A short string (max 31 ASCII characters) that uniquely identifies your application, e.g. "my-airdrop-app". You pass this into your smart contract constructor as scopeSeed, and it gets hashed together with the contract address (using Poseidon) to produce the final scope — a uint256 value used in proofs to ensure nullifiers are unique to your app and prevent proof replay. Note: the frontend SelfAppBuilder currently names this field scope, but you are passing in the scopeSeed value.
  • endpointType — Determines where the proof is sent and which network is used (see table above).
  • endpoint — The destination address. For contract verification, this is your deployed contract address. For backend verification, this is your API URL.

Packages

  • @selfxyz/qrcode: QR code generation and display components — see QRCode SDK.
  • @selfxyz/core: Core utilities including getUniversalLink for deeplinks, and SelfBackendVerifier — see Backend Integration.
  • ethers: Ethereum utilities for address handling.

Verification Flow

Overview diagram of the Self verification flow

The QR code component displays the current verification status with an LED indicator and changes its appearance based on the verification state:

  1. QR Code Display: Component shows QR code for users to scan
  2. User Scans: User scans with Self app and provides proof
  3. Verification:
    1. Onchain Verification: Your smart contract receives the proof and verifies it on the Self VerificationHub contract.
    2. Backend Verification: Your API endpoint receives and verifies the proof
  4. Success Callback: onSuccess callback is triggered when verification completes
Was this page helpful?