Skip to content

Commit

Permalink
chore: reflect newest changes to functions, events, and fix link issue
Browse files Browse the repository at this point in the history
  • Loading branch information
strumswell committed Sep 12, 2022
1 parent 2ae8865 commit e1cda05
Showing 1 changed file with 99 additions and 67 deletions.
166 changes: 99 additions & 67 deletions EIPS/eip-5539.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ requires: 712
---

## Abstract
This EIP proposes a set of methods and standards for an RBAC-enabled registry of indicators aimed for usage in revocations.
This EIP proposes a set of methods and standards for a role-based registry of indicators aimed for usage in revocations.

## Motivation
Revocation is a universally needed construct both in the traditional centralized and decentralized credential attestation. This EIP aims to provide an interface to standardize a decentralized approach to managing and resolving revocation states in a contract registry.
Expand All @@ -33,171 +33,203 @@ This EIP specifies a contract called `EthereumRevocationRegistry` that is deploy
An owner of a namespace **MAY** allow delegates to manage one or more of its revocation lists. Delegates **MUST** be removable by the respective list's owner. In certain situations, an owner **MAY** also want to transfer a revocation list in a namespace and its management rights to a new owner.

### Definitions
- `namespace`: A namespace is a representation of an Ethereum address inside the registry. The address of the namespace initially has owner rights to all revocation lists beneath it.
- `owner`: An Ethereum address that has modifying rights to many revocation lists. Initially, the owner of a revocation list corresponds to the address of the namespace.
- `delegate`: An Ethereum address that is allowed to change the revocation statuses in a revocation list of a foreign namespace. Access has to be granted by the current owner of the revocation list.
- `namespace`: A namespace is a representation of an Ethereum address inside the registry that corresponds to its owners address. All revocation lists within a namespace are initially owned by the namespace's owner address.
- `revocation list`: A namespace can contain a number of revocation lists. Each revocation list is identified by a unique key of the type bytes32 that can be used to address it in combination with the namespace address.
- `revocation key`: A revocation list can contain a number of revocation keys of the type bytes32. In combination with the namespace address and the revocation list key, it resolves to a boolean value that indicates whether the revocation key is revoked or not.
- `owner`: An Ethereum address that has modifying rights to revocation lists within its own and possibly foreign namespaces. An owner can give up modifying rights of revocation lists within its namespace by transferring ownership to another address.
- `delegate`: An Ethereum address that received temporary access to a revocation list in a namespace. It has to be granted by the current owner of the revocation list in question.

### Revocation management
### Revocation Management

**isRevoked**
**MUST** implement a function that returns the revocation status of a particular revocation key in a namespace's revocation list.
#### isRevoked
**MUST** implement a function that returns the revocation status of a particular revocation key in a namespace's revocation list. It **MAY** also respect the revocation lists revocation status.
```solidity
function isRevoked(address namespace, bytes32 list, bytes32 key) public view returns (bool);
```

**changeStatus**
#### changeStatus
**MUST** implement a function to change the revocation status of a particular revocation key in a namespace's revocation list
```solidity
function changeStatus(bool revoked, address namespace, bytes32 list, bytes32 key) public;
function changeStatus(bool revoked, address namespace, bytes32 revocationList, bytes32 revocationKey) public;
```

