{"uid":"cap_RYAlWOaDU6hoFdVXoOp79","slug":"avasis-x402-eip-3009-authorization-check-f9f6f041","name":"Avasis x402 EIP-3009 Authorization Check","description":"x402 authorization check on Ethereum (chain 1, $0.02): the EIP-3009 authorization you will sign (from, to, value, validAfter, validBefore, nonce) + its 402 quote (payTo, amount, asset, network) -> SIGN/CAUTION/BLOCK: payTo / amount / asset / chain match, nonce unused, not expired, EIP-712 domain verified on-chain, look-alike USDC, balance, decoy >= $1, the digest you sign. Phrases: should I sign this, x402 authorization check, eip-3009, decoy quote. GET or POST JSON. Never charged on 4xx/5xx.","url":"https://agents.avasis.ai/v1/eth/authorization-check?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","required":["from","to","value","validBefore","nonce"],"properties":{"to":{"type":"string","description":"the recipient (authorization.to; must equal the quote's payTo) (0x + 40 hex)"},"from":{"type":"string","description":"the payer: the wallet that signs (authorization.from) (0x + 40 hex)"},"asset":{"type":"string","description":"the quote's accepts[].asset (token contract)"},"chain":{"type":"string","description":"optional; must be ethereum / 1 on this route"},"nonce":{"type":"string","description":"authorization.nonce: 32 random bytes (0x + 64 hex), one per payment"},"payTo":{"type":"string","description":"the quote's accepts[].payTo: sets matches.pay_to (BLOCK on mismatch)"},"value":{"type":"string","description":"authorization.value in atomic units (USDC has 6 decimals: 20000 = $0.02)"},"amount":{"type":"string","description":"the quote's accepts[].amount (v2) / maxAmountRequired (v1), atomic units: sets matches.amount"},"network":{"type":"string","description":"the quote's accepts[].network: base / eip155:8453 or ethereum / eip155:1"},"domainName":{"type":"string","description":"optional domain.name of the typed data (checked against the token's on-chain DOMAIN_SEPARATOR)"},"maxTimeout":{"type":"integer","minimum":1,"description":"the quote's accepts[].maxTimeoutSeconds: flags a validBefore longer than the seller asked for"},"validAfter":{"type":"string","description":"authorization.validAfter, unix seconds (default 0)"},"primaryType":{"type":"string","description":"TransferWithAuthorization or ReceiveWithAuthorization (default TransferWithAuthorization, the x402 exact scheme)"},"validBefore":{"type":"string","description":"authorization.validBefore, unix seconds (x402 clients set now + maxTimeoutSeconds)"},"domainChainId":{"type":"integer","minimum":1,"description":"optional domain.chainId of the typed data (must be this chain's)"},"domainVersion":{"type":"string","description":"optional domain.version of the typed data"},"verifyingContract":{"type":"string","description":"domain.verifyingContract: the token contract the typed data names (default USDC on this chain)"}},"additionalProperties":false}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","required":["chain","verdict","authorization","quote","token","domain","typed_data","digest","headline"],"properties":{"kind":{"type":"string"},"rail":{"type":"string"},"chain":{"type":"string"},"payer":{"type":"object"},"quote":{"type":"object"},"token":{"type":"object"},"digest":{"type":"object"},"domain":{"type":"object"},"pay_to":{"type":"object"},"verdict":{"type":"object"},"chain_id":{"type":"integer"},"headline":{"type":"string"},"typed_data":{"type":"object"},"block_number":{"type":"integer"},"authorization":{"type":"object"},"also_available":{"type":"object"},"block_timestamp":{"type":"integer"}}}}}}},"responseSchema":{"type":"json","example":{"kind":"authorization-check","rail":"x402-authorization-check-1","chain":"ethereum","payer":{"sufficient":true,"balance_raw":"16718740","balance_units":"16.71874"},"quote":{"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","given":true,"pay_to":"0x6264191d6dd5427435b5e829077842e130ef1fc8","matches":{"asset":true,"amount":true,"pay_to":true,"network":true},"network":"base","amount_raw":"20000","max_timeout_s":120},"reads":{"rpc":"fixture","calls":10,"elapsed_ms":5},"token":{"name":"USD Coin","symbol":"USDC","address":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","version":"2","decimals":6,"is_contract":true,"canonical_usdc":true,"domain_separator_onchain":"0x02fa7265e7c5d81118673727957699e4d68f74cd74b7db77da710fe8a2c7834f"},"digest":{"note":"eip712_digest = keccak256(0x1901 || domainSeparator || structHash): what eth_signTypedData_v4 signs; compare it with your wallet's prompt","struct_hash":"0x242f86ef909386979cd3fc1238cf25ad012e338444e5917a2f4dd32c1e1f829a","eip712_digest":"0xa5eb1a2bb1b6283c2e0b10f6fe4e68449fb7b157ae8956dc5fd00e35cfdcb420"},"domain":{"name":"USD Coin","version":"2","chain_id":8453,"expected":{"name":"USD Coin","version":"2","chain_id":8453,"separator":"0x02fa7265e7c5d81118673727957699e4d68f74cd74b7db77da710fe8a2c7834f"},"matches_onchain":true,"separator_computed":"0x02fa7265e7c5d81118673727957699e4d68f74cd74b7db77da710fe8a2c7834f","verifying_contract":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913"},"pay_to":{"address":"0x6264191d6dd5427435b5e829077842e130ef1fc8","is_contract":false},"verdict":{"sign":true,"level":"SIGN","reasons":[],"checks_ok":["payTo matches","amount matches","asset matches","network base matches","nonce unused","valid for 110 s","domain separator verified on-chain","canonical USDC","balance 16.71874 covers 0.02"]},"chain_id":1,"headline":"SIGN on Base: payTo matches, amount matches, asset matches, network base matches, nonce unused, valid for 110 s, domain separator verified on-chain, canonical USDC, balance 16.71874 covers 0.02","typed_data":{"types":{"EIP712Domain":[{"name":"name","type":"string"},{"name":"version","type":"string"},{"name":"chainId","type":"uint256"},{"name":"verifyingContract","type":"address"}],"TransferWithAuthorization":[{"name":"from","type":"address"},{"name":"to","type":"address"},{"name":"value","type":"uint256"},{"name":"validAfter","type":"uint256"},{"name":"validBefore","type":"uint256"},{"name":"nonce","type":"bytes32"}]},"domain":{"name":"USD Coin","chainId":8453,"version":"2","verifyingContract":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913"},"message":{"to":"0x6264191d6dd5427435b5e829077842e130ef1fc8","from":"0x8ec901f7e2710163387d70950f680f1ea2269d15","nonce":"0xa1b2c3d4a1b2c3d4a1b2c3d4a1b2c3d4a1b2c3d4a1b2c3d4a1b2c3d4a1b2c3d4","value":"20000","validAfter":"0","validBefore":"1793518925"},"primaryType":"TransferWithAuthorization"},"block_number":53364734,"authorization":{"to":"0x6264191d6dd5427435b5e829077842e130ef1fc8","from":"0x8ec901f7e2710163387d70950f680f1ea2269d15","nonce":"0xa1b2c3d4a1b2c3d4a1b2c3d4a1b2c3d4a1b2c3d4a1b2c3d4a1b2c3d4a1b2c3d4","window_s":1793518925,"valid_now":true,"value_raw":"20000","value_usd":0.02,"nonce_used":false,"valid_after":"0","value_units":"0.02","primary_type":"TransferWithAuthorization","valid_before":"1793518925","seconds_until_expiry":110},"block_timestamp":1793518815}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.02","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"down","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.02/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_sOiXWYRcaMiNHBrlWNL_p","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.02","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Validates an x402 EIP-3009 payment authorization before signing — checks payTo/amount/asset/network match, nonce freshness, expiry, on-chain EIP-712 domain separator, canonical USDC, and payer balance, then returns a SIGN/CAUTION/BLOCK verdict with the exact digest to sign.","exampleAgentPrompt":"Before I sign this x402 payment, check if this EIP-3009 authorization is safe: from 0xABC...123, to 0xDEF...456, value 20000, validBefore 1750000000, nonce 0xdeadbeef...cafe, with the quote showing payTo 0xDEF...456, amount 20000, asset 0xA0b8...eB48, network ethereum — tell me the verdict and show me the digest I'd be signing.","exampleUseCases":[{"title":"Pre-signing x402 payment safety check","prompt":"I'm about to sign an x402 payment authorization — from 0x1234...abcd, to 0x5678...efgh, value 20000 atomic USDC, validBefore 1750100000, nonce 0xaabbccdd...11223344, quote payTo 0x5678...efgh, amount 20000, asset 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48, network ethereum. Is it safe to sign? Give me the SIGN/CAUTION/BLOCK verdict and the EIP-712 digest."},{"title":"Detecting look-alike USDC in x402 quote","prompt":"Can you check whether the USDC token in this x402 quote is the real canonical USDC or a look-alike? The asset address is 0xFakeToken...0001, network ethereum, payTo 0xMerchant...9999, amount 50000, and my authorization has validBefore 1750200000 and nonce 0x0011223344556677889900aabbccddeeff001122334455667788990011223344."},{"title":"Verifying payer balance covers x402 payment","prompt":"Check if my wallet 0xMyWallet...7777 has enough USDC to cover a $0.02 x402 payment on Ethereum mainnet — the authorization is value 20000, validBefore 1751000000, nonce 0xffffffff...00000000, payTo 0xSeller...aaaa, asset 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48, amount 20000, network ethereum, and tell me if the domain separator matches on-chain."}],"resultDescription":"Returns a JSON object with: a top-level verdict object containing a level field (SIGN, CAUTION, or BLOCK), a boolean sign flag, an array of reasons/checks_ok, and a headline string; a quote object showing whether payTo/amount/asset/network match the authorization; a digest object with the struct_hash and eip712_digest the wallet will sign; a domain object showing whether the EIP-712 domain separator computed matches the on-chain value; a payer object with balance_raw and balance_units; a token object confirming canonical USDC and decimals; and a reads object with RPC call metadata.","failureModes":["Missing required fields (from, to, value, validBefore, nonce) → 4xx error, no charge","Invalid hex format for addresses or nonce → 4xx validation error","Unsupported chain (not Ethereum/chain 1 for this route) → 4xx error","RPC node unavailable for on-chain domain separator lookup → 5xx error, no charge","Authorization already expired (validBefore in the past) → BLOCK verdict returned, not an error","Nonce already used on-chain → BLOCK verdict","payTo/amount/asset mismatch → BLOCK verdict with reasons listed","Look-alike (non-canonical) USDC detected → CAUTION or BLOCK verdict","Insufficient payer balance → CAUTION or BLOCK verdict","Decoy/honeypot payment above $1 threshold detected → CAUTION or BLOCK"],"whenToPreferThis":"Use this endpoint when an AI agent is about to sign an EIP-3009 (TransferWithAuthorization or ReceiveWithAuthorization) authorization as part of an x402 payment flow on Ethereum mainnet and needs an independent pre-signing safety check. It is the right choice when you want on-chain verification of the EIP-712 domain separator (not just local computation), canonical USDC detection, nonce freshness confirmation, and balance sufficiency all in a single call. Prefer this over manual local validation when the agent cannot easily call Ethereum RPC methods itself or when you want an auditable SIGN/CAUTION/BLOCK verdict with the exact digest to compare against the wallet prompt.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-25T05:25:10.279Z","isFirstParty":false,"canonicalSlug":"avasis-x402-eip-3009-authorization-check-f9f6f041"}