{
  "$schema": "https://degreesofsatoshi.com/encyclopedia/schemas/article-v1.json",
  "schemaVersion": "1.0.0",
  "id": "function-selectors",
  "canonical": "https://degreesofsatoshi.com/encyclopedia/function-selectors/",
  "collection": "ethereum",
  "title": "Function selectors: the first four bytes of a contract call",
  "description": "Learn how Ethereum ABI function selectors are derived, why different signatures can collide and what a decoded method label can and cannot prove.",
  "aliases": [],
  "dates": {
    "published": "2026-10-02",
    "modified": "2026-10-02",
    "verified": "2026-10-02T18:12:41.505Z",
    "dataAsOf": "2026-10-02"
  },
  "authorship": {
    "publisher": "Degrees of Satoshi editorial project",
    "process": "AI-assisted research and drafting with a separate automated source-verification pass; no external expert or named human review is implied."
  },
  "quickAnswer": {
    "text": "A conventional Ethereum ABI function selector is the first four bytes of the Keccak-256 hash of the canonical function signature, such as its name and parameter types. It helps a contract dispatch a call. It is only 32 bits, so different signatures can collide; a selector lookup alone cannot establish the intended behavior.",
    "claimId": "function-selectors-quick-answer",
    "sourceIds": [
      "solidity-abi"
    ]
  },
  "keyFacts": [
    {
      "label": "Size",
      "value": "An ABI function selector is four bytes.",
      "sourceIds": [
        "solidity-abi"
      ],
      "id": "size",
      "claimId": "function-selectors-fact-size"
    },
    {
      "label": "Signature",
      "value": "The canonical signature includes parameter types, not parameter names.",
      "sourceIds": [
        "solidity-abi"
      ],
      "id": "signature",
      "claimId": "function-selectors-fact-signature"
    },
    {
      "label": "Returns",
      "value": "Return types are not part of the function selector.",
      "sourceIds": [
        "solidity-abi"
      ],
      "id": "returns",
      "claimId": "function-selectors-fact-returns"
    }
  ],
  "prerequisites": [
    "ethereum-calldata"
  ],
  "sections": [
    {
      "id": "signature",
      "heading": "Types matter, argument values do not",
      "sourceIds": [
        "solidity-abi"
      ],
      "paragraphs": [
        "The signature transfer(address,uint256) describes a method name and types. A particular recipient and amount belong in the arguments that follow the selector. Overloaded functions with different parameter types have different canonical signatures, though collisions remain possible.",
        "Canonical type spelling matters: ABI hashing uses the canonical form, such as uint256 rather than an informal shorthand."
      ]
    },
    {
      "id": "dispatch",
      "heading": "The destination decides what the bytes do",
      "sourceIds": [
        "solidity-abi",
        "oz-proxy"
      ],
      "paragraphs": [
        "A contract may dispatch on the selector, use a fallback path or delegate execution through a proxy. A method-name database provides a possible interpretation, not proof that the destination implements that method honestly.",
        "Pair the selector with the correct code, ABI and proxy implementation. Familiar names can be implemented with unfamiliar behavior."
      ]
    },
    {
      "id": "collision",
      "heading": "A short identifier cannot be globally unique",
      "sourceIds": [
        "solidity-abi"
      ],
      "paragraphs": [
        "Four bytes provide a finite identifier space. Different function signatures can map to the same selector, so a decoder may have several candidates.",
        "A wallet should not use a human-readable method label as its only authorization check. The actual target, arguments and resulting permissions remain material."
      ]
    }
  ],
  "faq": [
    {
      "question": "Do parameter names change a function selector?",
      "answer": "No. The canonical signature uses the function name and parameter types. Renaming a parameter without changing its type does not change that signature.",
      "sourceIds": [
        "solidity-abi"
      ]
    }
  ],
  "claims": [
    {
      "id": "function-selectors-quick-answer",
      "articleSlug": "function-selectors",
      "statement": "A conventional Ethereum ABI function selector is the first four bytes of the Keccak-256 hash of the canonical function signature, such as its name and parameter types. It helps a contract dispatch a call. It is only 32 bits, so different signatures can collide; a selector lookup alone cannot establish the intended behavior.",
      "sourceIds": [
        "source-6219cf92582a012d"
      ],
      "sourceLocators": [
        {
          "sourceId": "source-6219cf92582a012d",
          "locator": "Function Selector; Argument Encoding; Events; Errors; JSON"
        }
      ],
      "scope": {
        "collection": "ethereum",
        "dataAsOf": "2026-10-02",
        "blockHeight": null
      },
      "qualification": "",
      "evidenceStatus": "documented",
      "verification": {
        "status": "verified",
        "method": "independent automated source review",
        "checkedAt": "2026-10-02T18:12:41.505Z",
        "reviewer": "Codex independent automated reviewer /root/verify_ethereum_100",
        "notes": [
          "Read canonical signature definition: first four Keccak-256 bytes, function name plus canonical parameter types, no parameter names or return types.",
          "Four-byte collision limitation is a direct finite-identifier inference; ABI fallback and OpenZeppelin proxy dispatch support the destination-context caveat. No example selector constant is fabricated."
        ]
      }
    },
    {
      "id": "function-selectors-fact-size",
      "articleSlug": "function-selectors",
      "statement": "Size: An ABI function selector is four bytes.",
      "sourceIds": [
        "source-6219cf92582a012d"
      ],
      "sourceLocators": [
        {
          "sourceId": "source-6219cf92582a012d",
          "locator": "Function Selector; Argument Encoding; Events; Errors; JSON"
        }
      ],
      "scope": {
        "collection": "ethereum",
        "dataAsOf": "2026-10-02",
        "blockHeight": null
      },
      "qualification": "",
      "evidenceStatus": "documented",
      "verification": {
        "status": "verified",
        "method": "independent automated source review",
        "checkedAt": "2026-10-02T18:12:41.505Z",
        "reviewer": "Codex independent automated reviewer /root/verify_ethereum_100",
        "notes": [
          "Read canonical signature definition: first four Keccak-256 bytes, function name plus canonical parameter types, no parameter names or return types.",
          "Four-byte collision limitation is a direct finite-identifier inference; ABI fallback and OpenZeppelin proxy dispatch support the destination-context caveat. No example selector constant is fabricated."
        ]
      }
    },
    {
      "id": "function-selectors-fact-signature",
      "articleSlug": "function-selectors",
      "statement": "Signature: The canonical signature includes parameter types, not parameter names.",
      "sourceIds": [
        "source-6219cf92582a012d"
      ],
      "sourceLocators": [
        {
          "sourceId": "source-6219cf92582a012d",
          "locator": "Function Selector; Argument Encoding; Events; Errors; JSON"
        }
      ],
      "scope": {
        "collection": "ethereum",
        "dataAsOf": "2026-10-02",
        "blockHeight": null
      },
      "qualification": "",
      "evidenceStatus": "documented",
      "verification": {
        "status": "verified",
        "method": "independent automated source review",
        "checkedAt": "2026-10-02T18:12:41.505Z",
        "reviewer": "Codex independent automated reviewer /root/verify_ethereum_100",
        "notes": [
          "Read canonical signature definition: first four Keccak-256 bytes, function name plus canonical parameter types, no parameter names or return types.",
          "Four-byte collision limitation is a direct finite-identifier inference; ABI fallback and OpenZeppelin proxy dispatch support the destination-context caveat. No example selector constant is fabricated."
        ]
      }
    },
    {
      "id": "function-selectors-fact-returns",
      "articleSlug": "function-selectors",
      "statement": "Returns: Return types are not part of the function selector.",
      "sourceIds": [
        "source-6219cf92582a012d"
      ],
      "sourceLocators": [
        {
          "sourceId": "source-6219cf92582a012d",
          "locator": "Function Selector; Argument Encoding; Events; Errors; JSON"
        }
      ],
      "scope": {
        "collection": "ethereum",
        "dataAsOf": "2026-10-02",
        "blockHeight": null
      },
      "qualification": "",
      "evidenceStatus": "documented",
      "verification": {
        "status": "verified",
        "method": "independent automated source review",
        "checkedAt": "2026-10-02T18:12:41.505Z",
        "reviewer": "Codex independent automated reviewer /root/verify_ethereum_100",
        "notes": [
          "Read canonical signature definition: first four Keccak-256 bytes, function name plus canonical parameter types, no parameter names or return types.",
          "Four-byte collision limitation is a direct finite-identifier inference; ABI fallback and OpenZeppelin proxy dispatch support the destination-context caveat. No example selector constant is fabricated."
        ]
      }
    }
  ],
  "sources": [
    {
      "id": "solidity-abi",
      "label": "Contract ABI Specification",
      "publisher": "Solidity contributors",
      "url": "https://docs.soliditylang.org/en/v0.8.30/abi-spec.html",
      "locator": "Function Selector; Argument Encoding; Events; Errors; JSON",
      "note": "ABI encoding, selectors, event topics and event data.",
      "version": "Solidity 0.8.30 documentation",
      "checkedAt": "2026-10-02T17:03:42.824Z",
      "contentSha256": "f5889011070e9e83487b6fd899f56ccecd0c08382c998cd2f8860daafd27dc7b",
      "recordId": "source-6219cf92582a012d"
    },
    {
      "id": "oz-proxy",
      "label": "Proxy contracts",
      "publisher": "OpenZeppelin",
      "url": "https://docs.openzeppelin.com/contracts/5.x/api/proxy",
      "locator": "TransparentUpgradeableProxy; UUPSUpgradeable; ERC1967Proxy",
      "note": "Proxy implementation slots, delegated execution and upgrade authority.",
      "version": "OpenZeppelin Contracts 5.x",
      "checkedAt": "2026-10-02T17:03:43.024Z",
      "contentSha256": "58fe40b9eaa6d3cf92e48caed2d8db247a790b1a3055948095a48c7f8eb77854",
      "recordId": "source-16bb921e662a5173"
    }
  ],
  "related": {
    "articles": [
      "ethereum-contract-abis",
      "verified-contract-source",
      "contract-proxies"
    ],
    "dossiers": [],
    "wallets": []
  },
  "revisionHistory": [
    {
      "date": "2026-10-02",
      "kind": "published",
      "summary": "First publication after primary-source research and independent automated verification."
    }
  ],
  "citation": "Degrees of Satoshi editorial project. “Function selectors: the first four bytes of a contract call.” Published 2026-10-02; updated 2026-10-02. https://degreesofsatoshi.com/encyclopedia/function-selectors/"
}
