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 explores ERC-5313, a minimal ownership interface derived from the ownership functionality defined in ERC-173. The original figures are retained and may contain Japanese labels.

The following specification is the basis for this explanation.

For more information about ERC-173, see the following article.

ERC-173: Understanding Smart Contract Ownership

Overview

The proposal defines the minimal interface required to identify the account that controls a contract.

For an introduction to interfaces, see the following article.

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

Specification

Every contract conforming to this EIP must implement the EIP-5313 interface.

javascript
// SPDX-License-Identifier: CC0-1.0
pragma solidity ^0.8.15;

interface EIP5313 {
    function owner() view external returns(address);
}

owner

The owner() function retrieves the address of the contract owner. It defines the minimal method required to expose the concept of contract ownership.

The owner function returns the contract owner's address

Additional Considerations

The proposal aims to minimize the number of functions in the interface and maintain backward compatibility with existing contracts.

Other standards can extend this interface with additional ownership functionality. Keeping the interface small makes it easier to expose ownership information.

See ERC-173 for more details.

ERC-173: Understanding Smart Contract Ownership

Backward Compatibility

All contracts implementing ERC-173 already implement this interface.

Security Considerations

Because this specification does not extend ERC-165, calling owner() does not provide a complete guarantee that the returned address actually identifies the contract owner.

For example, another function with the same signature might return an unrelated address. The risk can be limited when the implementation is used only to check whether an address is the owner, but becomes more significant if an application sends valuable NFTs to the purported owner.

Risks of relying on the returned owner address

An address assumed to be the contract owner's address may in fact be unrelated to the contract's ownership.

Discussion

In my view, there may be relatively few occasions to implement ERC-5313 explicitly as a separate standard. Existing ownership implementations based on approaches such as ERC-173 already expose similar functionality.

In essence, ERC-5313 isolates the ownership-querying portion of ERC-173.

The operation discussed in the security considerations, checking whether a caller owns a contract before performing an action, is already provided by OpenZeppelin's Ownable implementation.

This is why I expect many implementations to provide the interface without explicitly referring to ERC-5313. Whether particular implementations drew on ERC-5313 is a separate question.

For more general permission management within contracts, see the following access control documentation.

https://docs.openzeppelin.com/contracts/2.x/access-control

Conclusion

ERC-5313 provides a minimal interface for querying contract ownership, exposing the owner address without requiring ownership-transfer functionality. Further implementation examples may be added in the future.