---
eip: 2069
label: EIP-2069
title: Recommendation for using YAML ABI in ERCs/EIPs
status: Stagnant
type: Informational
created: 2017-02-11
official: https://eips.ethereum.org/EIPS/eip-2069
source: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-2069.md
canonical: https://eips.huatuo.xyz/eip-2069/
lang: en
tldr: An informational recommendation that EIPs and ERCs describe contract interfaces as YAML-formatted ABI, which is language-neutral like JSON but allows comments, instead of as Solidity code.
tags: [abi, yaml, specification, process, informational]
---

# EIP-2069: Recommendation for using YAML ABI in ERCs/EIPs

> Recommendation for including contract ABI descriptions in EIPs and ERCs as YAML.

**TL;DR:** An informational recommendation that EIPs and ERCs describe contract interfaces as YAML-formatted ABI, which is language-neutral like JSON but allows comments, instead of as Solidity code.

## What problem does it solve?

Most interface standards, such as [ERC-20](/eip-20/), present their API as a Solidity `interface`. The author points out three drawbacks:

- It favours one language and can disadvantage others (Vyper, Fe, hand-written bytecode, off-chain tooling).
- It ties the spec to a particular Solidity version and syntax, which changes over time.
- Solidity can express things that do not map cleanly onto the ABI, which puts other languages at a further disadvantage.

The neutral description of a contract interface is the **Contract ABI**, normally written as JSON. But JSON cannot contain comments, and a specification needs explanations next to each function.

## How it works

The recommendation is simple: write the ABI in **YAML**. YAML is a superset of JSON, so the content is the same ABI that compilers and libraries already understand, and converting between the two is mechanical. Unlike JSON, YAML allows `#` comments, so authors can document each function inline.

Authors are encouraged to add comments to the YAML ABI. The allowed fields and values are exactly those in the Solidity Contract ABI specification; this EIP does not invent a new description language. The spec points to `yamabi`, a JavaScript tool for converting between YAML and JSON ABI.

## Sample code

The spec's example, a `transfer` function in YAML:

```yaml
# The transfer function. Takes the recipient address
# as an input and returns a boolean signaling the result.
- name: transfer
  type: function
  stateMutability: nonpayable
  inputs:
  - name: recipient
    type: address
  - name: amount
    type: uint256
  outputs:
  - name: ''
    type: bool
```

Loading it into ethers v6 (any YAML parser works; the result is a normal JSON ABI):

```ts
import { readFileSync } from "node:fs";
import { parse } from "yaml";
import { Interface } from "ethers";

const abi = parse(readFileSync("transfer.abi.yaml", "utf8"));
const iface = new Interface(abi);
console.log(iface.getFunction("transfer")!.selector); // "0xa9059cbb"
```

## Things to know

- Status is **Stagnant**. It is an Informational recommendation, not a requirement, and in practice most ERCs still present interfaces in Solidity.
- The spec's YAML example also includes the legacy `payable` and `constant` fields; current ABI output uses `stateMutability` alone, which is why they are omitted above.
- Comments are dropped when converting YAML to JSON, so keep the YAML file as the documented source of truth.


---

This is an unofficial plain-language summary. Read the full specification: https://eips.ethereum.org/EIPS/eip-2069
