{"uid":"cap_efB1IcnNRI-MdWJQ0Pq0z","slug":"4-byte-function-selector-decoder-4dc1340a","name":"4-Byte Function Selector Decoder","description":"Resolves a 4-byte function selector (e.g. 0x70a08231) to candidate human-readable signatures via 4byte.directory. Accepts a bare selector or full calldata.","url":"https://402.com.tr/api/x402/decode-selector","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"},"pathParams":{"type":"object"},"queryParams":{"type":"object","required":["selector"],"properties":{"selector":{"type":"string","description":"Function selector"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.01","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":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.01/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_lOD6O6dsQ7909koE6EhoW","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.01","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Resolves a 4-byte Ethereum function selector or calldata prefix to candidate human-readable ABI function signatures via 4byte.directory","exampleAgentPrompt":"What function does the Ethereum selector 0xa9059cbb map to? Decode it and give me the matching ABI signatures.","exampleUseCases":[{"title":"Decode mystery calldata in a transaction","prompt":"I'm looking at an on-chain transaction and the calldata starts with 0x23b872dd — what Solidity function is being called?"},{"title":"Identify unknown contract method","prompt":"Can you figure out what function the selector 0x095ea7b3 represents? I need to understand what this smart contract interaction does."},{"title":"Audit raw calldata before signing","prompt":"Before I approve this transaction, can you decode the 4-byte selector 0x42842e0e and tell me what function it maps to so I know what I'm signing?"}],"resultDescription":"Returns one or more candidate human-readable Solidity function signatures (e.g. 'transfer(address,uint256)') that match the given 4-byte selector, sourced from the 4byte.directory registry. Multiple candidates may be returned if hash collisions exist.","failureModes":["Selector not found in 4byte.directory database — returns empty results for novel or obscure functions","Invalid selector format (non-hex, wrong length) — returns 400 error","Network or upstream 4byte.directory unavailability — returns 5xx error","Hash collision returns multiple conflicting signatures — caller must disambiguate from context"],"whenToPreferThis":"Use this endpoint when you have a raw 4-byte function selector or calldata from an Ethereum transaction and need to identify the human-readable function name and signature. Prefer this over manual ABI lookups when the contract ABI is unavailable, or when auditing unknown transactions before signing. It is the fastest path from raw calldata to a readable function name.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T12:55:07.499Z","isFirstParty":false}