Skip to content
This repository has been archived by the owner on Jan 1, 2020. It is now read-only.

Finhaven/ValidatedToken

Repository files navigation

Validated Token Example Contracts

Status: DRAFT

CircleCI

Example code for the Vaidated Token EIP

Architecture

The basic relationship of this protocol is very simple: there are validators that expose two check functions:

  • check(address token, address user) returns (byte status)
  • check(address token, address to, address from, uint256 amout) returns (byte status)
    +------+
    │Caller|
    +------+
      │  ↑
check │  │ status
      ↓  │
  +---------+
  |Validator|
  +---------+

Why list this as a Caller and not Token? Because validators may be arranged into a DAG of validation dependencies. They may check any and all of their dependencies, or have more complex logic, change which dependencies are required based on who they're validating, and so on.

Example

A somewhat contrived example is for purchasing a holiday via the blockchain. Here, we have TravelToken, which is your travel package (flight & hotel details, &c). In order to purchase such a token, you need to be able to have a valid travel visa, have all of your immunizations up to date, and prove that you are who you say you are. In turn, the travel visa requires that you're not a crminal on a government watch list.

Each of these validation services may be operated variously by the travel agency, governments, and identity services. By implementing the TokenValidator interface, these validation services can interact with other validators to check information that they don't own.

Links