{"openapi":"3.1.0","info":{"title":"Crypto Governance API","version":"1.0.0","description":"Static checks that compare a caller-supplied DAO proposal with the execution calls the caller supplies. The proposal description is not treated as the approved action list. No network calls are made. Paid with x402 exact USDC on Base. No account is required.","contact":{"email":"support@brainiac.software"},"x-guidance":"BRAINIAC.software is a pay-per-call API for software agents. No account or API key is required.\nPayment uses the x402 protocol with exact USDC on Base (chain id 8453). Each POST operation has a fixed USD price.\nHow to call an operation:\n1. POST JSON matching the requestBody. Invalid input returns 400 with no payment challenge.\n2. A valid unpaid call returns 402 with the exact amount and payTo.\n3. Pay and retry with payment-signature. Payment settles only if the operation returns 2xx. A 4xx/5xx is not charged.\nInclude an Idempotency-Key header of 64 hex characters from 32 random bytes. Reuse that key only for retries of the same operation and request body.\nAll outputs are compliance prechecks, drafts, or data lookups for human review. They are not official determinations, legal advice, identity confirmation, or certified filings. Verify time-sensitive or official data with the cited source before acting."},"servers":[{"url":"https://www.brainiac.software"}],"paths":{"/api/v1/crypto-governance/governance-execution-diff":{"post":{"operationId":"diff_governance_execution","summary":"Diff governance execution","description":"Compare the structured actions in a caller-supplied DAO proposal with the caller-supplied execution calls. Targets, selectors, decoded parameters, and native value are compared. execution_match is exact, partial, mismatch, or indeterminate. risk_level is low, medium, high, or critical. The proposal description is not treated as the approved action list. No chain is queried, and approval or execution is not inferred from chain state.","tags":["crypto-governance"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"proposal":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":120},"description":{"type":"string","maxLength":4000}},"required":["id"],"additionalProperties":false},"chainId":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647},"orderSensitive":{"type":"boolean"},"approvedActions":{"minItems":1,"maxItems":32,"type":"array","items":{"type":"object","properties":{"target":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$"},"signature":{"type":"string","pattern":"^[A-Za-z_][A-Za-z0-9_]*\\((?:[A-Za-z0-9_[\\],() ]{0,400})\\)$"},"functionName":{"type":"string","pattern":"^[A-Za-z_][A-Za-z0-9_]{0,79}$"},"calldata":{"type":"string","maxLength":131074,"pattern":"^0x(?:[0-9a-fA-F]{2})*$"},"value":{"type":"string"},"parameters":{"maxItems":32,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"type":{"type":"string","minLength":1,"maxLength":200},"value":{"type":"string","maxLength":2000}},"required":["name","value"],"additionalProperties":false}},"recipient":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$"},"token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$"},"amount":{"type":"string"},"spender":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$"}},"required":["target"],"additionalProperties":false}},"execution":{"type":"object","properties":{"transactionHash":{"type":"string","pattern":"^0x[0-9a-fA-F]{64}$"},"value":{"type":"string"},"calls":{"maxItems":32,"type":"array","items":{"type":"object","properties":{"target":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$"},"signature":{"type":"string","pattern":"^[A-Za-z_][A-Za-z0-9_]*\\((?:[A-Za-z0-9_[\\],() ]{0,400})\\)$"},"functionName":{"type":"string","pattern":"^[A-Za-z_][A-Za-z0-9_]{0,79}$"},"calldata":{"type":"string","maxLength":131074,"pattern":"^0x(?:[0-9a-fA-F]{2})*$"},"value":{"type":"string"},"parameters":{"maxItems":32,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"type":{"type":"string","minLength":1,"maxLength":200},"value":{"type":"string","maxLength":2000}},"required":["name","value"],"additionalProperties":false}},"recipient":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$"},"token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$"},"amount":{"type":"string"},"spender":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$"}},"required":["target"],"additionalProperties":false}},"logs":{"maxItems":40,"type":"array","items":{"type":"object","properties":{"address":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$"},"topics":{"maxItems":4,"type":"array","items":{"type":"string","pattern":"^0x[0-9a-fA-F]{64}$"}},"data":{"type":"string","maxLength":131074,"pattern":"^0x(?:[0-9a-fA-F]{2})*$"},"fields":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":80},"additionalProperties":{"type":"string","maxLength":2000}}},"additionalProperties":false}}},"additionalProperties":false},"fieldMapping":{"type":"object","properties":{"target":{"type":"string","minLength":1,"maxLength":80},"signature":{"type":"string","minLength":1,"maxLength":80},"functionName":{"type":"string","minLength":1,"maxLength":80},"recipient":{"type":"string","minLength":1,"maxLength":80},"amount":{"type":"string","minLength":1,"maxLength":80},"spender":{"type":"string","minLength":1,"maxLength":80},"value":{"type":"string","minLength":1,"maxLength":80}},"additionalProperties":false},"abi":{"maxItems":48,"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["function","constructor","receive","fallback","event","error"]},"name":{"type":"string","maxLength":80},"stateMutability":{"type":"string","enum":["pure","view","nonpayable","payable"]},"inputs":{"maxItems":32,"type":"array","items":{"$ref":"#/$defs/__schema0"}},"outputs":{"maxItems":32,"type":"array","items":{"$ref":"#/$defs/__schema0"}},"anonymous":{"type":"boolean"}},"required":["type"],"additionalProperties":false}}},"required":["proposal","approvedActions","execution"],"additionalProperties":false,"$defs":{"__schema0":{"type":"object","properties":{"name":{"type":"string","maxLength":80},"type":{"type":"string","minLength":1,"maxLength":200},"internalType":{"type":"string","maxLength":200},"indexed":{"type":"boolean"},"components":{"maxItems":32,"type":"array","items":{"$ref":"#/$defs/__schema0"}}},"required":["type"],"additionalProperties":false}}},"example":{"proposal":{"id":"42","description":"Send 1 USDC to the grants wallet."},"chainId":8453,"orderSensitive":false,"approvedActions":[{"target":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","signature":"transfer(address,uint256)","calldata":"0xa9059cbb000000000000000000000000111111111111111111111111111111111111111100000000000000000000000000000000000000000000000000000000000f4240","value":"0","recipient":"0x1111111111111111111111111111111111111111","amount":"1000000"},{"target":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","signature":"approve(address,uint256)","calldata":"0x095ea7b300000000000000000000000033333333333333333333333333333333333333330000000000000000000000000000000000000000000000000000000000000005","value":"0","spender":"0x3333333333333333333333333333333333333333","amount":"5"}],"execution":{"transactionHash":"0xbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb","calls":[{"target":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","calldata":"0xa9059cbb000000000000000000000000222222222222222222222222222222222222222200000000000000000000000000000000000000000000000000000000000f4240","value":"0"},{"target":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","calldata":"0xa9059cbb00000000000000000000000044444444444444444444444444444444444444440000000000000000000000000000000000000000000000000000000000000001","value":"0"}]},"abi":[{"type":"function","name":"transfer","stateMutability":"nonpayable","inputs":[{"name":"to","type":"address"},{"name":"amount","type":"uint256"}],"outputs":[{"type":"bool"}]},{"type":"function","name":"approve","stateMutability":"nonpayable","inputs":[{"name":"spender","type":"address"},{"name":"amount","type":"uint256"}],"outputs":[{"type":"bool"}]}]}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Fresh random 32-byte value encoded as 64 hexadecimal characters. Reuse unchanged only for retries of the same operation and request.","schema":{"type":"string","pattern":"^[0-9a-fA-F]{64}$"}}],"responses":{"200":{"description":"Illustrative endpoint-specific JSON response shape. Conditional fields depend on the result and data-source availability.","content":{"application/json":{"schema":{"type":"object","properties":{"execution_match":{"type":"string"},"risk_level":{"type":"string"},"approved_actions":{"type":"array","items":{"type":"object","properties":{"index":{"type":"number"},"target":{"type":"string"},"selector":{"type":"string"},"function_name":{"type":"string"},"value":{"type":"string"},"parameters":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"},"value":{"type":"string"}},"additionalProperties":true}},"decoded":{"type":"string"}},"additionalProperties":true}},"executed_actions":{"type":"array","items":{"type":"object","properties":{"index":{"type":"number"},"target":{"type":"string"},"selector":{"type":"string"},"function_name":{"type":"string"},"value":{"type":"string"},"parameters":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"},"value":{"type":"string"}},"additionalProperties":true}},"decoded":{"type":"string"}},"additionalProperties":true}},"unexpected_actions":{"type":"array","items":{"type":"object","properties":{"index":{"type":"number"},"target":{"type":"string"},"selector":{"type":"string"},"function_name":{"type":"string"},"value":{"type":"string"},"parameters":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"},"value":{"type":"string"}},"additionalProperties":true}},"decoded":{"type":"string"}},"additionalProperties":true}},"missing_actions":{"type":"array","items":{"type":"object","properties":{"index":{"type":"number"},"target":{"type":"string"},"selector":{"type":"string"},"function_name":{"type":"string"},"value":{"type":"string"},"parameters":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"},"value":{"type":"string"}},"additionalProperties":true}},"decoded":{"type":"string"}},"additionalProperties":true}},"parameter_differences":{"type":"array","items":{"type":"object","properties":{"action_index":{"type":"number"},"executed_index":{"type":"number"},"name":{"type":"string"},"expected":{"type":"string"},"actual":{"type":"string"}},"additionalProperties":true}},"findings":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"severity":{"type":"string"},"action_index":{"type":"number"},"detail":{"type":"string"}},"additionalProperties":true}},"limitations":{"type":"array","items":{"type":"string"}}},"additionalProperties":true},"example":{"execution_match":"mismatch","risk_level":"critical","approved_actions":[{"index":0,"target":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","selector":"0xa9059cbb","function_name":"transfer","value":"0","parameters":[{"name":"to","type":"address","value":"0x1111111111111111111111111111111111111111"},{"name":"amount","type":"uint256","value":"1000000"}],"decoded":"abi"},{"index":1,"target":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","selector":"0x095ea7b3","function_name":"approve","value":"0","parameters":[{"name":"spender","type":"address","value":"0x3333333333333333333333333333333333333333"},{"name":"amount","type":"uint256","value":"5"}],"decoded":"abi"}],"executed_actions":[{"index":0,"target":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","selector":"0xa9059cbb","function_name":"transfer","value":"0","parameters":[{"name":"to","type":"address","value":"0x2222222222222222222222222222222222222222"},{"name":"amount","type":"uint256","value":"1000000"}],"decoded":"abi"},{"index":1,"target":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","selector":"0xa9059cbb","function_name":"transfer","value":"0","parameters":[{"name":"to","type":"address","value":"0x4444444444444444444444444444444444444444"},{"name":"amount","type":"uint256","value":"1"}],"decoded":"abi"}],"unexpected_actions":[{"index":1,"target":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","selector":"0xa9059cbb","function_name":"transfer","value":"0","parameters":[{"name":"to","type":"address","value":"0x4444444444444444444444444444444444444444"},{"name":"amount","type":"uint256","value":"1"}],"decoded":"abi"}],"missing_actions":[{"index":1,"target":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","selector":"0x095ea7b3","function_name":"approve","value":"0","parameters":[{"name":"spender","type":"address","value":"0x3333333333333333333333333333333333333333"},{"name":"amount","type":"uint256","value":"5"}],"decoded":"abi"}],"parameter_differences":[{"action_index":0,"executed_index":0,"name":"to","expected":"0x1111111111111111111111111111111111111111","actual":"0x2222222222222222222222222222222222222222"}],"findings":[{"code":"parameter_difference","severity":"critical","action_index":0,"detail":"Parameter to does not match the approved action."},{"code":"missing_action","severity":"high","action_index":1,"detail":"An approved action has no executed call with the same target and function."},{"code":"unexpected_action","severity":"critical","action_index":1,"detail":"An executed call does not match an approved action."}],"limitations":["Only the approved actions and execution records in this request were compared. Proposal approval and execution were not read from a chain.","The proposal description was not treated as the approved action list.","Chain ID was not checked against a network, and no transaction is treated as final.","A function is decoded from the caller ABI, or from the standard ERC-20 transfer, transferFrom, approve, and increaseAllowance selectors when no ABI is supplied.","Action order was not treated as a difference because orderSensitive was not true.","The proposal description was not compared. Only the structured actions were compared."]}}}},"400":{"description":"Invalid JSON or request schema."},"402":{"description":"Payment required. The JSON body is the x402 PaymentRequired object: x402Version, resource with the operation description, accepts with the price and network, and extensions.bazaar with the input schema, input example, output schema, and output example."},"409":{"description":"Idempotency conflict, in-progress payment, or expired result cache. Reusing the key cannot trigger a second charge."},"413":{"description":"Request body exceeds the 24 MB limit."},"500":{"description":"Operation failed before settlement, so no payment is taken. Reuse the same idempotency key to retrieve the stored error without paying again."},"503":{"description":"Payment or retry-safe result storage is unavailable; the operation is not run."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.05"},"protocols":[{"x402":{"facilitator":"https://api.cdp.coinbase.com/platform/v2/x402"}}],"facilitator":"https://api.cdp.coinbase.com/platform/v2/x402"}}},"/api/v1/crypto-governance/execution-risk-score":{"post":{"operationId":"score_governance_execution_drift","summary":"Score governance execution drift","description":"Apply caller-supplied transfer and transferFrom calls to the supplied token balances. A transfer that is not in the expected list is unforeseen. The drift index is the share of balances that change. Amounts stay inside the local integer limit. This is not an EVM simulation and no chain is queried.","tags":["crypto-governance"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"sender":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$"},"calls":{"minItems":1,"maxItems":40,"type":"array","items":{"type":"object","properties":{"target":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$"},"data":{"type":"string","maxLength":20000,"pattern":"^0x[0-9a-fA-F]*$"},"value":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["target","data"],"additionalProperties":false}},"balances":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$|^native$"},"account":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$"},"amount":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["token","account","amount"],"additionalProperties":false}},"expected":{"maxItems":40,"type":"array","items":{"type":"object","properties":{"token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$|^native$"},"to":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$"},"amount":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["token","to","amount"],"additionalProperties":false}}},"required":["sender","calls","balances"],"additionalProperties":false},"example":{"sender":"0x1111111111111111111111111111111111111111","balances":[{"token":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","account":"0x1111111111111111111111111111111111111111","amount":2000000},{"token":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","account":"0x4444444444444444444444444444444444444444","amount":500}],"expected":[{"token":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","to":"0x2222222222222222222222222222222222222222","amount":1000000}],"calls":[{"target":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","data":"0xa9059cbb000000000000000000000000222222222222222222222222222222222222222200000000000000000000000000000000000000000000000000000000000f4240"},{"target":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","data":"0xa9059cbb00000000000000000000000033333333333333333333333333333333333333330000000000000000000000000000000000000000000000000000000000000001"}]}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Fresh random 32-byte value encoded as 64 hexadecimal characters. Reuse unchanged only for retries of the same operation and request.","schema":{"type":"string","pattern":"^[0-9a-fA-F]{64}$"}}],"responses":{"200":{"description":"Illustrative endpoint-specific JSON response shape. Conditional fields depend on the result and data-source availability.","content":{"application/json":{"schema":{"type":"object","properties":{"execution_risk_score":{"type":"number"},"state_drift_index":{"type":"number"},"unforeseen_transfers_detected":{"type":"boolean"}},"additionalProperties":true},"example":{"execution_risk_score":25,"state_drift_index":75,"unforeseen_transfers_detected":true}}}},"400":{"description":"Invalid JSON or request schema."},"402":{"description":"Payment required. The JSON body is the x402 PaymentRequired object: x402Version, resource with the operation description, accepts with the price and network, and extensions.bazaar with the input schema, input example, output schema, and output example."},"409":{"description":"Idempotency conflict, in-progress payment, or expired result cache. Reusing the key cannot trigger a second charge."},"413":{"description":"Request body exceeds the 24 MB limit."},"500":{"description":"Operation failed before settlement, so no payment is taken. Reuse the same idempotency key to retrieve the stored error without paying again."},"503":{"description":"Payment or retry-safe result storage is unavailable; the operation is not run."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.04"},"protocols":[{"x402":{"facilitator":"https://api.cdp.coinbase.com/platform/v2/x402"}}],"facilitator":"https://api.cdp.coinbase.com/platform/v2/x402"}}}},"components":{"schemas":{"ApiError":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}}}}}}}}