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。 インターフェースは確定していますが、暗号技術は完全に実装依存なので、準拠した 2 つのトークンが異なるクライアント 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