Introduction

Hi, I'm cardene, a software engineer and technical writer focused on blockchain and AI.

I've also authored Japanese technical books on specification-driven development with LLMs and decentralized application (DApp) development.

I also build and publish a variety of tools, libraries, and open-source projects.

This article examines ERC-5679, a proposal to standardize how tokens compliant with ERC-20, ERC-721, and ERC-1155 are minted and burned.

This explanation translates, summarizes, and expands on the following specification.

Motivation

Minting and burning tokens are common operations in ERC-20, ERC-721, and ERC-1155. This proposal defines consistent interfaces for these operations and establishes a basic token lifecycle.

Some ERC-721 and ERC-1155 implementations use transfer-related mechanisms for minting and burning. However, minting and burning change the token supply.

Minting increases the supply.

Burning decreases the supply.

Access control for minting and burning is generally different from that for ordinary transfers. Standardized interfaces can simplify implementation and reduce security errors.

Specification

ERC-20

An ERC-20 contract implementing this extension provides the following interface.

For an explanation of interfaces, see the following reference.

https://chaldene.net/erc721#st-toc-h-5

javascript
interface IERC5679Ext20 {
   function mint(address _to, uint256 _amount, bytes calldata _data) external;
   function burn(address _from, uint256 _amount, bytes calldata _data) external;
}

ERC-721

An ERC-721 contract implementing this extension provides the following interface.

javascript
interface IERC5679Ext721 {
   function safeMint(address _to, uint256 _id, bytes calldata _data) external;
   function burn(address _from, uint256 _id, bytes calldata _data) external;
}

ERC-1155

An ERC-1155 contract implementing this extension provides the following interface.

javascript
interface IERC5679Ext1155 {
   function safeMint(address _to, uint256 _id, uint256 _amount, bytes calldata _data) external;
   function safeMintBatch(address to, uint256[] calldata ids, uint256[] calldata amounts, bytes calldata data) external;
   function burn(address _from, uint256 _id, uint256 _amount, bytes[] calldata _data) external;
   function burnBatch(address _from, uint256[] calldata ids, uint256[] calldata amounts, bytes calldata _data) external;
}

Additional Specification Details

  • Minting tokens

    For ERC-20 and ERC-1155, the amount is specified by _amount. For ERC-721 and ERC-1155, the token ID is specified by _id. Minting is represented by a transfer from the zero address to the recipient specified by _to, with the appropriate transfer event emitted. The total supply increases according to the number of tokens minted.

  • Burning tokens

    For ERC-20 and ERC-1155, _amount specifies the amount; for ERC-721 and ERC-1155, _id identifies the token. Burning is represented by a transfer from the holder to the zero address, with the appropriate transfer event emitted. The total supply decreases according to the number of tokens burned.

  • Safe minting

    safeMint must implement the same recipient checks as safeTransferFrom in ERC-721 or ERC-1155.

These checks concern whether a recipient contract can receive the applicable ERC-721 or ERC-1155 tokens.

  • ERC-165 support

    Implementing ERC-165 is recommended so applications can detect support for the extension. The original article includes the following basic interface-detection example.

javascript
function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
}

This example checks IERC165 itself; an implementation advertising ERC-5679 support must also handle the applicable extension interface ID.

Additional Considerations

  • Separate interfaces

    A common interface could always accept _amount, as ERC-1155 does. However, each extension follows the _id and _amount conventions of its underlying token standard.

An ERC-721 mint operation concerns one token, so _amount is not included in the interface.

  • Reuse existing events

    Rather than introducing new events, the extension reuses the transfer events defined by the existing token standards to preserve compatibility.

  • ERC-1155 batch operations

    The ERC-1155 extension includes safeMintBatch and burnBatch, whereas the ERC-721 extension does not. This follows the conventions of ERC-721.

No extension is added for ERC-777 because it already defines minting and burning.

Backward Compatibility

The proposal is designed to be compatible with ERC-20, ERC-721, and ERC-1155 respectively.

Security

Access control for minting must be designed carefully. Incorrect access control can allow unauthorized minting and increase the total supply.

Burning also requires careful access control. Typically, the following roles may be authorized to burn tokens:

  • The token owner.
  • An address with the appropriate privileges in the contract.

Conclusion

ERC-5679 proposes consistent minting and burning interfaces for ERC-20, ERC-721, and ERC-1155 tokens.

Implementation details will be added separately.

Further reading and author links: