Blockchain & Cryptocurrency Glossary

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

  • search-icon Clear Definitions
  • search-icon Practical
  • search-icon Technical
  • search-icon Related Terms

Application Binary Interface

1 min read
Pronunciation
[ap-li-kay-shun bi-när-ee in-ter-face]
Analogy
ABI is like a function signature file that tells you how to call methods in a library and interpret responses.
Definition
ABI: The standardized interface between smart contract bytecode and external callers, defining how to encode/decode function calls and events.
Key Points Intro
ABI specifications ensure interoperability by:
Key Points

Function selectors: First 4 bytes of calldata specify method.

Type encoding: Defines how to pack ints, strings, arrays.

Event logs: ABI describes log topics and data layout.

JSON schema: Human‑readable ABI files for tooling.

Example
Web3.js uses a contract’s ABI JSON to encode an "transfer(address,uint256)" call when sending ERC‑20 tokens.
Technical Deep Dive
ABI encoding follows the Ethereum spec: values are right‑aligned in 32‑byte slots. Dynamic types use head/tail pointers. The selector = first 4 bytes of keccak256(function signature). Decoding reverses the process using type definitions.
Security Warning
Incorrect ABI can lead to malformed calls and lost funds; always use the ABI provided by the contract author.
Caveat
ABI does not enforce access control—callers still need correct permissions in contract logic.

Application Binary Interface - Related Articles

No related articles for this term.