This guide outlines the two primary methods for identifying Seeker users within your React Native application. Choose the appropriate method based on your requirements and use case.
The Platform Constants method checks device information using React Native’s built-in Platform API. This is a quick, lightweight check suitable for UI treatments and non-critical features.
SECURITY CONSIDERATIONThe Platform Constants API can be spoofed and should not be used for use cases where you need a guaranteed Seeker user.For use cases where you need a guarantee that you are interacting with a Seeker user, see Method 2: Seeker Genesis Token Verification instead.
The main limitation is that this method is spoofable - rooted devices or modified apps can change the Platform constants to mimic a Seeker device.See the next method for a guaranteed way to check for interaction with a Seeker user.
For use cases where you need a guarantee that you are interacting with a Seeker user, verify that the user’s wallet contains the Seeker Genesis Token (SGT).The SGT is a unique NFT that is minted to a user’s wallet only once per Seeker device. Owning an SGT represents verified ownership of a Seeker device.Learn more about the Seeker Genesis Token.
Server-side: Verify the SIWS signatureThe signInResult from the MWA response needs to be verified on your backend server:
// This happens on your backend serverimport { verifySignIn } from "@solana/wallet-standard-util";async function verifySIWS(signInPayload, signInResult): Promise<boolean> { const serialisedOutput = { account: { publicKey: new Uint8Array(signInResult.account.publicKey), ...signInResult.account, }, signature: new Uint8Array(signInResult.signature), signedMessage: new Uint8Array(signInResult.signedMessage), }; // Verify the signature against the original payload return verifySignIn(signInPayload, serialisedOutput);}
On your backend server, combine the SIWS verification and SGT ownership check together to confirm the user is a verified Seeker owner:
// On your backend serverasync function verifySeekerUser(signInResult) { // Verify SIWS signature const siwsVerified = await verifySIWS(signInResult); // Check SGT ownership const hasSGT = await checkWalletForSGT(signInResult.walletAddress); // If both true, user is a verified owner of a Seeker device. return siwsVerified && hasSGT;}
WARNINGSGTs are transferrable between a user’s wallet, so you must verify uniqueness by checking the SGT’s unique mint address.For full details and best practices, see the Transferability documentation.
Gated Content: Restrict certain features or content to verified Seeker users.
Rewards Programs: Distribute exclusive rewards to Seeker owners.
Anti-Sybil Measures: Prevent multiple claims or actions per device.