ERC: Claim Holder #735 status:Discussion
EIP:
Title: Claim Holder
Author: Fabian Vogelsteller (@frozeman)
Type: Standard
Category: ERC
Status: Discussion
Created: --
https://github.com/ethereum/EIPs/issues/735
Abstract
The following describes standard functions for adding, removing and holding of claims.
These claims can attested from third parties (issuers) or self attested.
claims可以通过第三方(发行商)或自己证明
Motivation
This standardised claim holder interface will allow Dapps and smart contracts to check the claims about a claim holder. Trust is here transfered to the issuers of claims.
claims接口允许Dapps和智能合约去查看claim holder的claims
Definitions
claim issuer
: is another smart contract or external account, which issues claims about this identity. The claim issuer can be an identity contract itself.claim发行商能发行了有关身份的claims,它可以是一个智能合约或一个外部账户,当然也可以是身份合约本身claim
: A claim is an information an issuer has about the identity holder.(claim就是发行商所有的关于身份holder的信息) This contains the following:topic
: Auint256
number which represents the topic of the claim. (e.g. 1 biometric(生物识别), 2 residence(住宅) (ToBeDefined: number schemes, sub topics based on number ranges??))scheme
: The scheme with which this claim SHOULD be verified or how it should be processed. Its auint256
for different schemes. E.g. could3
mean contract verification, where thedata
will be call data, and theissuer
a contract address to call (ToBeDefined). Those can also mean different key types e.g. 1 = ECDSA, 2 = RSA, etc. (ToBeDefined)issuer
: The issuers identity contract address, or the address used to sign the above signature. If an identity contract, it should hold the key with which the above message was signed, if the key is not present anymore, the claim SHOULD be treated as invalid. The issuer can also be a contract address itself, at which the claim can be verified using the calldata
.当发行商是一个合约的时候,claims的证明就可以使用call data来进行signature
: Signature which is the proof that the claim issuer issued a claim oftopic
for this identity(签名是发行商对这个身份address(identityHolder
)发行的有关topic的claim). it MUST be a signed message of the following structure:keccak256(address identityHolder_address, uint256 _ topic, bytes data)
// orkeccak256(abi.encode(identityHolder_address, topic, data))
?data
: The hash of the claim data, sitting in another location, a bit-mask, call data, or actual data based on the claim scheme.uri
: The location of the claim, this can be HTTP links, swarm hashes, IPFS hashes, and such.
Specification
Claim Holder
claim structure
The claims issued to the identity. Returns the claim properties.
struct Claim {//这就是一个claims的组成,即某identity使用了该claim,就将相关信息记录下来,this.address即该identity的合约地址
uint256 topic; //claim type
uint256 scheme; //说明使用的是ECDSA等哪个签名算法
address issuer; // msg.sender
bytes signature; // this.address + topic + data
bytes data;
string uri;
}
signature的作用:
There is no way to enforce this standard, and if a supposed claim holder added a claim with address issuer
somebody, but that somebody never made that claim, there is no way to proof that, except using signatures.
没有办法执行这个标准,如果一个假定的claim holder添加了一个地址发行商的claim,但是如果这个人从来没有使用过那个cliam,除了使用签名是再没有办法证明了它拥有该claim
I added the uint256 signatureType
to also allow different signature in the future.现在的签名方法是ECDSA
getClaim
Returns a claim by ID.
function getClaim(bytes32 _claimId) constant returns(uint256 topic, uint256 scheme, address issuer, bytes signature, bytes data, string uri);
getClaimIdsByTopic
Returns an array of claim IDs by topic.
function getClaimIdsByTopic(uint256 _topic) constant returns(bytes32[] claimIds);
addClaim
Requests the ADDITION or the CHANGE of a claim from an issuer
.
Claims can requested to be added by anybody, including the claim holder itself (self issued).
_signature
is a signed message of the following structure: keccak256(address identityHolder_address, uint256 topic, bytes data)
.
Claim IDs are generated using keccak256(address issuer_address + uint256 topic)
.
This COULD implement an approval process for pending claims, or add them right away.
Possible claim topics:
1
: Biometric data2
: Permanent address
(TODO: add more in the initial standard? 3
: Claim registry?)
Returns claimRequestId
: COULD be send to the approve
function, to approve or reject this claim.
Triggers if the claim is new Event and approval process exists: ClaimRequested
Triggers if the claim is new Event and is added: ClaimAdded
Triggers if the claim index existed Event: ClaimChanged
function addClaim(uint256 _topic, uint256 _scheme, address _issuer, bytes _signature, bytes _data, string _uri) returns (uint256 claimRequestId)
removeClaim
Removes a claim.
Can only be removed by the claim issuer, or the claim holder itself.
Triggers Event: ClaimRemoved
function removeClaim(bytes32 _claimId) returns (bool success)
Events
ClaimRequested
COULD be triggered when addClaim
was successfully called.
event ClaimRequested(uint256 indexed claimRequestId, uint256 indexed topic, uint256 scheme, address indexed issuer, bytes signature, bytes data, string uri)
ClaimAdded
MUST be triggered when a claim was successfully added.
event ClaimAdded(bytes32 indexed claimId, uint256 indexed topic, uint256 scheme, address indexed issuer, bytes signature, bytes data, string uri))
ClaimRemoved
MUST be triggered when removeClaim
was successfully called.
event ClaimRemoved(bytes32 indexed claimId, uint256 indexed topic, uint256 scheme, address indexed issuer, bytes signature, bytes data, string uri))
ClaimChanged
MUST be triggered when changeClaim
was successfully called.
event ClaimChanged(bytes32 indexed claimId, uint256 indexed topic, uint256 scheme, address indexed issuer, bytes signature, bytes data, string uri)
Solidity Interface
pragma solidity ^0.4.; contract ERC735 { event ClaimRequested(uint256 indexed claimRequestId, uint256 indexed topic, uint256 scheme, address indexed issuer, bytes signature, bytes data, string uri);
event ClaimAdded(bytes32 indexed claimId, uint256 indexed topic, uint256 scheme, address indexed issuer, bytes signature, bytes data, string uri);
event ClaimRemoved(bytes32 indexed claimId, uint256 indexed topic, uint256 scheme, address indexed issuer, bytes signature, bytes data, string uri);
event ClaimChanged(bytes32 indexed claimId, uint256 indexed topic, uint256 scheme, address indexed issuer, bytes signature, bytes data, string uri); struct Claim {
uint256 topic;
uint256 scheme;
address issuer; // msg.sender
bytes signature; // this.address + topic + data
bytes data;
string uri;
} function getClaim(bytes32 _claimId) public constant returns(uint256 topic, uint256 scheme, address issuer, bytes signature, bytes data, string uri);
function getClaimIdsByTopic(uint256 _ topic) public constant returns(bytes32[] claimIds);
function addClaim(uint256 _topic, uint256 _scheme, address _issuer, bytes _signature, bytes _data, string _uri) public returns (uint256 claimRequestId);
function changeClaim(bytes32 _claimId, uint256 _topic, uint256 _scheme, address _issuer, bytes _signature, bytes _data, string _uri) returns (bool success);
function removeClaim(bytes32 _claimId) public returns (bool success);
}
CHANGE: I renamed claimType
to topic
, to be more precise. Implementations should change that accordingly.
Here is the latest interface for this ERC
pragma solidity ^0.4.; contract ERC735 { event ClaimRequested(uint256 indexed claimRequestId, uint256 indexed claimType, uint256 scheme, address indexed issuer, bytes signature, bytes data, string uri); event ClaimAdded(bytes32 indexed claimId, uint256 indexed claimType, address indexed issuer, uint256 signatureType, bytes signature, bytes claim, string uri);
event ClaimAdded(bytes32 indexed claimId, uint256 indexed claimType, uint256 scheme, address indexed issuer, bytes signature, bytes data, string uri);
event ClaimRemoved(bytes32 indexed claimId, uint256 indexed claimType, uint256 scheme, address indexed issuer, bytes signature, bytes data, string uri);
event ClaimChanged(bytes32 indexed claimId, uint256 indexed claimType, uint256 scheme, address indexed issuer, bytes signature, bytes data, string uri); struct Claim {
uint256 claimType;
uint256 scheme;
address issuer; // msg.sender
bytes signature; // this.address + claimType + data
bytes data;
string uri;
} function getClaim(bytes32 _claimId) public constant returns(uint256 claimType, uint256 scheme, address issuer, bytes signature, bytes data, string uri);
function getClaimIdsByType(uint256 _claimType) public constant returns(bytes32[] claimIds);
function addClaim(uint256 _claimType, uint256 _scheme, address _issuer, bytes _signature, bytes _data, string _uri) public returns (uint256 claimRequestId);
function removeClaim(bytes32 _claimId) public returns (bool success);
}
Constraints
- A claim can only be one per topic per issuer.
一个claim只能有一个topic和一个发行商
⚠️This is implemented by #725,即ethereum/EIPs-725。所以上面是它的概念,最终实现结果写在EIPs-725
ERC: Claim Holder #735 status:Discussion的更多相关文章
- Awesome C/C++
Awesome C/C++ A curated list of awesome C/C++ frameworks, libraries, resources, and shiny things. In ...
- C/C++ 框架,类库,资源集合
很棒的 C/C++ 框架,类库,资源集合. Awesome C/C++ Standard Libraries Frameworks Artificial Intelligence Asynchrono ...
- awesome cpp
https://github.com/fffaraz/awesome-cpp Awesome C/C++ A curated list of awesome C/C++ frameworks, lib ...
- 【干货】国外程序员整理的 C++ 资源大全【转】
来自 https://github.com/fffaraz/awesome-cpp A curated list of awesome C/C++ frameworks, libraries, res ...
- awesome-modern-cpp
Awesome Modern C++ A collection of resources on modern C++. The goal is to collect a list of resouce ...
- [转]awsome c++
原文链接 Awesome C++ A curated list of awesome C++ (or C) frameworks, libraries, resources, and shiny th ...
- kube-controller-manager源码分析-PV controller分析
kubernetes ceph-csi分析目录导航 概述 kube-controller-manager组件中,有两个controller与存储相关,分别是PV controller与AD contr ...
- ERC 725 and ERC 735 的实现及关系
https://github.com/OriginProtocol/origin-playground 通过ERC 725 and ERC 735 的实现来说明它们到底是做什么的: 看了这个例子后才大 ...
- state与status的区别
status 指人时暗指相对的地位,指物时相当于 situation.situation 较狭义地指由环境综合决定的特定时间上的状态或情形. state 人或物存在或所处的状态,和 condition ...
随机推荐
- oracle 备份数据库,导出数据库
导出数据库 exp hljslfh2/hljslfh@dbsvr file=d:\hljslfh2Of0426.dmp 导入数据库 imp hljslfh2/hljslfh@localhost/dbs ...
- 6.C#知识点:反射
1.反射是什么? 反射提供描述组件,模块和类型的对象(类型为Type).您可以使用反射来动态创建类型的实例,将类型绑定到现有对象,或从现有对象获取类型,并调用其方法或访问其字段和属性.如果您在代码中使 ...
- Weex 实现文件的下载
需求:在使用weex框架时,我们使用vue文件写页面,在native端加载服务器端的js页面时由于网络状态的不确定性,我们需要在第一次加载的时候对js页面进行本地存储.也就是说我们需要把js文件下载到 ...
- Re0:从零学习node.js
起小项目 express xxx 镜像 npm install npm install npm start 创建自己的端口...
- 你真的了解 Unicode 和 UTF-8 吗?
目录 引言 ASCII 码 什么是 ASCII 码? ASCII 码都包含哪些字符? ASCII 码的局限在哪里? Unicode 什么是 Unicode ? Unicode 的实现方式有几种? Un ...
- Java Spring学习笔记----Bean的依赖注入(设值注入方式)1
Spring常用的两种依赖注入方式:一种是设值注入方式,利用Bean的setter方法设置Bean的属性值:另一种是构造注入,通过给Bean的构造方法传递参数来实现Bean的属性赋值: 1.设值注入方 ...
- JAVA—集合框架
ref:https://blog.csdn.net/u012961566/article/details/76915755 https://blog.csdn.net/u011240877/artic ...
- js知识学习图谱,新手必看
前端新手学习也不外乎就是Html css html5 css3 这是最基本的,学会这些仅仅可以说是会写布局,写网页,不算前端开发,还有最重要的js,jq要学习,我自己java后台转前端,现在复 ...
- InfoQ观察:Java EE的未来
原创 2017-03-06 Charles Humble 聊聊架构 作者|Charles Humble编辑|薛命灯 作为InfoQ下一年编辑关注点审核工作的一部分,我们挑选了Java作为深入探讨的主题 ...
- Flutter自定义布局套路
开始 在Android中我们要实现一个布局需要继承ViewGroup, 重写其中的onLayout和onMeasure方法. 其中onLayout负责给子控件设置布局区域, onMeaseure度量子 ...