---
eip: 2193
label: ERC-2193
title: dType Alias Extension - Decentralized Type System
status: Stagnant
type: Standards Track
category: ERC
created: 2019-07-16
requires: 155, 1900, 2157
official: https://eips.ethereum.org/EIPS/eip-2193
source: https://github.com/ethereum/ERCs/blob/master/ERCS/erc-2193.md
canonical: https://eips.huatuo.xyz/ko/eip-2193/
lang: ko
tldr: dType 타입 레지스트리를 기반으로, 모든 온체인 데이터 레코드에 alice@socialnetwork.profile 같은 사람이 읽을 수 있는 별칭을 붙이자고 제안한다. DNS 방식의 이름은 쓰지 않는다.
tags: [naming, alias, registry, dtype]
---

# ERC-2193: dType Alias Extension - Decentralized Type System

> We are proposing Alias - a semantic standard for identifying on-chain resources by human-readable qualifiers, supporting any type of data.

**TL;DR:** dType 타입 레지스트리를 기반으로, 모든 온체인 데이터 레코드에 alice@socialnetwork.profile 같은 사람이 읽을 수 있는 별칭을 붙이자고 제안한다. DNS 방식의 이름은 쓰지 않는다.

## 어떤 문제를 해결하나요?

[ENS(EIP-137)](/eip-137/)는 계정과 컨트랙트에 사람이 읽을 수 있는 이름을 주지만, 컨트랙트 안의 개별 데이터, 예를 들어 한 사용자의 프로필이나 결제 채널 하나에는 이름을 줄 수 없습니다. 또한 ENS는 DNS처럼 잎에서 뿌리 순서(`sub.domain.eth`)를 쓰는데, 이는 대부분의 프로그래밍 언어에서 점이 동작하는 방식과 반대입니다.

ERC-2193은 dType 시스템(타입 정의는 [ERC-1900](/eip-1900/), 스토리지 컨트랙트는 [ERC-2157](/eip-2157/))을 통해 저장된 모든 레코드에 이름을 붙이는 **Alias** 레지스트리를 제안하며, 의미를 담은 구분자를 사용합니다.

## 어떻게 동작하나요?

- 별칭은 dType 타입 식별자, 구분자, `name`, 그리고 그 타입의 스토리지 컨트랙트 안에 있는 레코드의 `identifier`를 조합한 것입니다.
- 구분자와 읽는 순서:

| 구분자 | 의미 | 예시 |
| --- | --- | --- |
| `.` | 일반 도메인, 뿌리에서 잎으로 | `domain.subdomain.resource` |
| `@` | 행위자 관련 데이터, 잎에서 뿌리로 | `alice@socialnetwork.profile` |
| `#` | 개념, 뿌리에서 잎으로 | `topicX#postY` |
| `/` | 리소스 경로, 뿌리에서 잎으로 | `resourceRoot/resource` |

- dType 스토리지 컨트랙트의 원본 레코드를 소유한 사람이라면 누구나 별칭을 설정할 수 있습니다. 소유 증명은 타입 id, identifier, name, 구분자, `nonce`, Alias 컨트랙트 주소, 체인 id([EIP-155](/eip-155/))에 대한 서명으로 하며, 이는 재전송(replay)을 막습니다.
- 소유자는 별칭을 갱신하거나 삭제할 수 있습니다. 하나의 레코드에 서로 다른 이름이나 구분자를 쓰는 별칭을 여러 개 붙일 수 있습니다.
- 콘텐츠는 원시 `bytes32` 식별자로도, 사람이 읽을 수 있는 별칭으로도 지정할 수 있으며, 둘 다 같은 레코드로 해석됩니다.

## 샘플 코드

명세의 인터페이스:

```solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

interface Alias {
    event AliasSet(bytes32 dtypeIdentifier, bytes1 separator, string name, bytes32 indexed identifier);

    function setAlias(
        bytes32 dtypeIdentifier,
        bytes1 separator,
        string memory name,
        bytes32 identifier,
        bytes memory signature
    ) external;

    function getAliased(bytes1 separator, string memory name) external view returns (bytes32 identifier);
}
```

스크립트에서 별칭 해석하기(ethers v6):

```ts
const id = await aliasRegistry.getAliased("0x40", "alice"); // "@" separator
```

## 알아둘 점

- 상태: **Stagnant**. 의존하는 dType 제안([ERC-1900](/eip-1900/), [ERC-2157](/eip-2157/))도 마찬가지입니다.
- 정확한 서명 인코딩, 하위 호환성, 테스트 케이스는 명시되어 있지 않습니다("추가될 예정").
- dType과 연결된 컨트랙트에 저장된 데이터에만 동작합니다. 실제로는 ENS를 범용으로 대체하지 못합니다.


---

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