ERC-1388 · Stagnant · ERC · 2018-09-08
ERC-1388: Attestation Issuers Management List
A contract interface for publishing curated lists of trusted attestation issuers, so a dapp can trust a list instead of hard-coding every issuer itself.
What problem does it solve?
Some contracts need proof about a user, such as "this person is a resident of New Zealand or Australia". Many different bodies could vouch for that: a passport authority, a land title office, local police. A dapp cannot realistically decide on and maintain the full set of trustworthy issuers by itself.
ERC-1388 outsources that job to managed lists. Anyone can publish a list of attestation issuers; a contract chooses which list to trust and then accepts attestations from any issuer on it. Well-maintained lists would win adoption over time.
How it works
A list is managed by one address (the manager), and for simplicity the manager's address is the list's id. Each list has:
nameanddescriptioncapacity: an optional filter. If set, only attestations signed with a key that has that capacity are accepted.issuerContracts: addresses of issuer contracts (not raw signing keys). Each issuer contract manages its own signing keys.expiry
Functions in the draft:
| Function | Purpose |
|---|---|
createList(list) |
Create a list owned by the caller |
addIssuer(issuerContract) |
Manager adds an issuer to their list |
removeIssuer(issuerContract, list) |
Manager removes an issuer |
getIssuerCorrespondingToAttestationKey(listId, signingKey) |
Find which issuer on the list controls a given signing key |
replaceListIndex(list, manager) |
Hand the list to a new manager key |
A relying contract calls getIssuerCorrespondingToAttestationKey with the key that signed a user's attestation. The list contract asks each issuer contract whether that key is theirs and returns the first match.
Sample code
An illustrative interface and how a service might use it (the spec's draft uses a struct parameter; this sketch flattens it):
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
interface IManagedIssuerList {
function addIssuer(address issuerContract) external;
function removeIssuer(address issuerContract) external returns (bool);
function getIssuerCorrespondingToAttestationKey(bytes32 listId, address signingKey)
external returns (address issuer);
}
contract ResidencyGate {
IManagedIssuerList public immutable lists;
bytes32 public immutable trustedList;
constructor(IManagedIssuerList l, bytes32 listId) {
lists = l;
trustedList = listId;
}
function isTrustedSigner(address signingKey) public returns (bool) {
return lists.getIssuerCorrespondingToAttestationKey(trustedList, signingKey) != address(0);
}
}
Things to know
- Status is Stagnant. The spec is a short draft with an incomplete interface (for example, struct parameters on public functions and a mix of list identifiers).
- Using the manager's address as the list id means one key per list, and if the manager rotates keys the list id stays tied to the original address, as the spec itself notes.
- The draft acknowledges an attack where one issuer claims another's key, deferring the mitigation to "later design".
- It was proposed alongside ERC-1386 (attestation management) and ERC-1387 (Merkle-tree attestations), both also Stagnant.