A contract says it supports an interface. An app shows a tick. It is tempting to read that as “this thing works.” The answer is narrower.
ERC-165 gives software a common question to ask: does this contract report support for a particular interface? The supportsInterface(bytes4) answer helps an app choose a compatible route. It does not inspect every function behind that route or establish that using it is safe.
Think of a venue listing an accessible entrance. The listing helps you find the entrance; it is not an inspection of the building. For contracts, the distinction is between a declaration and demonstrated behavior.
What supportsInterface actually asks
The ERC-165 specification defines a function receiving a four-byte interface identifier and returning a Boolean. Its own interface ID is 0x01ffc9a7. A compliant implementation must reject the reserved invalid ID 0xffffffff.
The standard detection procedure uses a STATICCALL with a 30,000-gas budget. It first checks the ERC-165 ID, expecting true, then the invalid ID, expecting false. A failed first or second call, or the wrong Boolean at either step, fails that detection procedure. Only then does a query for the desired interface have the intended context.
This does not mean “every contract without ERC-165 is unusable.” It means this discovery route has not established support. Another interface or an older contract can need a different integration method.
A function selector and an interface ID are different things
The Solidity ABI specification assigns the first four bytes of call data to the function selector. Encoded arguments follow it. A selector is derived from the function name and canonical parameter types using Keccak-256; return types are excluded.
In a supportsInterface request, keep two fields separate:
- Which function is being called: the selector for
supportsInterface(bytes4). - Which interface is being asked about: the
bytes4argument supplied to that function.
The second field is not a contract address, token ID or transaction hash. Four bytes give it eight hexadecimal digits after 0x.
For the ERC-165 self-check, the selector and argument happen to be the same value, 0x01ffc9a7. That coincidence can hide their different jobs. Asking about another interface changes the argument, not the function you call.
A small, invented interface makes the arithmetic visible
Suppose a fictional interface X contains two functions. For this arithmetic exercise, assign their selectors the invented values 0x11111111 and 0x22222222. These are supplied numbers, not calculated selectors for named Solidity functions or a registered real interface.
ERC-165 combines an interface's selectors with bitwise XOR:
0x11111111
XOR 0x22222222
= 0x33333333
Each hexadecimal digit here combines 1 XOR 2 to produce 3. The result stays four bytes. It is not a sum, an address or a fingerprint of the implementation's bytecode.
For a real Solidity interface, the compiler's type(I).interfaceId uses selectors defined in that interface itself, excluding inherited functions. Do not build a different identifier by casually collecting every function visible in a contract's ABI. An extension and its parent can need separate interface queries.
Now place 0x33333333 in the argument field of our fictional query. The first four bytes still select supportsInterface; the following ABI word carries the interface ID, right-padded with zeros because it is a fixed-size byte value:
function selector:
01ffc9a7
argument word (32 bytes):
33333333000000000000000000000000
00000000000000000000000000000000
The two printed lines of the argument are consecutive 16-byte halves of one word; join them without a space or line break to recover its bytes. The two fields total 4 + 32 = 36 bytes. These lines are a labelled encoding illustration, not an RPC command, deployed contract test or invitation to connect a wallet. ABI return data has a separate encoding; a declared Boolean is not a four-byte interface ID coming back.
Three hypothetical answers, one limited conclusion
Assume fictional contract C produces the following correctly encoded responses, and that each call succeeds within the specified gas budget. Nothing here was queried on a network.
| Step | Query ID | Reply | Meaning |
|---|---|---|---|
| 1 | 0x01ffc9a7 | true | C reports support for ERC-165 |
| 2 | 0xffffffff | false | C rejects the reserved invalid ID |
| 3 | 0x33333333 | true | C reports support for our invented interface X |
The first two responses satisfy the detection sequence. The third supplies the requested declaration. We have not invoked either invented function behind X, checked permissions, inspected state changes or tested failure cases.
To see the evidence gap, imagine changing only C's internal response table so it returns those same answers while one of X's functions always fails. The query transcript would look identical. Such a contract would not honestly implement X, but its affirmative response alone would not expose the problem. This is a logical counterexample, not a claim about an existing project.
A four-byte identifier also leaves out information that an integrator may care about. Because selectors exclude return types, the ID cannot by itself describe all expected output semantics. The relevant standard and actual implementation still matter.
Checked and unchecked helpers have different starting points
OpenZeppelin Contracts 5.x's ERC165Checker documentation distinguishes its helpers. supportsInterface(account, interfaceId) checks support for ERC-165 automatically. supportsERC165InterfaceUnchecked assumes the account already supports ERC-165; the documentation says its behavior is undefined if that precondition is not met.
It also warns that some precompiled contracts can falsely indicate interface support through the unchecked helper. A method name ending in “Unchecked” is therefore useful information about the caller's responsibilities, not a shortcut to stronger evidence.
This describes the documented library API, not the integration used by an unnamed wallet, marketplace or explorer. We have not examined any such application's code.
Read the badge, then ask the next question
If an app labels a contract “supported,” look for what it actually checked:
- The target: which network and full contract address were queried? A familiar name cannot identify the target; see Brokzi's network and contract-address explainer.
- The question: which interface ID was supplied, and were the ERC-165 control queries performed?
- The result: was there a valid response, a negative declaration, or a failed call? Those are different observations.
- The remaining evidence: which implementation behavior and permissions have actually been examined beyond the declaration?
An NFT's ownership model is a separate question, covered in ERC-721 versus ERC-1155. A contract wallet's acceptance of a particular signature is another, covered in ERC-1271 signature validation. Neither question is answered by treating a generic interface badge as a certificate.
ERC-165 is useful precisely because the question is small. Keep the answer attached to that question, and leave claims about behavior or safety to evidence that actually examines them.
Sources
Primary documentation checked November 3, 2026. The complete current ERC-165 specification was read, including its control queries, test cases, implementation examples and version history. Solidity's moving latest documentation and OpenZeppelin's 5.x API were checked as reference documentation; no claim is made about a particular deployed library version.
Contract C, interface X, its selector values and its response transcript are invented. The hexadecimal arithmetic and byte lengths were checked locally. No RPC request, live contract call, contract deployment, wallet connection, signature, approval, transaction or security audit was performed. The artwork is a fictional mechanism illustration.
See something wrong? Brokzi logs material changes. Prepare a correction note.




