ERC-1387 Merkle tree based privacy attestation (Merkle Tree Attestations with Privacy enabled)

Stagnant · Signatures & auth · created 2018-09-08

This standard allows a trusted third party to sign a fact such as residency off-chain in the form of a Merkle tree, letting the user disclose only part of it so a contract can verify it.

Why it is needed

Smart contracts like ICOs sometimes need to confirm that a participant satisfies a specific fact (for example, being an Australian resident). If such a proof is posted directly on-chain, who was proven what becomes fully public, violating privacy. Also, if the same proof is reused as-is across multiple transactions, those transactions become linkable and can be traced back to the same person. Avoiding this requires issuing the proof off-chain, disclosing only the necessary part each time it is used, and preparing multiple signed copies for the same fact, but without a common interface for verifying this, each contract ends up with its own ad hoc verification logic.

What to implement

In depth

Attestation struct

An Attestation consists of merklePath (a bytes32 array), valid (bool), v, r, s (signature values), attester and recipient addresses, salt, key, and val fields. Together these fields convey the Merkle tree path and signature, indicating that the attester has attested to a specific fact (key and val) for a specific recipient.

The validate function

The specification defines only a single function, validate(Attestation attestation). This function verifies the submitted Attestation and returns a bool. The specific verification logic, such as signature recovery or reconstructing the Merkle path, is not in the specification itself and is left to the reference implementation.

Privacy model

Proofs are signed and issued off-chain in the form of a Merkle tree, and only part of it (the Merkle path) is disclosed each time it is used. Additionally, a user can hold multiple signed Merkle trees for the same fact and use different ones across different transactions so they cannot be linked to each other.

Reference implementation

The original document links to an example implementation of MerkleTreeAttestationInterface in the alpha-wallet repository and an example service that uses it (james-squire.sol). To check the specific verification algorithm, you need to look at this reference implementation.

Related ERCs

This proposal is stated to be related to ERC-1388 and ERC-1386.

Progress status

This proposal is a draft-level interface presentation written on 2018-09-08 and its current status is Stagnant. Since discussion has stopped and is no longer progressing, it has not been adopted as a final standard.

Original ERC · ← ERCs