{"uid":"cap_PocE1lKN0xQSFsLlF5p6Q","slug":"brainiac-contract-bytecode-structure-diff-4ae39f55","name":"BRAINIAC Contract Bytecode Structure Diff","description":"Pay-per-call APIs for AI agents: OFAC sanctions screening, compliance checks, token security, and Base chain data via x402. No account. Fixed USDC price. MCP-ready.","url":"https://www.brainiac.software/api/v1/contract-security/bytecode-structure-diff?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"left":{"anyOf":[{"type":"string","pattern":"^(0x)?[0-9a-fA-F]*$","maxLength":200000},{"type":"object","required":["ops"],"properties":{"ops":{"type":"array","items":{"type":"object","required":["op"],"properties":{"op":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9]{0,31}$"},"arg":{"type":"string","pattern":"^(0x)?[0-9a-fA-F]{0,64}$"}},"additionalProperties":false},"maxItems":1500,"minItems":1}},"additionalProperties":false}]},"right":{"anyOf":[{"type":"string","pattern":"^(0x)?[0-9a-fA-F]*$","maxLength":200000},{"type":"object","required":["ops"],"properties":{"ops":{"type":"array","items":{"type":"object","required":["op"],"properties":{"op":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9]{0,31}$"},"arg":{"type":"string","pattern":"^(0x)?[0-9a-fA-F]{0,64}$"}},"additionalProperties":false},"maxItems":1500,"minItems":1}},"additionalProperties":false}]}}},"responseSchema":{"type":"json","example":{"risk_delta_score":71,"similarity_index":86,"divergence_points":[{"kind":"immediate","left":"PUSH1 01","index":0,"right":"PUSH1 02"},{"kind":"length","left":"3","index":3,"right":"4"}]}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.04","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.04/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.04","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.04","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_o3i9YR4v1C_PMR-vLeIY4","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.04","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Compares two EVM smart contract bytecodes side-by-side, returning a risk delta score, similarity index, and precise opcode-level divergence points.","exampleAgentPrompt":"Diff these two Ethereum contract bytecodes for me and tell me the similarity index, risk delta score, and exactly where they diverge at the opcode level: left is 0x6001600101... and right is 0x6002600101...","exampleUseCases":[{"title":"Contract upgrade security audit","prompt":"I'm about to approve a governance upgrade for our DeFi protocol — can you compare the old contract bytecode 0x6001... with the new deployment 0x6002... and tell me the similarity score, risk delta, and every opcode-level change between them?"},{"title":"Detecting malicious contract clone","prompt":"Someone deployed a contract that claims to be a fork of our token contract — compare our original bytecode 0xABCD... with theirs 0xABCE... and show me the divergence points and how risky the differences are."},{"title":"Verifying reproducible deployment","prompt":"We want to confirm our contract was deployed without tampering — diff the bytecode from our compiler output against what's actually on-chain and give me the similarity index and any divergences found."}],"resultDescription":"Returns a JSON object with: risk_delta_score (0–100 integer indicating how much the security risk profile changed between the two bytecodes), similarity_index (0–100 integer percentage of structural similarity), and divergence_points (array of objects each specifying kind of divergence such as 'immediate' or 'length', the left and right opcode or value, and the index position).","failureModes":["Invalid hex string input (non-hex characters) returns validation error","Bytecode exceeding 200,000 character limit rejected","Opcode array exceeding 1,500 items rejected","Malformed opcode object missing required 'op' field returns schema error","Payment failure via x402 returns 402 Payment Required","Empty bytecode strings may return degenerate similarity scores"],"whenToPreferThis":"Use this endpoint when you need opcode-level structural diffing of two EVM smart contracts with a quantified risk delta — particularly during contract upgrade audits, clone detection, or deployment verification. Prefer this over simple hash comparison when you need to understand exactly where and how bytecodes differ, and what security implication those differences carry.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-13T18:47:21.152Z","isFirstParty":false,"canonicalSlug":"brainiac-contract-bytecode-structure-diff-4ae39f55"}