Base Verify Onchain

Policies & conditions

A policy is one provider plus one or more conditions. Base checks the user's credential against it before signing a verification. Operators: eq, gt, gte, lt, lte, in.

ProviderConditionTypeOperatorsExample
xfollowersinteq gt gte lt ltefollowers gte 1000
xverifiedbooleqverified eq true
xverified_typestringeqverified_type eq blue
coinbasecoinbase_one_activebooleqcoinbase_one_active eq true
coinbasecoinbase_one_billedbooleqcoinbase_one_billed eq true
instagramfollowers_countinteq gt gte lt ltefollowers_count gte 5000
instagramusernamestringequsername eq base
tiktokfollower_countinteq gt gte lt ltefollower_count gte 10000
tiktokfollowing_count / likes_count / video_countinteq gt gte lt ltevideo_count gte 50

Declaring a policy

Return the policy from your contract's provider() and conditions(). Each Condition is { name, op, value } as strings:

function provider() external pure override returns (string memory) { return "coinbase"; } function conditions() external pure override returns (Condition[] memory) { Condition[] memory c = new Condition[](1); c[0] = Condition("coinbase_one_active", "eq", "true"); return c; }

An unsupported provider, condition, or operator makes the API return 400 invalid_policy and no verification is issued.