EIPs Explained

ERC-1386 · Stagnant · ERC · 2018-09-08

ERC-1386: Attestation management contract

A draft interface for an issuer contract that manages attestor keys, verifies off-chain attestations and revokes them in bulk via a Bloom filter.

What problem does it solve?

Many applications need to know facts about a user ("over 21", "lives in Australia") without putting personal data on a public blockchain. The usual approach is an attestation: a statement signed off-chain by an issuer, such as a licensing authority, that the user presents only when needed.

That leaves two on-chain questions: is this attestation authentic and still valid, and has the issuer revoked it? ERC-1386 proposes that each issuer publish a contract answering both, so other contracts can ask the issuer directly instead of hard-coding every format.

How it works

The spec's example: Alice holds an attestation from her road authority covering age, birth date, residence and driving ability. Using a Merkle-tree attestation (see ERC-1387), she reveals only the leaf proving she is over 21. A wine shop contract passes that leaf to the issuer contract's verify, checks the payment and completes the sale.

The draft Issuer interface covers:

  • Verification: verify(attestation). Each issuer supplies its own, so formats can evolve and context only the issuer knows can be applied.
  • Attestor key management: addattestorKey(newAttestor, capacity, expiry), replaceKey, removeKey, and validateKey(attestor, capacity). Capacity expresses what a key is trusted to attest; an age claim should come from a driving-licence authority, not a school ID.
  • Revocation: revokeAttestations(bloomFilter). The issuer publishes a Bloom filter of revoked attestation hashes, revoking many at once without listing them individually.

The attestation struct carries a Merkle path, an ECDSA signature (v, r, s), the attestor and recipient addresses, a salt and a key/value pair.

Sample code

A cleaned-up rendering of the draft interface (the spec's listing is pseudo-Solidity; the Bloom filter type is left abstract here as bytes):

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

interface IIssuer {
    struct Attestation {
        bytes32[] merklePath;
        bool valid;
        uint8 v; bytes32 r; bytes32 s;
        address attestor;
        address recipient;
        bytes32 salt;
        bytes32 key;
        bytes32 val;
    }

    function verify(Attestation calldata a) external view returns (bool);
    function addattestorKey(address newAttestor, string calldata capacity, uint256 expiry) external;
    function replaceKey(address oldAttestor, string calldata capacity, uint256 expiry, address newAttestor) external;
    function removeKey(address attestor) external;
    function validateKey(address attestor, string calldata capacity) external view returns (bool);
    function revokeAttestations(bytes calldata bloomFilter) external;
}

contract WineShop {
    IIssuer public immutable licensing;
    constructor(IIssuer issuer) { licensing = issuer; }

    function buy(IIssuer.Attestation calldata over21) external payable {
        require(licensing.verify(over21), "bad attestation");
        require(licensing.validateKey(over21.attestor, "age"), "attestor lacks capacity");
        // ... check payment, deliver
    }
}

Things to know

  • Status: Stagnant. It is an early draft: the interface has syntax errors, no return type on verify, and the Bloom filter type is not defined.
  • Bloom filters can return false positives, so a valid attestation could appear revoked; the spec does not discuss sizing or this trade-off.
  • Companion drafts are ERC-1387 (Merkle-tree attestations) and ERC-1388 (issuer management list), both also Stagnant.
  • For signed off-chain claims verified on-chain, see the related approach in ERC-1812.

#attestation #identity #credentials #privacy

Details

Authors
Weiwu Zhang <[email protected]>, James Sangalli <[email protected]>
Status
Stagnant
Type
Standards Track / ERC
Created
2018-09-08

Machine-readable: Markdown · JSON