Update on ERC902: Validated Token

erc-1066
validation
erc-902

#1

Hi everyone :wave:

This is a bit of an oldie by EIP standards, but I was in there bringing the formatting of ERC902 up to date, and figured that it couldn’t hurt to open this one up for discussion on Ethereum Magicians. This has the added bonus of this providing a discussions-to :wink:

In summary, ERC902: Token Validation is a standard for sharable, chainable, #erc-1066 compatible, on-chain token validation. It has applications for security tokens (ex. #erc-1400), NFTs, “restricted” ERC20s, shared or maintainable whitelists, the full decentralization of control behaviour to a clear on-chain process, and so on.

Comments and feedback are very welcome, especially as we begin to consider moving this closer to LAST_CALL.

Interface

interface TokenValidator {
    function check(
        address _token,
        address _subject
    ) public returns(byte statusCode)

    function check(
        address _token,
        address _from,
        address _to,
        uint256 _amount
    ) public returns (byte statusCode)
}

Architecture

Isolated

        +--------+
        │ Caller |
        +--------+
           │  ↑
check(...) │  │ statusCode
           ↓  │
      +-----------+
      | Validator |
      +-----------+

Here Caller may be a token, another Validator, an exchange (directly checking), or a user verifying that they will be authorized to perform some action.

Stacked

(With example ERC1066 status codes for flavour)

        +-------+
        │ Token |
        +-------+
           │  ↑
check(...) │  │ 0x11
           ↓  │          check(...)
      +------------+   ------------->   +------------+ 
      | ValidatorA |                    | ValidatorC |
      +------------+   <-------------   +------------+
           │  ↑             0x21             │  ↑
check(...) │  │ 0x11              check(...) │  │ 0x31
           ↓  │                              ↓  │
      +------------+                    +------------+
      | ValidatorB |                    | ValidatorD |
      +------------+                    +------------+

Example Diagram