Alert Source Discuss
🚧 Stagnant Standards Track: ERC

ERC-1387: 启用隐私的默克尔树证明

Authors Weiwu Zhang <a@colourful.land>, James Sangalli <j.l.sangalli@gmail.com>
Created 2018-09-08
Discussion Link https://github.com/ethereum/EIPs/issues/1387

简介

通常需要以太坊智能合约验证由有效证明者证明的声明(我住在澳大利亚)。

例如,ICO 合约可能要求参与者 Alice 在参与之前居住在澳大利亚。Alice 的居住声明可能来自当地的太平绅士,他可以证明“Alice 是澳大利亚新南威尔士州的居民”。

与之前的尝试不同,我们假设证明以默克尔树格式签名并在链下发布。每次使用时,Alice 只会暴露部分默克尔树。因此,我们避免了通常与链上发布证明相关的隐私问题。我们还假设 Alice 拥有多个针对同一事实声明的签名默克尔树,以避免她的交易被链接。

目的

此 ERC 为需要用户提供证明并验证它的智能合约提供了一个接口和参考实现。

实现草案

contract MerkleTreeAttestationInterface {
    struct Attestation
    {
        bytes32[] merklePath;
        bool valid;
        uint8 v;
        bytes32 r;
        bytes32 s;
        address attester;
        address recipient;
        bytes32 salt;
        bytes32 key;
        bytes32 val;
    }

    function validate(Attestation attestation) public returns(bool);
}

相关实现示例

这里 是 MerkleTreeAttestationInterface 的一个实现示例 这里 是一个示例服务,它将使用这样的默克尔树证明

相关的 ERC

#1388 #1386

Citation

Please cite this document as:

Weiwu Zhang <a@colourful.land>, James Sangalli <j.l.sangalli@gmail.com>, "ERC-1387: 启用隐私的默克尔树证明 [DRAFT]," Ethereum Improvement Proposals, no. 1387, September 2018. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-1387.