What is ABI (Application Binary Interface)?

1 min read Updated

An ABI (Application Binary Interface) is a JSON specification that defines how to interact with a smart contract — describing its functions, parameters, return types, and events in a machine-readable format.

WHY IT MATTERS

ABIs are the API documentation of smart contracts. They tell your code what functions a contract has, what parameters they accept, and what they return. Without the ABI, you can't interact with a contract programmatically (beyond raw byte manipulation).

When you deploy a Solidity contract, the compiler generates the ABI alongside the bytecode. The ABI includes function signatures, input/output parameter types, event definitions, and error types.

For agent developers, ABIs are essential — they define how an agent calls contract functions. Libraries like ethers.js and viem use ABIs to encode function calls and decode return values automatically.

FREQUENTLY ASKED QUESTIONS

Where do I get a contract's ABI?
From the compiler output, block explorers (Etherscan for verified contracts), or project documentation. If the contract isn't verified, you can sometimes reverse-engineer a partial ABI.
What's ABI encoding?
The process of converting function calls and parameters into the byte format that the EVM expects. Libraries handle this automatically using the ABI spec.
Do I need the full ABI?
No. You only need the ABI entries for functions you want to call. Partial ABIs work fine for reading specific functions or emitting specific events.

FURTHER READING

Enforce policies on every tool call

Intercept is the open-source MCP proxy that enforces YAML policies on AI agent tool calls. No code changes needed.

npx -y @policylayer/intercept
github.com/policylayer/intercept →
// GET IN TOUCH

Have a question or want to learn more? Send us a message.

Message sent.

We'll get back to you soon.