Skip to content

Commit

Permalink
Merge branch 'master' into erc-5521
Browse files Browse the repository at this point in the history
  • Loading branch information
OniReimu committed Apr 28, 2024
2 parents e43e12b + b90325d commit 6adaabe
Show file tree
Hide file tree
Showing 4 changed files with 166 additions and 44 deletions.
73 changes: 53 additions & 20 deletions ERCS/erc-7506.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,14 @@ hint value.
function setHintSigned(address _namespace, bytes32 _list, bytes32 _key, bytes32 _value, address _signer, bytes calldata _signature) public;
```

The type hash **MUST** be the keccak256 hash of `SetHintSigned(address namespace,bytes32 list,bytes32 key,bytes32 value,address signer,uint256 nonce)`
or `SetHintSigned(address namespace,bytes32 list,bytes32 key,bytes32 value,bytes metadata,address signer,uint256 nonce)`
when calling the metadata variant.

##### setHints

A method with the following signature **MUST** be implemented that changes multiple hint values in a hint list of a
namespace. An overloaded method with an additional `bytes calldata _metadata` parameter **MAY** be implemented to set
namespace. An overloaded method with an additional `bytes[] calldata _metadata` parameter **MAY** be implemented to set
metadata together with the hint value.

```solidity
Expand All @@ -127,13 +131,17 @@ function setHints(address _namespace, bytes32 _list, bytes32[] calldata _keys, b

A method with the following signature **MUST** be implemented that multiple hint values in a hint list of a namespace
with a raw signature. The raw signature **MUST** be generated following the Meta Transactions section. An overloaded
method with an additional `bytes calldata _metadata` parameter **MAY** be implemented to set metadata together with the
method with an additional `bytes[] calldata _metadata` parameter **MAY** be implemented to set metadata together with the
hint value.

```solidity
function setHintsSigned(address _namespace, bytes32 _list, bytes32[] calldata _keys, bytes32[] calldata _values, address _signer, bytes calldata _signature) public;
```

The type hash **MUST** be the keccak256 hash of `SetHintsSigned(address namespace,bytes32 list,bytes32[] keys,bytes32[] values,address signer,uint256 nonce)`
or `SetHintsSigned(address namespace,bytes32 list,bytes32[] keys,bytes32[] values,bytes[] metadata,address signer,uint256 nonce)`
when calling the metadata variant.

#### Delegated Hint Management

A namespace owner can add delegate addresses to specific hint lists in their namespace. These delegates **SHALL** have
Expand All @@ -160,10 +168,14 @@ metadata together with the hint value.
function setHintDelegatedSigned(address _namespace, bytes32 _list, bytes32 _key, bytes32 _value, address _signer, bytes calldata _signature) public;
```

The type hash **MUST** be the keccak256 hash of `SetHintDelegatedSigned(address namespace,bytes32 list,bytes32 key,bytes32 value,address signer,uint256 nonce)`
or `SetHintDelegatedSigned(address namespace,bytes32 list,bytes32 key,bytes32 value,bytes metadata,address signer,uint256 nonce)`
when calling the metadata variant.

##### setHintsDelegated

A method with the following signature **MAY** be implemented that changes multiple hint values in a hint list of a
namespace for pre-approved delegates. An overloaded method with an additional `bytes calldata _metadata` parameter
namespace for pre-approved delegates. An overloaded method with an additional `bytes[] calldata _metadata` parameter
**MAY** be implemented to set metadata together with the hint value.

```solidity
Expand All @@ -174,19 +186,23 @@ function setHintsDelegated(address _namespace, bytes32 _list, bytes32[] calldata

A method with the following signature **MAY** be implemented that has multiple hint values in a hint list of a namespace
for pre-approved delegates with a raw signature. The raw signature **MUST** be generated following the Meta Transactions
section. An overloaded method with an additional `bytes calldata _metadata` parameter **MAY** be implemented to set
section. An overloaded method with an additional `bytes[] calldata _metadata` parameter **MAY** be implemented to set
metadata together with the hint value.

```solidity
function setHintsDelegatedSigned(address _namespace, bytes32 _list, bytes32[] calldata _keys, bytes32[] calldata _values, address _signer, bytes calldata _signature) public;
```

The type hash **MUST** be the keccak256 hash of `SetHintsDelegatedSigned(address namespace,bytes32 list,bytes32[] keys,bytes32[] values,address signer,uint256 nonce)`
or `SetHintsDelegatedSigned(address namespace,bytes32 list,bytes32[] keys,bytes32[] values,bytes[] metadata,address signer,uint256 nonce)`
when calling the metadata variant.

#### Hint List Management

##### setListStatus

A method with the following signature **MAY** be implemented that changes the validity state of a hint list. This
enables one to (un)-revoke a whole list of hint values.
A method with the following signature **MAY** be implemented that changes the validity state of a hint list. Revoking a
list **CAN** be used to invalidate all hint values in a list.

```solidity
function setListStatus(address _namespace, bytes32 _list, bool _revoked) public;
Expand All @@ -195,12 +211,15 @@ function setListStatus(address _namespace, bytes32 _list, bool _revoked) public;
##### setListStatusSigned

A method with the following signature **MAY** be implemented that changes the validity state of a hint list with a raw
signature. This enables one to (un)-revoke a whole list of hint values.
signature. Revoking a list **CAN** be used to invalidate all hint values in a list.

```solidity
function setListStatusSigned(address _namespace, bytes32 _list, bool _revoked, address _signer, bytes calldata _signature) public;
```

The type hash **MUST** be the keccak256 hash of `SetListStatusSigned(address namespace,bytes32 list,bool revoked,address signer,uint256 nonce)`
when generating the signature.

##### setListOwner

A method with the following signature **MAY** be implemented that transfers the ownership of a trust list to another
Expand All @@ -222,6 +241,9 @@ value.
function setListOwnerSigned(address _namespace, bytes32 _list, address _newOwner, address _signer, bytes calldata _signature) public;
```

The type hash **MUST** be the keccak256 hash of `SetListOwnerSigned(address namespace,bytes32 list,address newOwner,address signer,uint256 nonce)`
when generating the signature.

##### addListDelegate

A method with the following signature **MAY** be implemented to add a delegate to an owner’s hint list in a namespace.
Expand All @@ -239,24 +261,29 @@ with a raw signature. The raw signature **MUST** be generated following the Meta
function addListDelegateSigned(address _namespace, bytes32 _list, address _delegate, uint256 _untilTimestamp, address _signer, bytes calldata _signature) public;
```

The type hash **MUST** be the keccak256 hash of `AddListDelegateSigned(address namespace,bytes32 list,address delegate,uint256 untilTimestamp,address signer,uint256 nonce)`
when generating the signature.

##### removeListDelegate

A method with the following signature **MAY** be implemented to remove a delegate from an owner’s revocation hint list
in a namespace.
A method with the following signature **MAY** be implemented to remove a delegate from an owner’s hint list in a namespace.

```solidity
function removeListDelegate(address _namespace, bytes32 _list, address _delegate) public;
```

##### removeListDelegateSigned

A method with the following signature **MAY** be implemented to remove a delegate from an owner’s revocation hint list
in a namespace with a raw signature. The raw signature **MUST** be generated following the Meta Transactions section.
A method with the following signature **MAY** be implemented to remove a delegate from an owner’s hint list in a namespace
with a raw signature. The raw signature **MUST** be generated following the Meta Transactions section.

```solidity
function removeListDelegateSigned(address _namespace, bytes32 _list, address _delegate, address _signer, bytes calldata _signature) public;
```

The type hash **MUST** be the keccak256 hash of `RemoveListDelegateSigned(address namespace,bytes32 list,address delegate,address signer,uint256 nonce)`
when generating the signature.

#### Metadata Management

##### getMetadata
Expand Down Expand Up @@ -284,6 +311,9 @@ signature **MUST** be generated following the Meta Transactions section.
function setMetadataSigned(address _namespace, bytes32 _list, bytes32 _key, bytes32 _value, bytes calldata _metadata, address _signer, bytes calldata _signature) public;
```

The type hash **MUST** be the keccak256 hash of `SetMetadataSigned(address namespace,bytes32 list,bytes32 key,bytes32 value,bytes metadata,address signer,uint256 nonce)`
when generating the signature.

#### setMetadataDelegated

A method with the following signature **MAY** be implemented to set metadata for a hint as a pre-approved delegate of
Expand All @@ -302,6 +332,9 @@ the hint list with a raw signature. The raw signature **MUST** be generated foll
function setMetadataDelegatedSigned(address _namespace, bytes32 _list, bytes32 _key, bytes32 _value, bytes calldata _metadata, address _signer, bytes calldata _signature) public;
```

The type hash **MUST** be the keccak256 hash of `SetMetadataDelegatedSigned(address namespace,bytes32 list,bytes32 key,bytes32 value,bytes metadata,address signer,uint256 nonce)`
when generating the signature.

#### Events

##### HintValueChanged
Expand Down Expand Up @@ -372,7 +405,7 @@ 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 in a transaction to the smart contract.
as part of the method call in a transaction to the smart contract.

A **transaction signer** **MAY** be able to deliver a signed payload off-band to a **transaction sender** that initiates
the Ethereum interaction with the smart contract. The signed payload **MUST** be limited to being used only
Expand All @@ -386,19 +419,19 @@ what the payload they are signing consists of, and it provides protection agains
#### Nonce

This EIP **RECOMMENDS** the use of a **dedicated nonce mapping** for meta transactions. If the signature of the
**transaction sender** and its meta-contents are verified, the contract increases a nonce for this
**transaction sender** and its meta-contents are verified, the contract increases a nonce for the
**transaction signer**. This effectively removes the possibility for any other sender to execute the same transaction
again with another wallet.

### Trust Anchor via ENS

Ecosystems that use an Ethereum Name Service (ENS) domain can increase trust by using ENS entries to share information
about a hint list registry. This method takes advantage of the ENS domain's established credibility to make it easier to
find a reliable hint registry contract, as well as the appropriate namespace and hint list customized for particular
ecosystem needs. Implementing a trust anchor through ENS is **OPTIONAL**.
find a hint registry contract of the domain's entity, as well as the appropriate namespace and hint list customized for
particular ecosystem needs. Implementing a trust anchor through ENS is **OPTIONAL**.

For each use case, a specific ENS subdomain **SHALL** be created only used for a specific hint list, e.g.,
“trusted-issuers.ens.eth”. The following records **SHALL** be set:
For each use case, a specific or set of ENS subdomain **SHALL** be created. Each subdomain should be treated as an
atomic entity for a singular set of namespace-list-key-value TEXT records. The following records **SHALL** be set:

- ADDRESS ETH - address of the trusted hint registry contract
- TEXT - key: “hint.namespace”; value: owner address of namespace
Expand All @@ -410,9 +443,9 @@ The following records **MAY** be set:
- TEXT - key: “hint.value”; value: bytes32 key of hint value
- ABI - ABI of trusted hint registry contract

To create a two-way connection, a namespace owner **SHALL** set metadata referencing the ENS subdomain hash for the hint
list. Metadata **SHALL** be set in the owners namespace, hint list `0x0`, and hint key `0x0` where the value is the
ENS subdomain keccak256 hash.
To create a two-way connection, a namespace owner **SHALL** set metadata referencing the complete ENS subdomain hash.
Metadata **SHALL** be set in the owners namespace with a hint list and hint key value of `0x0` where the hint value is
the ENS subdomain keccak256 hash.

By establishing this connection, a robust foundation for trust and discovery within an ecosystem is created.

Expand Down
Loading

0 comments on commit 6adaabe

Please sign in to comment.