|
| 1 | +### eip: 5??? |
| 2 | + |
| 3 | +### title: asserting authenticity of Client Script for Token Contracts |
| 4 | + |
| 5 | +### description: Provide a method to assert the authenticity of client script for token contracts, and a way for revokation |
| 6 | + |
| 7 | +### author: Weiwu (@weiwu-zhang), Tore Frederiksen (@jot2re) |
| 8 | + |
| 9 | +### discussions-to: |
| 10 | + |
| 11 | +### status: Draft |
| 12 | + |
| 13 | +### type: Standards Track |
| 14 | + |
| 15 | +### category: ERC |
| 16 | + |
| 17 | +### created: 2s022-05-03 |
| 18 | + |
| 19 | +### requires: |
| 20 | + |
| 21 | +### Abstract |
| 22 | + |
| 23 | +This ERC describes how to assert the authenticity of signed client-script and adds a `revokeClientCodeSigningKey()` function for revocation. |
| 24 | + |
| 25 | +### Motivation |
| 26 | + |
| 27 | +Often NFT authors want to provide some user functionality to their tokens through client scripts. This should be done safely, without opening the user to potential scams. By signing such code with a *Script Signing Key* linked to the creation of the smart contract. Refer to ERC xxxx examples of such scripts. |
| 28 | + |
| 29 | +Although ERC xxxx specified a way to obtain a set of client scripts through URI, in many cases, it is |
| 30 | + |
| 31 | +- insufficient; for example, a smart contract might has script for different environment or use-cases. Take a subway token as an example, it might invoke a minimal script to drive the purchase and use of subway tokens in order to send them through NFC (Internet might be slow or inaccessible underground) |
| 32 | +- inapplicable; for example for token contracts that was issued before the creation of ERC xxxx |
| 33 | + |
| 34 | +This ERC offers a way to assert authenticity of such client scripts disregarding how it is obtained, and can work with smart contracts prior to the publication of this ERC. |
| 35 | + |
| 36 | +### Overview |
| 37 | + |
| 38 | +Although the *smart contract author* and the *client script author* can be the same person/team, we will assume they are different people in this ERC, and the case that they are the same person/team can be implied. |
| 39 | + |
| 40 | +Step 1. The *script author* creates a *script signing key*. |
| 41 | + |
| 42 | +Step 2. The *smart contract author*, using the *smart contract deployment key*, signs a certificate whose subject is the code signing key, which includes expiry. |
| 43 | + |
| 44 | +Step 3. Any client script is to be shipped signed by the *script signing key* and with a certificate attached. |
| 45 | + |
| 46 | +This process is a deliberate copy of the TLS certificate, which is based on x.509 and was proven working in the past decades. |
| 47 | + |
| 48 | +The authenticity of the client script may be obtained through `scriptURI()` function call as in ERCxxxx, or maybe supplied separately by the use-cases, but this ERC is applicable to any code that is signed, and a client must validate the signature in the way specified in this ERC. In real life use-cases, the client scripts can be either supplied by aforementioned `scriptURI()` or offered to the client (wallet) in anyway the wallet can work with, even through NFC connections or QR code. |
| 49 | + |
| 50 | +### Format of the certificate and signature |
| 51 | + |
| 52 | +[expand here] certificate is to be in x.509 format. the signature is to be compatible with XMLDSIG. |
| 53 | + |
| 54 | +### Format to attach signature |
| 55 | + |
| 56 | +This ERC does not specify how a wallet client obtains the signature [examples of ways to obtain] |
| 57 | + |
| 58 | +### Concerning Proxy Contract |
| 59 | + |
| 60 | + |
| 61 | + |
0 commit comments