**changeStatusSigned** ([see meta transactions](#Meta-transactions))
#### changeStatusSigned ([see Meta Transactions](#MetaTransactions))
**OPTIONAL** implements a function to change the revocation status of a particular revocation key in a namespace's revocation list with a raw signature.
```solidity
function changeStatusSigned(bool revoked, address namespace, bytes32 list, bytes32 key, uint8 sigV, bytes32 sigR, bytes32 sigS) public;
function changeStatusSigned(bool revoked, address namespace, bytes32 revocationList, bytes32 revocationKey, bytes calldata signature) public;
```

**changeStatusDelegate**
**OPTIONAL** implements a function to change the revocation status of a particular revocation key in a namespace's revocation list with a raw signature.
#### changeStatusDelegated
**OPTIONAL** implements a function to change the revocation status of a particular revocation key in a namespace's revocation list by a revocation list's delegate.
```solidity
function changeStatusDelegate(bool revoked, address namespace, bytes32 list, bytes32 key) public;
function changeStatusDelegated(bool revoked, address namespace, bytes32 revocationList, bytes32 revocationKey) public;
```

**changeStatusDelegateSigned** ([see meta transactions](#Meta-transactions))
#### changeStatusDelegatedSigned ([see Meta Transactions](#MetaTransactions))
**OPTIONAL** implements a function to change the revocation status of a particular revocation key in a namespace's revocation list with a raw signature.
```solidity
function changeStatusDelegateSigned(bool revoked, address namespace, bytes32 list, bytes32 key, uint8 sigV, bytes32 sigR, bytes32 sigS) public;
function changeStatusDelegatedSigned(bool revoked, address namespace, bytes32 revocationList, bytes32 revocationKey, bytes calldata signature) public;
```

#### changeStatusesInList
**OPTIONAL** implements a function to change multiple revocation statuses in a namespace's revocation list at once.
```solidity
function changeStatusesInList(bool[] memory revoked, address namespace, bytes32 revocationList, bytes32[] memory revocationKeys) public;
```

#### changeStatusesInListSigned ([see Meta Transactions](#MetaTransactions))
**OPTIONAL** implements a function to change multiple revocation statuses in a namespace's revocation list at once with a raw signature.
```solidity
function changeStatusesInListSigned(bool[] memory revoked, address namespace, bytes32 revocationList, bytes32[] memory revocationKeys, bytes calldata signature) public;
```

#### changeStatusesInListDelegated
**OPTIONAL** implements a function to change multiple revocation statuses in a namespace's revocation list at once by a revocation list's delegate.
```solidity
function changeStatusesInListDelegated(bool[] memory revoked, address namespace, bytes32 revocationList, bytes32[] memory revocationKeys) public;
```

**batchChangeStatuses**
**OPTIONAL** implements a function to change multiple revocation statuses in different revocation lists and namespaces at once.
#### changeStatusesInListDelegatedSigned ([see Meta Transactions](#MetaTransactions))
**OPTIONAL** implements a function to change multiple revocation statuses in a namespace's revocation list at once with a raw signature generated by a revocation list's delegate.
```solidity
function batchChangeStatuses(bool[] revokedStatuses, address[] namespaces, bytes32[] lists, bytes32[] keys) public;
function changeStatusesInListDelegatedSigned(bool[] memory revoked, address namespace, bytes32 revocationList, bytes32[] memory revocationKeys) public;
```

**batchChangeStatusesSigned** ([see meta transactions](#Meta-transactions))
**OPTIONAL** implements a function to change multiple revocation statuses in different revocation lists and namespaces at once with a raw signature.
### Revocation List Management

####
**OPTIONAL** implements a function that returns the revocation status of a particular revocation list in a namespace.
```solidity
function batchChangeStatusesSigned(bool[] revokedStatuses, address[] namespaces, bytes32[] lists, bytes32[] keys, uint8 sigV, bytes32 sigR, bytes32 sigS) public;
function listIsRevoked(address namespace, bytes32 revocationList) view public returns (bool);
```

**batchChangeListStatuses**
**OPTIONAL** implements a function to change multiple revocation statuses in a specific namespace's revocation list.
#### changeListStatus
**OPTIONAL** implements a function to change the revocation of a revocation list itself. If a revocation list is revoked, all its keys are considered revoked as well.
```solidity
function batchChangeListStatuses(bool[] revokedStatuses, address namespace, bytes32 list, bytes32[] keys) public;
function changeListStatus(bool revoked, address namespace, bytes32 revocationList) public;
```

**batchChangeListStatusesSigned** ([see meta transactions](#Meta-transactions))
**OPTIONAL** implements a function to change multiple revocation statuses in a specific namespace's revocation list with a raw signature.
#### changeListStatusSigned ([see Meta Transactions](#MetaTransactions))
**OPTIONAL** implements a function to change the revocation of a revocation list itself with a raw signature. If a revocation list is revoked, all its keys are considered revoked as well.
```solidity
function batchChangeListStatusesSigned(bool[] revokedStatuses, address namespace, bytes32 list, bytes32[] keys, uint8 sigV, bytes32 sigR, bytes32 sigS) public;
function changeListStatusSigned(bool revoked, address namespace, bytes32 revocationList, bytes calldata signature) public;
```

### Owner management

**changeListOwner**
**OPTIONAL** implement a function to change the owner of a revocation list in a namespace to a new address.
#### changeListOwner
**OPTIONAL** implement a function to change the revocation status of a revocation list. If a revocation list is revoked, all keys in it are considered revoked.
```solidity
function changeListOwner(address owner, address newOwner, bytes32 list) public;
function changeListOwner(address newOwner, address namespace, bytes32 revocationList) public;
```

**changeListOwnerSigned** ([see Meta transactions](#Meta-transactions))
**OPTIONAL** implements a function to change the owner of a revocation list in a namespace to a new address.
#### changeListOwnerSigned ([see Meta Transactions](#MetaTransactions))
**OPTIONAL** implement a function to change the revocation status of a revocation list with a raw signature. If a revocation list is revoked, all keys in it are considered revoked.
```solidity
function changeListOwnerSigned(address owner, address newOwner, bytes32 list, uint8 sigV, bytes32 sigR, bytes32 sigS) public;
function changeListOwnerSigned(address newOwner, address namespace, bytes32 revocationList, bytes calldata signature) public;
```

### Delegation management

#### addListDelegate
**OPTIONAL** implements a function to add a delegate to an owner's revocation in a namespace list.
**OPTIONAL** implements a function to add a delegate to an owner's revocation list in a namespace.
```solidity
function addListDelegate(address owner, address delegate, bytes32 list) public;
function addListDelegate(address delegate, address namespace, bytes32 revocationList) public;
```

#### addListDelegateSigned ([see Meta transactions](#Meta-transactions))
#### addListDelegateSigned ([see Meta Transactions](#MetaTransactions))
**OPTIONAL** implements a function to add a delegate to an owner's revocation list in a namespace with a raw signature.
```solidity
function addListDelegateSigned(address owner, address delegate, bytes32 list, uint8 sigV, bytes32 sigR, bytes32 sigS) public;
function addListDelegateSigned(address delegate, address namespace, bytes32 revocationList, bytes calldata signature) public;
```

#### removeListDelegate
**OPTIONAL** implements a function to remove a delegate from an owner's revocation list in a namespace.
```solidity
function removeListDelegate(address owner, address delegate, bytes32 list) public;
function removeListDelegate(address delegate, address owner, bytes32 revocationList) public;
```

#### removeListDelegateSigned ([see Meta transactions](#Meta-transactions))
#### removeListDelegateSigned ([see Meta Transactions](#MetaTransactions))
**OPTIONAL** implements a function to remove a delegate from an owner's revocation list in a namespace with a raw signature.
```solidity
function removeListDelegateSigned(address owner, address delegate, bytes32 list, uint8 sigV, bytes32 sigR, bytes32 sigS) public;
function removeListDelegateSigned(address delegate, address namespace, bytes32 revocationList, bytes calldata signature) public;
```

### Events

**RevocationStatusChanged**
**MUST** be emitted when `changeStatus`, `changeStatusSigned`, `changeStatusDelegate`, or `changeStatusDelegateSigned` was successfully executed.
#### RevocationStatusChanged
**MUST** be emitted when `changeStatus`, `changeStatusSigned`, `changeStatusDelegated`, or `changeStatusDelegatedSigned` was successfully executed.

```solidity
event RevocationStatusChanged(
address indexed namespace,
bytes32 indexed list,
bytes32 indexed key,
bytes32 indexed revocationList,
bytes32 indexed revocationKey,
bool revoked
);
```

**RevocationStatusesChanged**
**MUST** be emitted when `batchChangeStatuses`, `batchChangeStatusesSigned`, `batchChangeListStatuses`, or `batchChangeListStatusesSigned` was successfully executed.
#### RevocationStatusesChanged
**MUST** be emitted when `changeStatusesInList`, `changeStatusesInListSigned`, `changeStatusesInListDelegated`, or `changeStatusesInListDelegatedSigned` was successfully executed.

```solidity
event RevocationStatusesChanged(
address[] indexed namespaces,
bytes32[] indexed lists,
bytes32[] indexed keys,
address indexed namespace,
bytes32 indexed revocationList,
bytes32[] indexed revocationKeys,
bool[] revoked
);
```

**ListOwnerChanged**
#### RevocationListOwnerChanged
**MUST** be emitted when `changeListOwner` or `changeListOwnerSigned` was successfully executed.

```solidity
event ListOwnerChanged(
event RevocationListOwnerChanged(
address indexed namespace,
bytes32 indexed revocationList
address indexed newOwner,
bytes32 indexed list
);
```

**DelegateAdded**
#### RevocationListDelegateAdded
**MUST** be emitted when `addListDelegate` or `addListDelegateSigned` was successfully executed.

```solidity
event ListDelegateAdded(
event RevocationListDelegateAdded(
address indexed namespace,
address indexed delegate,
bytes32 indexed list
bytes32 indexed revocationList,
address indexed delegate
);
```

**DelegateRemoved**
#### RevocationListDelegateRemoved
**MUST** be emitted when `removeListDelegate` or `removeListDelegateSigned` was successfully executed.

```solidity
event ListDelegateRemoved(
event RevocationListDelegateRemoved(
address indexed namespace,
address indexed delegate,
bytes32 indexed list
bytes32 indexed revocationList,
address indexed delegate
);
```

### Meta transactions
#### RevocationListStatusChanged
**MUST** be emitted when `changeListStatus` or `changeListStatusSigned` was successfully executed.

```solidity
event RevocationListStatusChanged(
address indexed namespace,
bytes32 indexed revocationlist,
bool revoked
);
```

This section uses the following terms:
### Meta Transactions <span id="MetaTransactions"></span>

**`transaction signer`:** An Ethereum address that signs arbitrary data for the contract to execute **BUT** does not commit the transaction.
**`transaction sender`**: An Ethereum address that takes signed data from a **transaction signer** and commits it wrapped with its own signature to the smart contract.
This section uses the following terms:
- **`transaction signer`**: An Ethereum address that signs arbitrary data for the contract to execute **BUT** does not commit the transaction.
- **`transaction sender`**: An Ethereum address that takes signed data from a **transaction signer** and commits it wrapped with its own signature to the smart contract.

An address (**transaction signer**) **MAY** be able to deliver a signed payload off-band to another address (**transaction sender**) that initiates the Ethereum interaction with the smart contract. The signed payload **MUST** be limited to be used only once ([Signed Hash](#Signed-Hash) + [nonces](#Nonce)).

Expand All @@ -212,10 +244,10 @@ This EIP **RECOMMENDS** the use of a **dedicated nonce mapping** for meta transa
## Rationale

### Why the concept of namespaces?
> This provides every Ethereum address a reserved space, without the need to actively claim it in the contract. Initially addresses only have owner access in their own namespace.
This provides every Ethereum address a reserved space, without the need to actively claim it in the contract. Initially addresses only have owner access in their own namespace.

### Why does a namespace always represent the initial owner address?
> The change of an owner of a list shouldn't break the link to a revocation key in it, as already existing off-chain data may depend on it.
The change of an owner of a list shouldn't break the link to a revocation key in it, as already existing off-chain data may depend on it.

## Backwards Compatibility
No backward compatibility issues were found.
Expand Down

0 comments on commit e1cda05

Please sign in to comment.