3.3 Verifying Access Entitlements

The Verification API

Service providers use a simplified read-only function on the Faceet contract for verification.

// Pseudocode for API Gateway Check
function checkAccess(agentWalletAddress, apiTargetHash) {
    const isValid = FaceetContract.call('isValidCertificate', [agentWalletAddress, apiTargetHash]);
    if (isValid) {
        return 200; // Access Granted
    } else {
        return 402; // Payment Required
    }
}

Benefit: This single on-chain call is significantly faster and more reliable than traditional database lookups and API key validation.

Last updated