EIPs Explained

ERC-7945 · Final(확정) · ERC · 2025-05-09

ERC-7945: Confidential Transactions Supported Token

잔액과 전송 금액이 암호화된 대체 가능 토큰을 위한 최소한의 ERC-20 스타일 인터페이스. 지갑과 앱이 특정 증명 시스템에 얽매이지 않고 기밀 토큰을 지원할 수 있다.

어떤 문제를 해결하나요?

일반 ERC-20 토큰에서는 모든 잔액과 모든 전송 금액이 공개됩니다. 이는 급여 지급, 트레저리 관리, 규제 대상 기관, 많은 기업 간 결제에 걸림돌입니다.

기밀 토큰 설계는 존재하지만(예를 들어 스펙이 인용하는 Zether 방식) 프로젝트마다 자체 인터페이스를 만듭니다. 지갑은 어떤 토큰이 기밀 전송을 지원하는지, 어떻게 호출해야 하는지 쉽게 알 수 없습니다. ERC-7945는 계정 기반 모델에서 공유되는 가장 작은 표면만 표준화하여, 서로 다른 암호 방식, 증명 시스템, 컴플라이언스 워크플로를 같은 함수 이름 뒤에 둘 수 있게 합니다.

어떻게 동작하나요?

잔액, 금액, allowance는 불투명한 bytes입니다. 그 안에 무엇이 들어가는지(예: 준동형 ElGamal 암호문)와 _proof가 무엇을 보여야 하는지는 토큰이 정합니다.

함수 용도
confidentialBalanceOf(owner) 계정의 암호화된 잔액
confidentialTransfer(to, value, proof) 암호화된 금액을 이동. 증명이 실패하면 revert
confidentialApprove(spender, value, proof) 암호화된 allowance를 따로 확보
confidentialAllowance(owner, spender) 남은 암호화된 allowance
confidentialTransferFrom(from, to, value, proof) allowance에서 지출

Zether 방식 토큰에서는 전송 증명이 보통 암호문이 발신자와 수신자에 대해 올바르게 암호화되었고, 숨겨진 금액이 음수가 아니며, 발신자의 숨겨진 잔액이 그 금액을 감당할 수 있음을 보여줍니다.

confidentialApprove는 ERC-20의 approve와 다릅니다. 호출자의 암호화된 잔액을 allowance 부분과 나머지로 분할합니다. 다시 호출하면 먼저 이전 allowance를 되돌려 합친 다음 새 것을 설정합니다.

이벤트 ConfidentialTransfer(spender, from, to, value)와 ConfidentialApproval(...)은 ERC-20의 이벤트와 대응합니다. name, symbol, decimals는 선택적 메타데이터입니다. confidentialTotalSupply() 접근자는 선택 사항인데, 평문으로 읽을 수 있는 공급량은 발행과 소각 금액을 드러내기 때문입니다.

샘플 코드

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

interface IERC7945 {
    function confidentialBalanceOf(address owner) external view returns (bytes memory);
    function confidentialTransfer(address to, bytes memory value, bytes memory proof) external;
    function confidentialTransferFrom(address from, address to, bytes memory value, bytes memory proof) external;
    function confidentialApprove(address spender, bytes memory value, bytes memory proof) external;
    function confidentialAllowance(address owner, address spender) external view returns (bytes memory);

    event ConfidentialTransfer(address indexed spender, address indexed from, address indexed to, bytes value);
    event ConfidentialApproval(address indexed owner, address indexed spender, bytes currentAllowancePart, bytes allowancePart);
}

ethers v6를 사용한 클라이언트 흐름(암호화와 증명 생성은 토큰 자체 SDK에서 제공):

const encBalance = await token.confidentialBalanceOf(me);
const balance = decryptWithMyKey(encBalance);            // implementation-specific
const { ciphertext, proof } = await prover.transfer(balance, 25n, me, recipientPubKey);
await (await token.confidentialTransfer(recipient, ciphertext, proof)).wait();

알아둘 점

  • 상태: Final. 인터페이스는 확정되었지만 암호 기술은 전적으로 구현이 정하므로, 규격을 따르는 두 토큰이라도 서로 다른 클라이언트 SDK가 필요할 수 있습니다.
  • 주소는 여전히 공개됩니다. 가려지는 것은 금액과 잔액이며 누가 누구와 거래하는지가 아닙니다. 발신자/수신자 프라이버시는 ERC-8086의 노트 기반 설계를 참고하세요.
  • 함수 시그니처를 바꾸지 않고 금액을 감사자 키로도 암호화하면 감사가 가능합니다.
  • 토큰은 동시에 ERC-20을 구현할 수 있고("fat token"), 평문 잔액과 기밀 잔액 사이에서 가치를 옮기는 함수를 제공할 수 있습니다.
  • 평문 금액으로 발행하고 소각하면 정보가 새어 나갑니다. 스펙은 이를 피하라고 권고합니다.

#token #privacy #confidential #zk #standard

상세 정보

저자
Siyuan Zheng (@andrewcoder666) <[email protected]>, Zhe Han (@iampkuhz) <[email protected]>, Xiaoyu Liu (@elizabethxiaoyu) <[email protected]>, Wenwei Ma (@madyinglight) <[email protected]>, Jun Meng Tan (@chadxeth) <[email protected]>, Yuxiang Fu (@tmac4096) <[email protected]>, Kecheng Gao (@thanks-v-me-50) <[email protected]>, Alwin Ng Jun Wei (@alwinngjw) <[email protected]>, Chenxin Wang (@3235773541) <[email protected]>, Xiang Gao (@GaoYiRu) <[email protected]>, yuanshanhshan (@xunayuan) <[email protected]>, Hao Zou (@BruceZH0915) <[email protected]>, Yanyi Liang <[email protected]>, Yuehua Zhang (@astroyhzcc) <[email protected]>
상태
Final(확정)
유형
Standards Track / ERC
작성일
2025-05-09
의존하는 제안

기계 판독용 데이터: Markdown · JSON