diff --git a/.gitignore b/.gitignore index 485dee64..090a1f02 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ .idea +.DS_Store diff --git a/dev-website-docs/base/Cyano/dApi/01-quickstart.md b/dev-website-docs/base/Cyano/dApi/01-quickstart.md index fdc30abd..49f6b3b0 100644 --- a/dev-website-docs/base/Cyano/dApi/01-quickstart.md +++ b/dev-website-docs/base/Cyano/dApi/01-quickstart.md @@ -6,7 +6,7 @@ ontology-dapi can be used as CommonJS/ES6 module or directly referencing in web ### Install CommonJS/ES module ``` -npm install ontology-dapi +npm install @ont-dev/ontology-dapi ``` ### Import CommonJS @@ -34,9 +34,11 @@ var client = dApi.client; dApp needs to register itself as a client with the ontology-dapi library to enable the communication. ``` -import { client } from 'ontology-dapi'; +import { client, provider } from '@ont-dev/ontology-dapi'; -client.registerClient({}); +client.registerClient({ + extension: provider.ExtensionType.Cyano + }) ``` ## Usage diff --git a/dev-website-docs/base/Cyano/dApi/02-getting-started.md b/dev-website-docs/base/Cyano/dApi/02-getting-started.md index 593abf2f..f850afef 100644 --- a/dev-website-docs/base/Cyano/dApi/02-getting-started.md +++ b/dev-website-docs/base/Cyano/dApi/02-getting-started.md @@ -11,13 +11,24 @@ The document is broken down into the following sections: [Architecture](#Architecture) [Ontology dAPI Overview](#ontology-dapi-overview) -+ [dAPI Installation](#dapi-installation) -+ [dAPI Instantiation](#dapi-instantiation) -+ [Example dAPI methods](#example-dapi-methods) - + [Example blockchain methods](#example-blockchain-methods) - + [Example asset methods](#example-asset-methods) - + [Example Smart Contract methods](#example-smart-contract-methods) - + [Example Message methods](#example-message-methods) +- [Overview](#overview) +- [Setting up the Development Environment](#setting-up-the-development-environment) + - [Architecture](#architecture) +- [dAPI Usage](#dapi-usage) + - [dAPI Installation](#dapi-installation) + - [dAPI Instantiation](#dapi-instantiation) + - [Example dAPI methods](#example-dapi-methods) + - [Example blockchain methods](#example-blockchain-methods) + - [Example asset methods](#example-asset-methods) + - [Example Smart Contract Methods](#example-smart-contract-methods) + - [Example Message Methods](#example-message-methods) + - [Running the Demo Project](#running-the-demo-project) + - [How to set gaslimit and gasprice](#how-to-set-gaslimit-and-gasprice) + - [Writing a smart contract for your dApp](#writing-a-smart-contract-for-your-dapp) + - [Compiling and deploying your smart contract](#compiling-and-deploying-your-smart-contract) + - [Compiling your smart contract](#compiling-your-smart-contract) + - [Deploying your Smart Contract](#deploying-your-smart-contract) + - [Testing Smart Contract](#testing-smart-contract) [Running the demo project](#running-the-demo-project) @@ -54,7 +65,7 @@ Please ensure you have the following installed and configured in order to setup The Ontology dAPI is the core API used to interface with the Ontology blockhain when creating a dApp and the repository can be found [here](https://github.com/ontio/ontology-dapi). First you must install the npm package using: ``` -$ npm install ontology-dapi +$ npm install @ont-dev/ontology-dapi ``` #### dAPI Instantiation @@ -62,9 +73,11 @@ $ npm install ontology-dapi To use the dAPI in your project, you need to import the library and then register as a client. Import and register the dAPI using: ``` -import { client } from 'ontology-dapi'; +import { client, provider } from '@ont-dev/ontology-dapi'; -client.registerClient({}); +client.registerClient({ + extension: provider.ExtensionType.Cyano + }) ``` #### Example dAPI methods diff --git a/dev-website-docs/base/QuickGuide/06-dapi-useage.md b/dev-website-docs/base/QuickGuide/06-dapi-useage.md index 097bdfca..83ec6f5f 100644 --- a/dev-website-docs/base/QuickGuide/06-dapi-useage.md +++ b/dev-website-docs/base/QuickGuide/06-dapi-useage.md @@ -40,7 +40,7 @@ Please ensure you have the following installed and configured in order to setup The Ontology dAPI is the core API used to interface with the Ontology blockhain when creating a dApp and the repository can be found [here](https://github.com/ontio/ontology-dapi). First you must install the npm package using: ``` -$ npm install ontology-dapi +$ npm install @ont-dev/ontology-dapi ``` #### dAPI Instantiation @@ -48,9 +48,11 @@ $ npm install ontology-dapi To use the dAPI in your project, you need to import the library and then register as a client. Import and register the dAPI using: ``` -import { client } from 'ontology-dapi'; +import { client, provider } from '@ont-dev/ontology-dapi'; -client.registerClient({}); +client.registerClient({ + extension: provider.ExtensionType.Cyano + }) ``` #### Example dAPI methods diff --git a/dev-website-docs/base/dApp-Integration/03-DAppDocking-use-chrome-extension-wallet.md b/dev-website-docs/base/dApp-Integration/03-DAppDocking-use-chrome-extension-wallet.md index b2c528a8..5b011b6c 100644 --- a/dev-website-docs/base/dApp-Integration/03-DAppDocking-use-chrome-extension-wallet.md +++ b/dev-website-docs/base/dApp-Integration/03-DAppDocking-use-chrome-extension-wallet.md @@ -23,7 +23,7 @@ Please make sure the following softwares are installed: When creating a dApp, Ontology DAPI is one of the core APIs for interacting with the Ontology blockchain, and the source code can be downloaded [here](https://github.com/ontio/ontology-dapi). Install Ontology-DAPI via ```npm```: ``` -$ npm install ontology-dapi +$ npm install @ont-dev/ontology-dapi ``` #### DAPI example @@ -31,9 +31,11 @@ $ npm install ontology-dapi When creating a DAPI example, first import ontology-dapi and register as follows: ```typescript -import { client } from 'ontology-dapi'; +import { client, provider } from '@ont-dev/ontology-dapi'; -client.registerClient({}); +client.registerClient({ + extension: provider.ExtensionType.Cyano + }) ``` #### DAPI method diff --git a/dev-website-docs/base/docs-cn/QuickGuide/00-dapp_development.md b/dev-website-docs/base/docs-cn/QuickGuide/00-dapp_development.md index 7ec5cf23..0153992a 100644 --- a/dev-website-docs/base/docs-cn/QuickGuide/00-dapp_development.md +++ b/dev-website-docs/base/docs-cn/QuickGuide/00-dapp_development.md @@ -186,7 +186,7 @@ dApi 支持 [Web环境](https://github.com/ontio-cyano/cyano-bridge)(仅支持 #### Chrome 版 ``` -npm install ontology-dapi +npm install @ont-dev/ontology-dapi ``` #### 移动版 @@ -202,8 +202,11 @@ npm install cyanobridge #### Chrome 版 ``` -import {client} from 'ontology-dapi' -client.registerClient({}) +import { client, provider } from '@ont-dev/ontology-dapi'; + +client.registerClient({ + extension: provider.ExtensionType.Cyano + }) ``` #### 移动版 diff --git a/dev-website-docs/base/docs-cn/QuickGuide/06-dapi-useage.md b/dev-website-docs/base/docs-cn/QuickGuide/06-dapi-useage.md index 84ef7839..60e32e44 100644 --- a/dev-website-docs/base/docs-cn/QuickGuide/06-dapi-useage.md +++ b/dev-website-docs/base/docs-cn/QuickGuide/06-dapi-useage.md @@ -33,7 +33,7 @@ DAPI是为基于Ontology开发的DAPP提供的轻量级去中心化API,支持D 创建dApp时,Ontology dAPI是与Ontology链交互的核心API之一,可以从这里下载源码。 [这里](https://github.com/ontio/ontology-dapi). 通过 ```npm``` 安装```ontology-dapi``` : ``` -$ npm install ontology-dapi +$ npm install @ont-dev/ontology-dapi ``` #### dAPI 实例 @@ -41,9 +41,11 @@ $ npm install ontology-dapi 创建dAPI 实例时,要先导入库ontology-dapi,并注册客户端: ```typescript -import { client } from 'ontology-dapi'; +import { client, provider } from '@ont-dev/ontology-dapi'; -client.registerClient({}); +client.registerClient({ + extension: provider.ExtensionType.Cyano + }) ``` #### dAPI 方法 diff --git a/dev-website-docs/base/docs-cn/cyano/03-ontology-dapi.md b/dev-website-docs/base/docs-cn/cyano/03-ontology-dapi.md index ab933083..d4086490 100644 --- a/dev-website-docs/base/docs-cn/cyano/03-ontology-dapi.md +++ b/dev-website-docs/base/docs-cn/cyano/03-ontology-dapi.md @@ -8,7 +8,7 @@ 你可以使用 `npm` 进行安装 ```shell -npm install ontology-dapi +npm install @ont-dev/ontology-dapi ``` ### CDN @@ -26,13 +26,13 @@ npm install ontology-dapi ### CommonJS ```javascript -var client = require('ontology-dapi').client; +var client = require('@ont-dev/ontology-dapi').client; ``` ### ES6 模块 ```javascript -import { client } from 'ontology-dapi'; +import { client } from '@ont-dev/ontology-dapi'; ``` ### Web require @@ -46,7 +46,11 @@ import { client } from 'ontology-dapi'; ## 初始化 ```javascript -import { client } from 'ontology-dapi'; +import { client, provider } from '@ont-dev/ontology-dapi'; + +client.registerClient({ + extension: provider.ExtensionType.Cyano + }) var client = dApi.client; client.registerClient({}); diff --git a/dev-website-docs/base/docs-cn/dApp-Integration/03-DAppDocking-use-chrome-extension-wallet.md b/dev-website-docs/base/docs-cn/dApp-Integration/03-DAppDocking-use-chrome-extension-wallet.md index c1c8ef3d..21641f64 100644 --- a/dev-website-docs/base/docs-cn/dApp-Integration/03-DAppDocking-use-chrome-extension-wallet.md +++ b/dev-website-docs/base/docs-cn/dApp-Integration/03-DAppDocking-use-chrome-extension-wallet.md @@ -31,7 +31,7 @@ DAPI 使用 TypeScript 实现,同时也支持在 JavaScript 工程中使用。 创建 DApp 时,本体 DAPI 是与本体链交互的核心 API 之一,可以从 [这里](https://github.com/ontio/ontology-dapi) 下载源码。 通过 ```npm``` 安装 ontology-DAPI: ``` -$ npm install ontology-dapi +$ npm install @ont-dev/ontology-dapi ``` #### DAPI 实例 @@ -39,9 +39,11 @@ $ npm install ontology-dapi 创建 DAPI 实例时,要先导入库 ontology-dapi,并注册客户端,如下所示: ```typescript -import { client } from 'ontology-dapi'; +import { client, provider } from '@ont-dev/ontology-dapi'; -client.registerClient({}); +client.registerClient({ + extension: provider.ExtensionType.Cyano + }) ``` #### DAPI 方法 diff --git a/dev-website-docs/base/docs-kr/Cyano/dApi/01-quickstart.md b/dev-website-docs/base/docs-kr/Cyano/dApi/01-quickstart.md index 2e543975..eb3249ba 100644 --- a/dev-website-docs/base/docs-kr/Cyano/dApi/01-quickstart.md +++ b/dev-website-docs/base/docs-kr/Cyano/dApi/01-quickstart.md @@ -8,17 +8,17 @@ ontology-dapi can be used as CommonJS/ES6 module or directly referencing in web ### Install CommonJS/ES module ``` -npm install ontology-dapi +npm install @ont-dev/ontology-dapi ``` ### Import CommonJS ``` -var client = require('ontology-dapi').client; +var client = require('@ont-dev/ontology-dapi').client; ``` ### Import ES6 module ``` -import { client } from 'ontology-dapi'; +import { client } from '@ont-dev/ontology-dapi'; ``` ### Web require @@ -36,9 +36,11 @@ var client = dApi.client; dApp needs to register itself as a client with the ontology-dapi library to enable the communication. ``` -import { client } from 'ontology-dapi'; +import { client, provider } from '@ont-dev/ontology-dapi'; -client.registerClient({}); +client.registerClient({ + extension: provider.ExtensionType.Cyano + }) ``` ## Usage diff --git a/dev-website-docs/base/docs-kr/Cyano/dApi/02-getting-started.md b/dev-website-docs/base/docs-kr/Cyano/dApi/02-getting-started.md index 3aeb6b80..5aee9e95 100644 --- a/dev-website-docs/base/docs-kr/Cyano/dApi/02-getting-started.md +++ b/dev-website-docs/base/docs-kr/Cyano/dApi/02-getting-started.md @@ -11,13 +11,24 @@ The document is broken down into the following sections: [Architecture](#Architecture) [Ontology dAPI Overview](#ontology-dapi-overview) -+ [dAPI Installation](#dapi-installation) -+ [dAPI Instantiation](#dapi-instantiation) -+ [Example dAPI methods](#example-dapi-methods) - + [Example blockchain methods](#example-blockchain-methods) - + [Example asset methods](#example-asset-methods) - + [Example Smart Contract methods](#example-smart-contract-methods) - + [Example Message methods](#example-message-methods) +- [Overview](#overview) +- [Setting up the Development Environment](#setting-up-the-development-environment) + - [Architecture](#architecture) +- [dAPI Usage](#dapi-usage) + - [dAPI Installation](#dapi-installation) + - [dAPI Instantiation](#dapi-instantiation) + - [Example dAPI methods](#example-dapi-methods) + - [Example blockchain methods](#example-blockchain-methods) + - [Example asset methods](#example-asset-methods) + - [Example Smart Contract Methods](#example-smart-contract-methods) + - [Example Message Methods](#example-message-methods) + - [Running the Demo Project](#running-the-demo-project) + - [How to set gaslimit and gasprice](#how-to-set-gaslimit-and-gasprice) + - [Writing a smart contract for your dApp](#writing-a-smart-contract-for-your-dapp) + - [Compiling and deploying your smart contract](#compiling-and-deploying-your-smart-contract) + - [Compiling your smart contract](#compiling-your-smart-contract) + - [Deploying your Smart Contract](#deploying-your-smart-contract) + - [Testing Smart Contract](#testing-smart-contract) [Running the demo project](#running-the-demo-project) @@ -54,7 +65,7 @@ Please ensure you have the following installed and configured in order to setup The Ontology dAPI is the core API used to interface with the Ontology blockhain when creating a dApp and the repository can be found [here](https://github.com/ontio/ontology-dapi). First you must install the npm package using: ``` -$ npm install ontology-dapi +$ npm install @ont-dev/ontology-dapi ``` #### dAPI Instantiation @@ -62,9 +73,11 @@ $ npm install ontology-dapi To use the dAPI in your project, you need to import the library and then register as a client. Import and register the dAPI using: ``` -import { client } from 'ontology-dapi'; +import { client, provider } from '@ont-dev/ontology-dapi'; -client.registerClient({}); +client.registerClient({ + extension: provider.ExtensionType.Cyano + }) ``` #### Example dAPI methods diff --git a/dev-website-docs/base/docs-kr/QuickGuide/06-dapi-useage.md b/dev-website-docs/base/docs-kr/QuickGuide/06-dapi-useage.md index fb7b9f9e..21ef18be 100644 --- a/dev-website-docs/base/docs-kr/QuickGuide/06-dapi-useage.md +++ b/dev-website-docs/base/docs-kr/QuickGuide/06-dapi-useage.md @@ -40,7 +40,7 @@ Please ensure you have the following installed and configured in order to setup The Ontology dAPI is the core API used to interface with the Ontology blockhain when creating a dApp and the repository can be found [here](https://github.com/ontio/ontology-dapi). First you must install the npm package using: ``` -$ npm install ontology-dapi +$ npm install @ont-dev/ontology-dapi ``` #### dAPI Instantiation @@ -48,9 +48,11 @@ $ npm install ontology-dapi To use the dAPI in your project, you need to import the library and then register as a client. Import and register the dAPI using: ``` -import { client } from 'ontology-dapi'; +import { client, provider } from '@ont-dev/ontology-dapi'; -client.registerClient({}); +client.registerClient({ + extension: provider.ExtensionType.Cyano + }) ``` #### Example dAPI methods diff --git a/dev-website-docs/docs-cn/QuickGuide/00-dapp_development.md b/dev-website-docs/docs-cn/QuickGuide/00-dapp_development.md index 738df30b..3d4a8096 100644 --- a/dev-website-docs/docs-cn/QuickGuide/00-dapp_development.md +++ b/dev-website-docs/docs-cn/QuickGuide/00-dapp_development.md @@ -178,7 +178,7 @@ dAPI 支持 [Web环境](https://github.com/ontio-cyano/cyano-bridge)(仅支持 #### ① Chrome 版 ```shell -npm install ontology-dapi +npm install @ont-dev/ontology-dapi ``` #### ② 移动版 @@ -194,8 +194,11 @@ npm install cyanobridge #### ① Chrome 版 ```javascript -import {client} from 'ontology-dapi' -client.registerClient({}) +import { client, provider } from '@ont-dev/ontology-dapi'; + +client.registerClient({ + extension: provider.ExtensionType.Cyano + }) ``` #### ② 移动版 diff --git a/dev-website-docs/docs-cn/QuickGuide/06-dapi-useage.md b/dev-website-docs/docs-cn/QuickGuide/06-dapi-useage.md index 84ef7839..60e32e44 100644 --- a/dev-website-docs/docs-cn/QuickGuide/06-dapi-useage.md +++ b/dev-website-docs/docs-cn/QuickGuide/06-dapi-useage.md @@ -33,7 +33,7 @@ DAPI是为基于Ontology开发的DAPP提供的轻量级去中心化API,支持D 创建dApp时,Ontology dAPI是与Ontology链交互的核心API之一,可以从这里下载源码。 [这里](https://github.com/ontio/ontology-dapi). 通过 ```npm``` 安装```ontology-dapi``` : ``` -$ npm install ontology-dapi +$ npm install @ont-dev/ontology-dapi ``` #### dAPI 实例 @@ -41,9 +41,11 @@ $ npm install ontology-dapi 创建dAPI 实例时,要先导入库ontology-dapi,并注册客户端: ```typescript -import { client } from 'ontology-dapi'; +import { client, provider } from '@ont-dev/ontology-dapi'; -client.registerClient({}); +client.registerClient({ + extension: provider.ExtensionType.Cyano + }) ``` #### dAPI 方法 diff --git a/dev-website-docs/docs-cn/cyano/03-ontology-dapi.md b/dev-website-docs/docs-cn/cyano/03-ontology-dapi.md index 127950b4..a325ea50 100644 --- a/dev-website-docs/docs-cn/cyano/03-ontology-dapi.md +++ b/dev-website-docs/docs-cn/cyano/03-ontology-dapi.md @@ -10,7 +10,7 @@ 你可以使用 `npm` 进行安装 ```shell -npm install ontology-dapi +npm install @ont-dev/ontology-dapi ``` ### 1.2 CDN 安装 @@ -28,13 +28,13 @@ npm install ontology-dapi ### 2.1 CommonJS ```javascript -var client = require('ontology-dapi').client; +var client = require('@ont-dev/ontology-dapi').client; ``` ### 2.2 ES6 模块 ```javascript -import { client } from 'ontology-dapi'; +import { client } from '@ont-dev/ontology-dapi'; ``` ### 2.3 Web require @@ -48,10 +48,11 @@ import { client } from 'ontology-dapi'; ## 3. 初始化 ```javascript -import { client } from 'ontology-dapi'; +import { client, provider } from '@ont-dev/ontology-dapi'; -var client = dApi.client; -client.registerClient({}); +client.registerClient({ + extension: provider.ExtensionType.Cyano + }) ``` !> `Mobile Provider` 需要注册,`Chrome Provider` 不需要注册。 diff --git a/dev-website-docs/docs-cn/dApp-Integration/03-DAppDocking-use-chrome-extension-wallet.md b/dev-website-docs/docs-cn/dApp-Integration/03-DAppDocking-use-chrome-extension-wallet.md index 90352143..b2a995ec 100644 --- a/dev-website-docs/docs-cn/dApp-Integration/03-DAppDocking-use-chrome-extension-wallet.md +++ b/dev-website-docs/docs-cn/dApp-Integration/03-DAppDocking-use-chrome-extension-wallet.md @@ -30,7 +30,7 @@ 创建 ```DAPP``` 时,本体 ```dAPI``` 是与本体链交互的核心 ```API``` 之一,可以从 [这里](https://github.com/ontio/ontology-dapi) 下载源码。 通过 ```npm``` 安装 ```ontology-dAPI```: ```shell -$ npm install ontology-dapi +$ npm install @ont-dev/ontology-dapi ``` #### 3.2 创建 dAPI 实例 @@ -38,9 +38,11 @@ $ npm install ontology-dapi 创建 ```dAPI``` 实例时,要先导入库 ```ontology-dapi```,并注册客户端,如下所示: ```javascript -import { client } from 'ontology-dapi'; +import { client, provider } from '@ont-dev/ontology-dapi'; -client.registerClient({}); +client.registerClient({ + extension: provider.ExtensionType.Cyano + }) ``` #### 3.3 调用 dAPI 方法 diff --git a/dev-website-docs/docs-cn/dApp-Integration/13-cocos-integration.md b/dev-website-docs/docs-cn/dApp-Integration/13-cocos-integration.md index c87d1059..fe954ee9 100644 --- a/dev-website-docs/docs-cn/dApp-Integration/13-cocos-integration.md +++ b/dev-website-docs/docs-cn/dApp-Integration/13-cocos-integration.md @@ -22,19 +22,19 @@ Cocos2d-x 是一套成熟的开源跨平台游戏开发框架,提供了图形 `ontology-dapi` 是一个用于与 Chrome 钱包插件交互的轻量级 JavaScript 库。 ```bash -$ npm install ontology-dapi -S +$ npm install @ont-dev/ontology-dapi -S ``` 我们可以在游戏场景的脚本中以 ES6 模块的形式导入: ```bash -import { client } from 'ontology-dapi'; +import { client } from '@ont-dev/ontology-dapi'; ``` 我们也可以在游戏场景的脚本中以 CommonJS/ES6 模块的形式导入: ```bash -var client = require('ontology-dapi').client; +var client = require('@ont-dev/ontology-dapi').client; ``` 在完成模块的导入后,我们只需要在场景的加载函数中与浏览器中的 Provide 实例注册即可: diff --git a/dev-website-docs/docs-en/Cyano/dApi/01-quickstart.md b/dev-website-docs/docs-en/Cyano/dApi/01-quickstart.md index fdc30abd..7e0b24c5 100644 --- a/dev-website-docs/docs-en/Cyano/dApi/01-quickstart.md +++ b/dev-website-docs/docs-en/Cyano/dApi/01-quickstart.md @@ -6,17 +6,17 @@ ontology-dapi can be used as CommonJS/ES6 module or directly referencing in web ### Install CommonJS/ES module ``` -npm install ontology-dapi +npm install @ont-dev/ontology-dapi ``` ### Import CommonJS ``` -var client = require('ontology-dapi').client; +var client = require('@ont-dev/ontology-dapi').client; ``` ### Import ES6 module ``` -import { client } from 'ontology-dapi'; +import { client } from '@ont-dev/ontology-dapi'; ``` ### Web require @@ -34,9 +34,11 @@ var client = dApi.client; dApp needs to register itself as a client with the ontology-dapi library to enable the communication. ``` -import { client } from 'ontology-dapi'; +import { client, provider } from '@ont-dev/ontology-dapi'; -client.registerClient({}); +client.registerClient({ + extension: provider.ExtensionType.Cyano + }) ``` ## Usage diff --git a/dev-website-docs/docs-en/Cyano/dApi/02-getting-started.md b/dev-website-docs/docs-en/Cyano/dApi/02-getting-started.md index 593abf2f..2685ebab 100644 --- a/dev-website-docs/docs-en/Cyano/dApi/02-getting-started.md +++ b/dev-website-docs/docs-en/Cyano/dApi/02-getting-started.md @@ -54,7 +54,7 @@ Please ensure you have the following installed and configured in order to setup The Ontology dAPI is the core API used to interface with the Ontology blockhain when creating a dApp and the repository can be found [here](https://github.com/ontio/ontology-dapi). First you must install the npm package using: ``` -$ npm install ontology-dapi +$ npm install @ont-dev/ontology-dapi ``` #### dAPI Instantiation @@ -62,9 +62,11 @@ $ npm install ontology-dapi To use the dAPI in your project, you need to import the library and then register as a client. Import and register the dAPI using: ``` -import { client } from 'ontology-dapi'; +import { client, provider } from '@ont-dev/ontology-dapi'; -client.registerClient({}); +client.registerClient({ + extension: provider.ExtensionType.Cyano + }) ``` #### Example dAPI methods diff --git a/dev-website-docs/docs-en/QuickGuide/06-dapi-useage.md b/dev-website-docs/docs-en/QuickGuide/06-dapi-useage.md index 097bdfca..83ec6f5f 100644 --- a/dev-website-docs/docs-en/QuickGuide/06-dapi-useage.md +++ b/dev-website-docs/docs-en/QuickGuide/06-dapi-useage.md @@ -40,7 +40,7 @@ Please ensure you have the following installed and configured in order to setup The Ontology dAPI is the core API used to interface with the Ontology blockhain when creating a dApp and the repository can be found [here](https://github.com/ontio/ontology-dapi). First you must install the npm package using: ``` -$ npm install ontology-dapi +$ npm install @ont-dev/ontology-dapi ``` #### dAPI Instantiation @@ -48,9 +48,11 @@ $ npm install ontology-dapi To use the dAPI in your project, you need to import the library and then register as a client. Import and register the dAPI using: ``` -import { client } from 'ontology-dapi'; +import { client, provider } from '@ont-dev/ontology-dapi'; -client.registerClient({}); +client.registerClient({ + extension: provider.ExtensionType.Cyano + }) ``` #### Example dAPI methods diff --git a/dev-website-docs/docs-en/dApp-Integration/03-DAppDocking-use-chrome-extension-wallet.md b/dev-website-docs/docs-en/dApp-Integration/03-DAppDocking-use-chrome-extension-wallet.md index b2c528a8..5b011b6c 100644 --- a/dev-website-docs/docs-en/dApp-Integration/03-DAppDocking-use-chrome-extension-wallet.md +++ b/dev-website-docs/docs-en/dApp-Integration/03-DAppDocking-use-chrome-extension-wallet.md @@ -23,7 +23,7 @@ Please make sure the following softwares are installed: When creating a dApp, Ontology DAPI is one of the core APIs for interacting with the Ontology blockchain, and the source code can be downloaded [here](https://github.com/ontio/ontology-dapi). Install Ontology-DAPI via ```npm```: ``` -$ npm install ontology-dapi +$ npm install @ont-dev/ontology-dapi ``` #### DAPI example @@ -31,9 +31,11 @@ $ npm install ontology-dapi When creating a DAPI example, first import ontology-dapi and register as follows: ```typescript -import { client } from 'ontology-dapi'; +import { client, provider } from '@ont-dev/ontology-dapi'; -client.registerClient({}); +client.registerClient({ + extension: provider.ExtensionType.Cyano + }) ``` #### DAPI method diff --git a/dev-website-docs/docs-en/dApp-Integration/13-cocos-integration.md b/dev-website-docs/docs-en/dApp-Integration/13-cocos-integration.md index b861dfad..9145d89d 100644 --- a/dev-website-docs/docs-en/dApp-Integration/13-cocos-integration.md +++ b/dev-website-docs/docs-en/dApp-Integration/13-cocos-integration.md @@ -23,25 +23,27 @@ The ontology-dapi on the desktop browser cannot be used on the mobi ontology-dapi is A lightweight Javascript library for interacting with Chrome Plugin which is integrated provider engine. ```bash -$ npm install ontology-dapi -S +$ npm install @ont-dev/ontology-dapi -S ``` We can use it as ES6 module in our game scene's script. ```JavaScript -import { client } from 'ontology-dapi'; +import { client, provider } from '@ont-dev/ontology-dapi'; ``` We can also use it as CommonJS/ES6 module in our game scene's script. ```JavaScript -var client = require('ontology-dapi').client; +var client = require('@ont-dev/ontology-dapi').client; ``` After we regist with Provider successful, we can use it in our project. ```JavaScript -client.registerClient({}); +client.registerClient({ + extension: provider.ExtensionType.Cyano + }) ``` ### Mobile Phone diff --git a/dev-website-docs/docs-kr/Cyano/dApi/01-quickstart.md b/dev-website-docs/docs-kr/Cyano/dApi/01-quickstart.md index 2e543975..eb3249ba 100644 --- a/dev-website-docs/docs-kr/Cyano/dApi/01-quickstart.md +++ b/dev-website-docs/docs-kr/Cyano/dApi/01-quickstart.md @@ -8,17 +8,17 @@ ontology-dapi can be used as CommonJS/ES6 module or directly referencing in web ### Install CommonJS/ES module ``` -npm install ontology-dapi +npm install @ont-dev/ontology-dapi ``` ### Import CommonJS ``` -var client = require('ontology-dapi').client; +var client = require('@ont-dev/ontology-dapi').client; ``` ### Import ES6 module ``` -import { client } from 'ontology-dapi'; +import { client } from '@ont-dev/ontology-dapi'; ``` ### Web require @@ -36,9 +36,11 @@ var client = dApi.client; dApp needs to register itself as a client with the ontology-dapi library to enable the communication. ``` -import { client } from 'ontology-dapi'; +import { client, provider } from '@ont-dev/ontology-dapi'; -client.registerClient({}); +client.registerClient({ + extension: provider.ExtensionType.Cyano + }) ``` ## Usage diff --git a/dev-website-docs/docs-kr/Cyano/dApi/02-getting-started.md b/dev-website-docs/docs-kr/Cyano/dApi/02-getting-started.md index 3aeb6b80..e63a86eb 100644 --- a/dev-website-docs/docs-kr/Cyano/dApi/02-getting-started.md +++ b/dev-website-docs/docs-kr/Cyano/dApi/02-getting-started.md @@ -54,7 +54,7 @@ Please ensure you have the following installed and configured in order to setup The Ontology dAPI is the core API used to interface with the Ontology blockhain when creating a dApp and the repository can be found [here](https://github.com/ontio/ontology-dapi). First you must install the npm package using: ``` -$ npm install ontology-dapi +$ npm install @ont-dev/ontology-dapi ``` #### dAPI Instantiation @@ -62,9 +62,11 @@ $ npm install ontology-dapi To use the dAPI in your project, you need to import the library and then register as a client. Import and register the dAPI using: ``` -import { client } from 'ontology-dapi'; +import { client, provider } from '@ont-dev/ontology-dapi'; -client.registerClient({}); +client.registerClient({ + extension: provider.ExtensionType.Cyano + }) ``` #### Example dAPI methods diff --git a/dev-website-docs/docs-kr/QuickGuide/06-dapi-useage.md b/dev-website-docs/docs-kr/QuickGuide/06-dapi-useage.md index fb7b9f9e..8f8bbeeb 100644 --- a/dev-website-docs/docs-kr/QuickGuide/06-dapi-useage.md +++ b/dev-website-docs/docs-kr/QuickGuide/06-dapi-useage.md @@ -7,13 +7,22 @@ The document is broken down into the following sections: [Setting up the development environment](#setting-up-the-development-environment) [Ontology dAPI Overview](#ontology-dapi-overview) -+ [dAPI Installation](#dapi-installation) -+ [dAPI Instantiation](#dapi-instantiation) -+ [Example dAPI methods](#example-dapi-methods) - + [Example blockchain methods](#example-blockchain-methods) - + [Example asset methods](#example-asset-methods) - + [Example Smart Contract methods](#example-smart-contract-methods) - + [Example Message methods](#example-message-methods) +- [Setting up the Development Environment](#setting-up-the-development-environment) +- [Ontology dAPI Overview](#ontology-dapi-overview) + - [dAPI Installation](#dapi-installation) + - [dAPI Instantiation](#dapi-instantiation) + - [Example dAPI methods](#example-dapi-methods) + - [Example blockchain methods](#example-blockchain-methods) + - [Example asset methods](#example-asset-methods) + - [Example Smart Contract Methods](#example-smart-contract-methods) + - [Example Message Methods](#example-message-methods) +- [Running the Demo Project](#running-the-demo-project) + - [How to set gaslimit and gasprice](#how-to-set-gaslimit-and-gasprice) +- [Writing a smart contract for your dApp](#writing-a-smart-contract-for-your-dapp) + - [Compiling and deploying your smart contract](#compiling-and-deploying-your-smart-contract) + - [Compiling your smart contract](#compiling-your-smart-contract) + - [Deploying your Smart Contract](#deploying-your-smart-contract) +- [Testing Smart Contract](#testing-smart-contract) [Running the demo project](#running-the-demo-project) @@ -40,7 +49,7 @@ Please ensure you have the following installed and configured in order to setup The Ontology dAPI is the core API used to interface with the Ontology blockhain when creating a dApp and the repository can be found [here](https://github.com/ontio/ontology-dapi). First you must install the npm package using: ``` -$ npm install ontology-dapi +$ npm install @ont-dev/ontology-dapi ``` #### dAPI Instantiation @@ -48,9 +57,11 @@ $ npm install ontology-dapi To use the dAPI in your project, you need to import the library and then register as a client. Import and register the dAPI using: ``` -import { client } from 'ontology-dapi'; +import { client, provider } from '@ont-dev/ontology-dapi'; -client.registerClient({}); +client.registerClient({ + extension: provider.ExtensionType.Cyano + }) ``` #### Example dAPI methods diff --git a/prod-doc/en/README.md b/prod-doc/en/README.md new file mode 100644 index 00000000..16d2d605 --- /dev/null +++ b/prod-doc/en/README.md @@ -0,0 +1,28 @@ +# Welcome + +1. [ONT ID](./ontid/framework/README.md) + + - [Scenarios](./ontid/business/scenarios/README.md) + - [Solutions](./ontid/business/solutions/README.md) + + | Component | Link | Github | Docker | SaaS | Source | + | -------------- | -------- | -------- | -------- | -------- | -------- | + | Signing server | [...](./ontid/framework/signing-server/README.md) | |TODO|[...](./ontid/framework/signing-server/saas-tenant.md)|[MovieBloc](http://moviebloc.io/)| + | Claim store | [...](./ontid/framework/claim-store/README.md) | |TODO||| + | Trust anchor | [...](./ontid/framework/trust-anchor/README.md) | |TODO||[SenseTime](https://www.sensetime.com)| + | ONT Auth | [...](./ontid/framework/ont-auth/guide/README.md) | |||| + +2. [DDXF](./ddxf/framework/README.md) + - [Scenarios](./ddxf/business/scenarios/README.md) + - [Solutions](./ddxf/business/solutions/README.md) + + | Component | Link | Github | Docker | SaaS | Source | + | -------------- | -------- | -------- | -------- | -------- | -------- | + | Marketplace | [...](./ddxf/framework/marketplace/README.md) | |TODO|[...](./ddxf/framework/marketplace/saas-tenant.md)|[MovieBloc](http://moviebloc.io/)| + | Resource audit | [...](./ddxf/framework/resource-audit/README.md) | |TODO||| + | Data storage | [...](./ddxf/framework/data-storage/README.md) | |||ONS | + +3. Usecases + 1. Moviebloc + 2. Openbase + diff --git a/prod-doc/en/ddxf/business/scenarios/README.md b/prod-doc/en/ddxf/business/scenarios/README.md new file mode 100644 index 00000000..99c5a68c --- /dev/null +++ b/prod-doc/en/ddxf/business/scenarios/README.md @@ -0,0 +1,26 @@ +# Scenarios for DDXF + +DDXF is to resolve data interoperability cross off-chain systems, with on-chain technique to provide data privacy protection, data traceability for data processing and management. + +## Resource and data + +1. [Resource preparation](./resource-preparation.md) + - 有价值的数据确认 + - 数据权限划分 + - 数据通证化 + - 数据通证价值评估 +2. [Resource publish](./resource-publish.md) + - 数据通证交易、交换方式确定 + - 链外数据纠纷的电子合同仲裁方案 +3. [Resource transaction](./resource-transaction.md) + - 数据交易集市接入 + - 数据加工跟踪和分成 +4. [Resource incentive share](./resource-incentive-share.md) +5. [Transaction evaluation](./tx-evaluation.md) + +## Users & smart devices + +1. [Data storage](./data-storage/README.md) +2. [Marketplace](./marketplace/README.md) +3. [Trust audit](./trust-audit/README.md) + diff --git a/prod-doc/en/ddxf/business/scenarios/data-storage/README.md b/prod-doc/en/ddxf/business/scenarios/data-storage/README.md new file mode 100644 index 00000000..0462913c --- /dev/null +++ b/prod-doc/en/ddxf/business/scenarios/data-storage/README.md @@ -0,0 +1,9 @@ +# Scenarios for data storage provider + +1. [Resource-data mapping and upload](./upload.md) +2. [Generate data identifier](./generate-id.md) +3. Enable [data-token accessibility](./token-access.md) + 1. bind marketplace with data identifier + 2. generate JWT after data-token + 3. verify JWT by data owner/marketplace and data-token owner + 4. access data/resource with pre-defined data-token diff --git a/prod-doc/en/ddxf/business/scenarios/data-storage/generate-id.md b/prod-doc/en/ddxf/business/scenarios/data-storage/generate-id.md new file mode 100644 index 00000000..48c08996 --- /dev/null +++ b/prod-doc/en/ddxf/business/scenarios/data-storage/generate-id.md @@ -0,0 +1,9 @@ +# Generate data identifier for data and resource(s) + +通过 MP 提供的 [API](../../../framework/data-storage/restful-api.md#注册dataId) 或者 MP-SDK 方法为数据生成DataId,通过Onto Auth 扫码签名进行上链操作,API 或 SDK 方法会返回生成二维码参数 + +示例二维码 + +![a](../../../res/ontid_qrcode.png) + +再通过 marketplace 提供的 [API](../../../framework/data-storage/restful-api.md#查询注册的dataId及结果) 接口或 SDK 方法,查询是否成功,成功之后,平台方需自己进行 dataid 与 数据资源的绑定 \ No newline at end of file diff --git a/prod-doc/en/ddxf/business/scenarios/data-storage/token-access.md b/prod-doc/en/ddxf/business/scenarios/data-storage/token-access.md new file mode 100644 index 00000000..28e04831 --- /dev/null +++ b/prod-doc/en/ddxf/business/scenarios/data-storage/token-access.md @@ -0,0 +1,3 @@ +# Use DToken to access data and resource(s) + +// TODO \ No newline at end of file diff --git a/prod-doc/en/ddxf/business/scenarios/data-storage/upload.md b/prod-doc/en/ddxf/business/scenarios/data-storage/upload.md new file mode 100644 index 00000000..d13f2529 --- /dev/null +++ b/prod-doc/en/ddxf/business/scenarios/data-storage/upload.md @@ -0,0 +1,6 @@ +# Resource mapping and data upload + +RP 上传的资源数据需要平台方自己开发存储方案,而后通过 marketplace 提供的 API 或者 SDK 方法生成DataId 之后,平台方进行数据与 ID 的绑定 + +[可参考](../../solutions/data-storage.md) + diff --git a/prod-doc/en/ddxf/business/scenarios/marketplace/README.md b/prod-doc/en/ddxf/business/scenarios/marketplace/README.md new file mode 100644 index 00000000..f79c153f --- /dev/null +++ b/prod-doc/en/ddxf/business/scenarios/marketplace/README.md @@ -0,0 +1,10 @@ +# Scenarios for marketplace + +DDXF is to resolve data interoperability cross off-chain systems, with on-chain technique to provide data privacy protection, data traceability for data processing and management. + +1. accept resource [publish](./publish.md) from resource provider + 1. [pay-as-you-go mode](./pay-as-you-go.md) + 2. [pre-order mode](./pre-order.md) +2. [token transfer and exchange](./exchange.md) +3. [share](./share.md) after certain challenge period +4. [evaluation on transaction](./evaluate.md) diff --git a/prod-doc/en/ddxf/business/scenarios/marketplace/evaluate.md b/prod-doc/en/ddxf/business/scenarios/marketplace/evaluate.md new file mode 100644 index 00000000..6bf350dc --- /dev/null +++ b/prod-doc/en/ddxf/business/scenarios/marketplace/evaluate.md @@ -0,0 +1,3 @@ +# Transaction evaluate + +// TODO \ No newline at end of file diff --git a/prod-doc/en/ddxf/business/scenarios/marketplace/exchange.md b/prod-doc/en/ddxf/business/scenarios/marketplace/exchange.md new file mode 100644 index 00000000..dce1d662 --- /dev/null +++ b/prod-doc/en/ddxf/business/scenarios/marketplace/exchange.md @@ -0,0 +1,66 @@ +# DToken-utility token exchange + +#### 生成Token + +eshop 模式下,正式上传数据之前,为生成Token提供基本字段和数据,比如生成Token数量,调用DToken合约,通过Onto Auth 扫码签名进行上链操作 + +可参考[合约字段](../../../framework/data-storage/smart-contract-api.md) + +```js +{ + dataId: "did:ont:aaaaaaa", // 数据的ontid + ontid: ontid, // RP的ontid + pubKey: 1, + contractVo: { + argsList: [{ + name: "account", + value: "Address:aaaaaaa" // 钱包地址 + }, { + name: "dataId", + value: "String:" + dataId // 数据的ontid + }, { + name: "ontid", + value: "String:" + ontid // RP的ontid + }, { + name: "index", + value: 1 + }, { + name: "symbol", + value: "String:aaa" + }, { + name: "name", + value: "String:aaa" + }, { + name: "amount", // Token生成数量 + value: 12 + }, { + name: 'transferCount', + value: 12 + }, { + name: 'accessCount', + value: 12 + }, { + name: 'expireTime', + value: 16121212 // Token 的过期时间 + }], + contractHash: "06633f64506fbf7fd4b65b422224905d362d1f55", // 合约哈希 + method: "createTokenWithController", // 合约方法 + } +} +``` + +通过 marketplace 提供的 [API](../../../framework/data-storage/restful-api.md#生成tokenId) 或 SDK 方法获取二维码参数 + +示例二维码 + +![a](../../../res/ontid_qrcode.png) + +再通过 [API](../../../framework/data-storage/restful-api.md#查询生成的tokenId及结果) 查询生成结果 + +DataId与Token绑定之后,选择上传Token的数量等,正式进行数据的上传操作 + + + +#### Token 及数据资源的购买 + +RC 选择需要购买的数据,仲裁方以及购买Token的数量,进行下单操作,data模式下,会在购买时生成对应的Token,购买完成后 Token 的所有权归 RC 所有。 \ No newline at end of file diff --git a/prod-doc/en/ddxf/business/scenarios/marketplace/pay-as-you-go.md b/prod-doc/en/ddxf/business/scenarios/marketplace/pay-as-you-go.md new file mode 100644 index 00000000..0bb8c73a --- /dev/null +++ b/prod-doc/en/ddxf/business/scenarios/marketplace/pay-as-you-go.md @@ -0,0 +1,11 @@ +# Pay as you go mode of marketplace + +- RP 预上传数据之后,需要生成 Dataid 实现与数据的绑定 +- RP 上传数据(填写生成 Token 所需参数) + - [可参照](../../solutions/marketplace.md) +- RC 在平台方执行购买操作,同时会包含 Token 的生成,此时 Token 所有权即归 RC 所有 + - [可参照](../resource-publish.md) +- RC 可凭借此 Token 访问资源的元数据 +- 购买操作完成时,交易费用均按照流程已分配完成 + - [可参照](../../../framework/marketplace/smart-contract-api.md) + diff --git a/prod-doc/en/ddxf/business/scenarios/marketplace/pre-order.md b/prod-doc/en/ddxf/business/scenarios/marketplace/pre-order.md new file mode 100644 index 00000000..1f480f5f --- /dev/null +++ b/prod-doc/en/ddxf/business/scenarios/marketplace/pre-order.md @@ -0,0 +1,8 @@ +# Pre-order mode of marketplace + +- RP 预上传数据之后,需要生成 Dataid 实现与数据的绑定 +- Dataid生成之后,需传递参数生成 DToken ,参数包括 token 生成数量等 +- Dataid 与 Dtoken 绑定之后,完善所需上传所需参数,实现上传步骤 +- RC 购买时,可以选择购买当前资源所有的 Token,还是购买 一定数量的 Token +- RC 可凭借此 Token 访问资源的元数据 +- 购买操作完成时,交易费用均按照流程已分配完成 \ No newline at end of file diff --git a/prod-doc/en/ddxf/business/scenarios/marketplace/publish.md b/prod-doc/en/ddxf/business/scenarios/marketplace/publish.md new file mode 100644 index 00000000..26a640b4 --- /dev/null +++ b/prod-doc/en/ddxf/business/scenarios/marketplace/publish.md @@ -0,0 +1,9 @@ +# Publish resource(s) in marketplace + +1. verify data quality +2. publish meta +3. publish cost +4. lock liquidated damages to marketplace smart contract +5. define e-contract offline judger candidate list +6. publish + diff --git a/prod-doc/en/ddxf/business/scenarios/marketplace/share.md b/prod-doc/en/ddxf/business/scenarios/marketplace/share.md new file mode 100644 index 00000000..05f6a29d --- /dev/null +++ b/prod-doc/en/ddxf/business/scenarios/marketplace/share.md @@ -0,0 +1,14 @@ +# Transaction sharing + +1. Dispute arbitration + 1. Utility token + 1. resource provider + 2. resource consumer + 3. offline judger + 4. marketplace +2. Success + 1. Utility token + 1. resource provider + 2. marketplace + 2. DToken + 1. resource consumer diff --git a/prod-doc/en/ddxf/business/scenarios/resource-incentive-share.md b/prod-doc/en/ddxf/business/scenarios/resource-incentive-share.md new file mode 100644 index 00000000..1e80b50d --- /dev/null +++ b/prod-doc/en/ddxf/business/scenarios/resource-incentive-share.md @@ -0,0 +1,56 @@ +# Resource incentive share + +订单锁定期之后,即链外资源处置期截止之后,交易会进入分润阶段。分润主要在交易双方、MP 以及 OJ 等角色之间进行。分润是一个相对广义的概念,比如返回双方质押 Token、分发交易手续费给MP 等。数据交易的任一方均可以触发分润操作,会根据即定逻辑进行判断自动分润。分润逻辑以智能合约实现。 + +- 如果没有纠纷,当锁定期结束时,触发自动分润行为; +- 若发生了仲裁行为,那么根据仲裁结果,当锁定期结束时,触发自动分润行为。 + +交易成功、终止或作恶惩罚都是分润的一种形式。 + +交易成功或失败的条件形式化地定义了交易可能出现的状态以及对应的判断,以此执行相应的分润策略。例如,分润策略定义 RP 产生欺骗时,将在产生纠纷时罚没 RP 质押 Token。那么,当 OJ 判定 RP 没有提供资源并将此结果输入交易的智能合约时,智能合约将做相应处理。 + + + + + +#### 分润策略 + +1. 无仲裁,正常分润 + + * MP 平台方通过合约设置平台 `手续费百分比`、`押金百分比`、`仲裁手续费百分比` + * 上架资源时,RP 需支付 `资源押金`,RC 购买时需支付`平台手续费` 及 `资源费用` + + 最终,无纠纷时 + + * RP 得到资源押金及资源费用 + * RC 得到资源Token + * MP 平台方得到手续费 + + + +2. 有仲裁,根据结果进行分润 + +- MP 平台方通过合约设置平台 `手续费百分比`、`押金百分比`、`仲裁手续费百分比` +- 上架资源时,RP 需支付 `资源押金`,RC 购买时需支付`平台手续费` 及 `资源费用` +- 一方发起仲裁,仲裁手续费需由发起的那一方进行支付,费用通过接口质押到 MP仲裁合约之中 +- 若发起方被 OJ 判定失败,则最终仲裁手续费归 OJ 所有,RC 事先支付的商品费用由 OJ 通过 MP仲裁合约接口设置分发比例后分发给双方,MP 平台方最终得到 RC 购买时支付方手续费 + + + +```js +资源押金 = 资源价格 * 押金百分比 + +平台手续费 = 资源价格 * 平台手续费百分比 + +仲裁手续费 = 资源价格 * 仲裁手续费 +``` + + + +#### 实施方案 + +- OJ 需 RC 购买时提供 +- 一般情况下,由 RC 发起仲裁 + +[具体可见](../solutions/offline-judger.md) + diff --git a/prod-doc/en/ddxf/business/scenarios/resource-preparation.md b/prod-doc/en/ddxf/business/scenarios/resource-preparation.md new file mode 100644 index 00000000..7b85cfa2 --- /dev/null +++ b/prod-doc/en/ddxf/business/scenarios/resource-preparation.md @@ -0,0 +1,42 @@ +# Resource prepare + +RP 针对需要发布的资源在区块链上为其生成一个 ONT ID 以及相应的 DDO 信息,作为资源在链上的映射。 + +RP 在发布资源前可以邀请具有一定权威性的 RA 对即将发布的资源进行认证,以提高资源在市场上的可信任度。一般来说,高可信任度的资源将拥有更多的潜在买家以及可能获得更高的报酬,在交易市场上也更容易被检索到。资源认证通过 RA 对相关资源颁发 ONT Claim 的方式进行,也可以将实体证书通过 ONT Sourcing 直接上链存证。 + +交易市场 MP 会针对特定资源给出一些相应的元信息模板,方便 RP 在发布数据时简便地进行元信息提取。例如,某个医疗数据交易市场会给出相应的医疗数据元数据模板。RP 准备在某个交易市场 MP 上进行数据交易时,根据该 MP 的模板为即将发布的资源生成相应的元信息,以供 RC 检索和选择。交易市场 MP 在制定元信息模板的组织形式时,应满足一定的规范,并作出相应说明。 + +MP 根据其交易资源的特性,确定定价体系。RP 以 MP 认可的方式确定定价策略并提交,常见的定价方式有一口价、协商定价、拍卖等。再一次地,我们强调资源交易的实质是资源相关权利的转移。 + + + +1. 数据的价值确认 + + RP 提供资源后,通过marketplace 提供的资源认证 API或者平台方自定义的数据存储 到 RA 中,RA 可以通过 Trust Anchor 进行对相关数据的资源认证,亦或者是将实体证书通过 ONT Sourcing 直接上链存证。资源认证成功后,资源方可进行数据的通证化。 + + [可参考](../solutions/resource-auditor.md) + + + +2. 数据通证化 + + RP 申请对资源进行价值确认或认证之后,可以通过 MP 进行对资源的通证化 (Token化),MP 所进行的数据的转换就是 Token 的流转 + + [可参考](./resource-publish.md) + + + +3. 数据权限划分 + + 根据 DToken 合约规定,将数据 token 化时,需要传递 RP 的 accout、资源的dataid、控制人的 ONTID 等,实现对人、财、物、事的绑定,传入的控制人拥有对数据的控制权限,资源的交易实质就是 Token 权限的转换,RC 购买Token之后,可以凭借此Token查看数据的具体信息。 + + [DToken 合约](../../framework/data-storage/smart-contract-api.md) + + + +4. 数据通证价值评估 + + 资源通过RA认证之后,再将资源通证化(Token化),在保证资源符合有权威的第三方认证之后,可以通过对数据通证的流转次数的判定,来对其价值进行进一步的评估,可参照 openbase 荣誉价值体系,通过荣誉值合约的裁定,来给Token制定一些列的价值体系。 + + + diff --git a/prod-doc/en/ddxf/business/scenarios/resource-publish.md b/prod-doc/en/ddxf/business/scenarios/resource-publish.md new file mode 100644 index 00000000..d0ceb67e --- /dev/null +++ b/prod-doc/en/ddxf/business/scenarios/resource-publish.md @@ -0,0 +1,39 @@ +# Resource publish + +RP 将资源发布到某个 MP,等待 RC 购买。发布的内容包括资源的 DID/DDO 信息、元信息、待转移的权利、定价策略以及某个或某几个三方认证中心对该资源的认证信息(如果该资源有)等。MP将资源元信息等存入本地数据库,并做检索优化。MP 也将从链上取得相关交易历史信息和认证信息等进行展示。 + +用户和资源在历史交易中所得的评价将在一定的分布式声誉体系下转换成相应的评价分数,该评价得分会影响用户或资源在交易市场上的排名,进而会影响交易成交的可能性。 + +存在多个 MP,比如医疗数据交易市场,古董拍卖交易市场。每个交易市场接受不同类型的资源发布,同一资源也可以发布到不同的交易市场。 + + + + + +#### 数据通证交易、交换方式确定 + +1. [生成token,实现数据通证化](../../framework/data-storage/restful-api) + + * eshop 模式 + * DToken 的初始持有者即为 RC,随后该 DToken 可被(签发交易)流转给其他人。RP 在 DToken 时可以生成设定其流转次数限制,每次流转时该次数递减,流转次数为 0 即表示不可流转。 + * 在资源正式上传之前,为生成Token提供基本字段和数据,比如生成Token数量、资源权利的有限期等,通过 marketplace 提供的 SDK 调用 DToken 合约 ,而后生成具体的Token,实现人、财、物的绑定,方可进行签发交易流转流程。 + + * data 模式 + * 资源上传时,RP 需要把生成 Token 的参数一起补充完整后上传,而后 RC 在执行购买操作时,通过 marketplace 提供时 SDK 的方法调用 DToken 合约及 MP 购买合约 + +2. 交换方式 + + marketplace 提供了数据链上查询的 SDK ,平台方需要融合进自己的项目之中,能够让用户查看到数据的描述信息,平台方可自定义交换方式,比如线上或线下交易Token。 + +#### 链外数据纠纷的电子合同仲裁方案 + +1. RC 执行购买操作之后既可拥有该 Token 的所有权限,当 RC 申请仲裁时,MP 仲裁合约会质押此 Token , 当 OJ 判定 RP 没有提供资源并将此结果输入交易的智能合约时,智能合约将做相应处理。 + +---- + + + +[Token 规范](../../framework/spec/data-token.md) + + + diff --git a/prod-doc/en/ddxf/business/scenarios/resource-transaction.md b/prod-doc/en/ddxf/business/scenarios/resource-transaction.md new file mode 100644 index 00000000..1f275ce9 --- /dev/null +++ b/prod-doc/en/ddxf/business/scenarios/resource-transaction.md @@ -0,0 +1,58 @@ +# Resource transaction + +经过资源发现阶段,即 RC 在 MP 处根据资源元信息等快速检索到所需资源,将和资源的拥有方 RP 进行交易。资源交易阶段大致以下部分: + +1. 下单:在经过资源发现阶段之后,RC 在 MP 处根据资源元信息快速检索到所需资源,双方经由 ONT Sign 签订的资源交易电子合同,设置交易标的物(如资源的使用权),交易细则,(可选的) 双方质押信息,(可选的)交易锁定期和纠纷处理逻辑,分润逻辑等,并具现化智能合约。为了防止作恶,RP 和 RC 根据电子合同分别质押一定数量(可能为 0)的代币; +2. 链上交易:RP 为该笔资源交易在区块链上生成相对应的 DToken,并将该 DToken 交易给 RC。 另外,RP 也可以进行相关委托,授权 MP 进行相应 DToken 的生成。RC 可以根据合同约定流转该 DToken: + 1. 当 DToken 不涉及链下资源交割时,可采用原子交易的形式,并不设置交易锁定期; + 2. 当交易是资源易资源的形式时,RC 也将为待交易资源生成 DToken。当然该 DToken 也可以采取委托 MP 的形式进行处理。DToken 之间可采用原子交易的形式,并可根据是否需要链下交割设置交易锁定期; + 3. 当交易是资源易代币(例如 ONG)的形式时,代币一方将交易所需数量的代币抵押至交易合约中,并根据是否需要链下交割设置交易锁定期。 + +![res-pub-stage.png](../../res/res-pub-stage.png) + +3. 链外资源处置:链上交易完成后,进入交易锁定期。在交易锁定期内,RC 凭借该 DToken 和 RP对资源进行交割,即对资源进行相应的权利处置。当产生纠纷时,需要提交证明来解决纠纷。证明分为链上(on-chain proof)与链下证明(off-chain proof)。证明可来源于本体主链自身、Ontology Oracle 以及合约所指定的 OJ 等。 + +## 1. 电子合同 + +在经过资源发现阶段之后,RC 在 MP 处根据资源元信息快速检索到所需资源,双方可经由 ONT Sign 签订相关的资源交易电子合同。当整个资源交易的过程不涉及 OJ,即不需要 OJ 来进行链下判 定时,可以不签署电子合同。 + +MP 可以根据其可交易资源的特性,设置电子合同模板来指导其用户快捷地签订电子合同。一般 来说,电子合同主要包括如下内容: + +- 交易标的物。交易标的物是某资源的某项权利。 +- 交易方。主要指定交易的 RP 和 RC。 +- 交易细则。主要约定易标的物交付期限、交付阶段、交付方式等。 +- (可选的) 交易锁定期和纠纷处理逻辑。当涉及链下资源交割处置时,建议设置交易锁定期,并设定纠纷处理逻辑。交易锁定期内,交易双方可以进行链下的资源权利交割。当链下交易出现纠纷时,按照纠纷处理逻辑进行纠纷解决,并将纠纷处置结果上链。一般地,纠纷处置结果的上链由 OJ 进行。另外,Ontology Oracle 亦可用于链外纠纷解决。 +- (可选的) 双方质押信息。约定交易双方是否需要质押一定量的代币。一般来说,RC 会被要求质押至少与获取交易标的所需代价等价的代币来使交易顺利履行。有时候,RP 也可能会被要求质押一定量的代币以防止其作恶。 +- 分润逻辑。主要约定交易完成后如何进行分润。交易被中止或取消也认为是一种完成方式。分润主要在交易双方、MP 以及 OJ 等角色之间进行。 + +## 2. 交易智能合约 + +交易智能合约由双方签订的电子合同具现而来。当双方无需签订电子合同时,可直接部署交易智能合约。类似的,MP 可以提供相应的交易智能合约模板。一般地,MP 会帮助交易双方部署相应的交易合约。 + +交易智能合约记录了交易双方 RC 和 RP 的 ONT ID,OJ 的 ONT ID,以及经由 ONT Sign 签订的电子合同的信息,例如:交易金额,结算币种(e.g. ONG 或 OEP-4 Token),交易成功或失败的条件,交易锁定期和自动化分润策略等。RC 下单成功之后,会返回一个唯一的交易编号。 + +为了进行链下资源交割、限制作恶和解决可能产生的链下纠纷,设置交易锁定期,该期限可以以区块高度界定或者现实时间界定。交易锁定期可以定义为双方链上交易结束为开始,到分润阶段开始为结束。该期限内,可以进行链外资源处置,以及(可能的)纠纷产生后的相应处置。链下纠纷由 OJ 在纠纷产生时进行仲裁,并由其或其代理提交证明给交易智能合约。 + +在执行交易时,资源对应 [DToken](../../framework/spec/data-token.md)。 + +## 3. 纠纷处置 +在交易锁定期内,RC 凭借该 DToken 和 RP 对资源进行交割,即对资源进行相应的权利处置。交易锁定期内由于资源相关权利交割的不顺畅可能会产生纠纷。 + +通常情况下,由于自动分润逻辑一般会在交易锁定期结束后将 RC 的交易费用传给 RP,因此交易纠纷的处置一般会由 RC 发起。交易纠纷仲裁的发起人需要质押一比交易纠纷申请费用,此费用也可于交易成立时以质押金的形式就进行支付。纠纷仲裁失败一方将付相关费用以及可能的罚没金。 + +当交易纠纷处理结果裁定发起人失败,将使用交易纠纷申请费用支付所需的仲裁费用;另一方失败,一般使用其抵押金进行支付。 + +针对一比交易,一般以一次纠纷处置认定的结果为准。 + +当交易产生纠纷时,需要提交证明来解决纠纷。区块链的不可篡改性、公开透明性,以及合约自动执行的特性,有助于增加数据交易过程的透明性,能够记录分歧的过程,方便交易双方(RP 与 RC) 提交必要的证明。为了加速交易的处理速度以及自动化程度,需要定义交易成功或失败的条件。例如: + +- RP 资源在交易锁定期期限内是否可访问,如果 RP 提供不了这个证明,交易会失败; +- RP 提交了 RC 对资源处置的记录证明,交易则会成功。 + +每个条件都对应一个验证逻辑。当产生纠纷时,需要提交证明来解决纠纷。证明分为链上证明(On-chain Proof)与链下证明(Off-chain Proof)。 + +- 链上证明的验证直接由区块链节点完成,常见的链上证明包含数字签名、Hash 函数的原像、零知识证明以及 Merkle Proof 等等。通过 Ontology Oracle 导入到链上的链外信息也可以认为是链上证明,由相关处理逻辑进行处理; +- 当出现链上无法处理的纠纷时,需要 OJ 完成对链下证明的验证,OJ 依据双方经由 ONT Sign 签订的电子合同完成对链下事务的确认并进行仲裁,将仲裁结果送入交易的智能合约,仲裁结果即是纠纷认定的一部分。 + +纠纷责任认定的证据,无论是链上证据还是链下证据,都会影响纠纷责任认定结果,进而将影响交易的分润。纠纷责任的认定可能会提前触发分润。 + diff --git a/prod-doc/en/ddxf/business/scenarios/trust-audit/README.md b/prod-doc/en/ddxf/business/scenarios/trust-audit/README.md new file mode 100644 index 00000000..4fe9b172 --- /dev/null +++ b/prod-doc/en/ddxf/business/scenarios/trust-audit/README.md @@ -0,0 +1,11 @@ +# Scenarios for trust audit + + +- Resource auditor + + - [audit](./audit.md) +- e-Contract and agreement + + - [sign contract](./econtract.md) + - [offline judge](./o-judge.md) + diff --git a/prod-doc/en/ddxf/business/scenarios/trust-audit/audit.md b/prod-doc/en/ddxf/business/scenarios/trust-audit/audit.md new file mode 100644 index 00000000..22047c41 --- /dev/null +++ b/prod-doc/en/ddxf/business/scenarios/trust-audit/audit.md @@ -0,0 +1,3 @@ +# Audit qualification of resource + +// TODO \ No newline at end of file diff --git a/prod-doc/en/ddxf/business/scenarios/trust-audit/econtract.md b/prod-doc/en/ddxf/business/scenarios/trust-audit/econtract.md new file mode 100644 index 00000000..752a30f3 --- /dev/null +++ b/prod-doc/en/ddxf/business/scenarios/trust-audit/econtract.md @@ -0,0 +1,3 @@ +# EContract + +// TODO \ No newline at end of file diff --git a/prod-doc/en/ddxf/business/scenarios/trust-audit/o-judge.md b/prod-doc/en/ddxf/business/scenarios/trust-audit/o-judge.md new file mode 100644 index 00000000..0ae3bd17 --- /dev/null +++ b/prod-doc/en/ddxf/business/scenarios/trust-audit/o-judge.md @@ -0,0 +1,3 @@ +# Offline judgement + +// TODO \ No newline at end of file diff --git a/prod-doc/en/ddxf/business/scenarios/tx-evaluation.md b/prod-doc/en/ddxf/business/scenarios/tx-evaluation.md new file mode 100644 index 00000000..38da855b --- /dev/null +++ b/prod-doc/en/ddxf/business/scenarios/tx-evaluation.md @@ -0,0 +1,6 @@ +# Transaction evaluation + +在交易完成后,RP 和 RC 进行双方互相评价, 评价可以针对资源或者用户。MP 可以提供相应的评价体系,交易评价存放在 MP 本地数据库中。在链上评价体系完备以后,MP 可以采用链上评价体系和本地评价体系相结合的方式,作出更精准的评价展现。 + + + diff --git a/prod-doc/en/ddxf/business/solutions/README.md b/prod-doc/en/ddxf/business/solutions/README.md new file mode 100644 index 00000000..1563c6a4 --- /dev/null +++ b/prod-doc/en/ddxf/business/solutions/README.md @@ -0,0 +1,14 @@ +# DDXF Solution + +- [Marketplace](./marketplace.md) + - [Qualified customer](./mp/id.md) + - [Traditional e-commerce](./mp/eshop.md) + - [General data](./mp/data.md) +- [Data storage](./data-storage.md) +- [Resource auditor](./resource-auditor.md) and [Offline judger](./offline-judger.md) + +## Usecases + +- Openbase +- Moviebloc +- ... \ No newline at end of file diff --git a/prod-doc/en/ddxf/business/solutions/data-storage.md b/prod-doc/en/ddxf/business/solutions/data-storage.md new file mode 100644 index 00000000..b2dfb1b5 --- /dev/null +++ b/prod-doc/en/ddxf/business/solutions/data-storage.md @@ -0,0 +1,73 @@ +# Solution for data storage provider + +For detail and technology support, please contact Ontology dev team. + +## 1. Enable data storage for resources + +提供资源的具体信息,包括资源的元信息,以及数据的认证方、数据的价格(ONG)等, 平台方自己进行存储 + +##### [元数据模板](../../../framework/data-storage/README.md#) + +```js +{ + @context: "http://schema.org", + @type: Dataset, + identifier: did:ont:xxxx...., + name: sample data, + description: "Just a sample for structured data", + keywords: "sample, structured", + publisher: { + @type: Person, + identifier: did:ont:yyyy...., + name: My Name, + ... + }, + datePublished: 2019-01-01T00:00:00Z, + creator: {...}, + version: 1, + expires: 2020-02-01T00:00:00Z, + license: "http://example.license.com/v1", + ... +} +``` + +##### 示例数据模板 + +```js +{ + certifier: "did:ont:AMz77J4iuHGmAdw7P9g1CZ7SoL996AdyxC", + coin: "ONG", + data:"a", + dataId: "", + desc: "test1", + img: "", + keywords: ["test1"], + name: "test1", + dataSource: "test1", + ontid: "did:ont:ALfPq6XV9Pa6oDKENunPvwxxaMX8tBiJhA", + price: 1, + metadata: { + @context: "http://schema.org", + @type: Dataset, + identifier: 'did:ont:xxxx....', + name: sample data, + description: "Just a sample for structured data", + keywords: "sample, structured", + publisher: { + @type: Person, + identifier: 'did:ont:yyyy', + name: My Name, + }, + datePublished: 2019-01-01T00:00:00Z, + creator: {...}, + version: 1, + expires: 2020-02-01T00:00:00Z, + license: "http://example.license.com/v1" + } +} +``` + + + +## 2. Enable data storage runtime + diff --git a/prod-doc/en/ddxf/business/solutions/marketplace.md b/prod-doc/en/ddxf/business/solutions/marketplace.md new file mode 100644 index 00000000..9f1ed081 --- /dev/null +++ b/prod-doc/en/ddxf/business/solutions/marketplace.md @@ -0,0 +1,43 @@ +# Solution for marketplace + +For detail and technology support, please contact Ontology dev team. + +## 1. Enable marketplace for resources + +1. Register on-chain domain to identify the marketplace + 1. ONT ID ready + 2. Default payer ready + 3. Domain in ONS ready +2. Setup a marketplace + 1. Use [`Ontology general marketplace server`](../../framework/marketplace/saas-tenant.md) or deploy a [new one](../../framework/marketplace/deployment.md) + 2. Config marketplace +3. Use marketplace SDK in web-app + 1. Link to [data storage provider](./data-storage.md) + 2. Enable [`ONT ID`](../../../ontid/business/solutions/web-app/README.md) +4. Choose marketplace [`resource auditors`](./resource-auditor.md) and [`offline judgers`](./resource-judger.md) + +## 2. Enable marketplace runtime + +1. Enable marketplace for end users + 1. [Resource preparing](../scenarios/resource-preparing.md) + 1. call [resource-data mapping and upload](../scenarios/data-storage/upload.md) in `data storage provider` + 2. get claim from [resource auditor](./resource-auditor.md) + 3. [generate data identifier](../scenarios/data-storage/generate-id.md) for data in `data storage provider` + 2. [Resource publish](../scenarios/resource-publish.md) + 1. choose pay-as-you-go or pre-order model + - [pay-as-you-go](../scenarios/marketplace/pay-as-you-go.md) + 1. register marketplace to the off-chain data in `data storage provider` + - [pre-order](../scenarios/marketplace/pre-order.md) + 1. generate DToken to access/transfer/... off-chain data in `data storage provider` + 2. [publish resource](../scenarios/marketplace/publish.md) to marketplace + 3. [Resource transaction](../scenarios/resource-transaction.md) + 1. DToken transfer or DToken/utility-token [exchange](../scenarios/marketplace/exchange.md) + 4. [Resource incentive share](../scenarios/resource-incentive-share.md) + 1. [share](../scenarios/marketplace/share.md) on transactions after certain challenge period + 5. [Transaction evaluation](../scenarios/tx-evaluation.md) + 1. [evaluate](../scenarios/marketplace/evaluate.md) + +## 3. Enable reputation score + +- inside marketplace +- cross marketplace diff --git a/prod-doc/en/ddxf/business/solutions/mp/data.md b/prod-doc/en/ddxf/business/solutions/mp/data.md new file mode 100644 index 00000000..b4d564ee --- /dev/null +++ b/prod-doc/en/ddxf/business/solutions/mp/data.md @@ -0,0 +1,60 @@ +# Solution for data exchange + +#### 角色分类 + +* 需求方:拥有资源的实体,并将资源开放给市场,以资源通过 某种定价体系换取一定的报酬(例如, ONG 或其它某种资源)。 +* 提供方:资源提供者的交易对手方,是需要某种资源的实体,从资源提供者中获取资源的(部分)所有权或者使用权,并为此支付一定的报酬(例如 ONG)。 +* 仲裁方:资源提供者和资源需求者在资源交易中都认可的链下纠纷仲裁者。链下产生的纠纷(如资源没有获取到)将由链下仲裁者进行裁定。 +* 认证方:具有一定权威性的第三方,拥有自己的资源质量认证体系,根据该体系可以给资源或者资源提供者提供一定方式的认证增强资源或者资源提供者的可信度。认证根据不同的模式可以收取或者不收取认证费用。与没有经过认证的资源相比,经过认证的资源会拥有更多的潜在买家以及可能获得更高的报酬。 +* Marketplace:是连系资源提供者和资源需求者的纽带,存储资源的元信息,为资源提供灵活的展示和快捷的搜索,收取交易费用。 + + + +#### 数据发布流程 + +1. 数据提供方需先通过ONS注册后登陆web-app。 + +2. 提供数据的元信息,包括数据验证方以及仲裁方,并进行存储,等待数据认证方通过数据的认证 + + [存储方案](../../../framework/data-storage/README.md) + +3. 数据认证通过后,为数据注册生成DataId,并通过Onto Auth 扫码签名进行上链操作。 + +4. DataId与数据绑定之后,进行数据的上传操作。 + + + +#### 数据认证流程 + +1. 数据提供方存储数据之后,数据认证方就会看到数据的具体信息,如果数据符合认证要求,可通过Onto Auth 扫码签名 进行数据的确认。 + + + +#### 数据购买流程 + +1. 需求方需先通过ONS注册后登陆web-app,可在数据中心看到需求方上传的所有数据,选择一条数据可查看具体描述详情。 +2. 需求方购买数据之前需要先选择仲裁方,之后通过Onto Auth 扫码签名marketplace合约进行数据的购买操作,其中合约会生成Token与这条数据进行绑定。 +3. 购买之后,需求方可在web-app 的订单中心看到刚才购买的订单,此时用户可通过Token(调用marketplace合约,验证Token的权限)来查看此订单的元数据 + * 若数据不符,需求方可进行申请仲裁操作(调用marketplace合约上链) + * 若数据符合,需求方可进行收货操作(调用marketplace合约上链),至此购买流程结束 + * 若需求方在挑战期内未进行收货操作,数据提供方可进行收款操作,至此购买流程结束 + + + +#### 数据仲裁流程 + +1. 仲裁方可在web-app 中看到需要仲裁的数据信息 + + * 如果判定成功,通过Onto Auth 扫码签名marketplace 仲裁合约进行上链操作 + * 如果判定失败,通过Onto Auth 扫码签名marketplace 仲裁合约进行上链操作 + + + + 具体仲裁分配,可参照[仲裁合约流程](../../../framework/marketplace/smart-contract-api.md) + + + +#### 数据撤销流程 + +1. 提供方可根据上传数据时生成的唯一ID,进行数据的撤销操作,通过Onto Auth 扫码签名marketplace 仲裁合约进行上链操作 + diff --git a/prod-doc/en/ddxf/business/solutions/mp/eshop.md b/prod-doc/en/ddxf/business/solutions/mp/eshop.md new file mode 100644 index 00000000..1165cc6e --- /dev/null +++ b/prod-doc/en/ddxf/business/solutions/mp/eshop.md @@ -0,0 +1,61 @@ +# Solution for eshop + +#### 角色分类 + +- 需求方:拥有资源的实体,并将资源开放给市场,以资源通过 某种定价体系换取一定的报酬(例如, ONG 或其它某种资源)。 +- 提供方:资源提供者的交易对手方,是需要某种资源的实体,从资源提供者中获取资源的(部分)所有权或者使用权,并为此支付一定的报酬(例如 ONG)。 +- 仲裁方:资源提供者和资源需求者在资源交易中都认可的链下纠纷仲裁者。链下产生的纠纷(如资源没有获取到)将由链下仲裁者进行裁定。 +- 认证方:具有一定权威性的第三方,拥有自己的资源质量认证体系,根据该体系可以给资源或者资源提供者提供一定方式的认证增强资源或者资源提供者的可信度。认证根据不同的模式可以收取或者不收取认证费用。与没有经过认证的资源相比,经过认证的资源会拥有更多的潜在买家以及可能获得更高的报酬。 +- Marketplace:是连系资源提供者和资源需求者的纽带,存储资源的元信息,为资源提供灵活的展示和快捷的搜索,收取交易费用。 + + + +#### 数据发布流程 + +1. 数据提供方需先通过ONS注册后登陆web-app。 + +2. 提供数据的元信息,包括数据验证方以及仲裁方,并进行存储,等待数据认证方通过数据的认证 + + [存储方案](../../../framework/data-storage/README.md) + +3. 数据认证通过后,为数据注册生成DataId,并通过Onto Auth 扫码签名进行上链操作 + +4. 为生成Token提供基本字段和数据,比如生成Token数量,调用DToken合约,通过Onto Auth 扫码签名进行上链操作 + +5. DataId与Token绑定之后,选择上传Token的数量等,进行数据的上传操作 + + + +#### 数据认证流程 + +1. 数据提供方存储数据之后,数据认证方就会看到数据的具体信息,如果数据符合认证要求,可通过Onto Auth 扫码签名 进行数据的确认。 + + + +#### 数据购买流程 + +1. 需求方需先通过ONS注册后登陆web-app,可在数据中心看到需求方上传的所有数据,选择一条数据可查看具体描述详情。 +2. 需求方购买数据之前需要先选择仲裁方以及购买Token的数量,之后通过Onto Auth 扫码签名marketplace合约进行数据的购买操作。 +3. 购买之后,需求方可在web-app 的订单中心看到刚才购买的订单,此时用户可通过Token(调用marketplace合约,验证Token的权限和剩余访问次数)来查看此订单的元数据。 + * 若数据不符,需求方可进行申请仲裁操作(调用marketplace合约上链) + * 若数据符合,需求方可进行收货操作(调用marketplace合约上链),至此购买流程结束 + * 若需求方在挑战期内未进行收货操作,数据提供方可进行收款操作,至此购买流程结束 + + + +#### 数据仲裁流程 + +1. 仲裁方可在web-app 中看到需要仲裁的数据信息 + + * 如果判定成功,通过Onto Auth 扫码签名marketplace 仲裁合约进行上链操作 + * 如果判定失败,通过Onto Auth 扫码签名marketplace 仲裁合约进行上链操作 + + + + 具体仲裁分配,可参照[仲裁合约流程](../../../framework/marketplace/smart-contract-api.md) + + + +#### 数据撤销流程 + +1. 提供方可根据上传数据时生成的唯一ID,进行数据的撤销操作,通过Onto Auth 扫码签名marketplace 仲裁合约进行上链操作 \ No newline at end of file diff --git a/prod-doc/en/ddxf/business/solutions/mp/id.md b/prod-doc/en/ddxf/business/solutions/mp/id.md new file mode 100644 index 00000000..0cef4a89 --- /dev/null +++ b/prod-doc/en/ddxf/business/solutions/mp/id.md @@ -0,0 +1 @@ +# Solution for customer acquisition \ No newline at end of file diff --git a/prod-doc/en/ddxf/business/solutions/offline-judger.md b/prod-doc/en/ddxf/business/solutions/offline-judger.md new file mode 100644 index 00000000..bbafbaab --- /dev/null +++ b/prod-doc/en/ddxf/business/solutions/offline-judger.md @@ -0,0 +1,37 @@ +# Solution for offline judger + +For detail and technology support, please contact Ontology dev team. + +## 1. Enable offline judger for resources + +仲裁包含四部分 + +- 仲裁方 +- 仲裁方案 +- 执行结果 +- 仲裁合同本身 + +由资源需求者提出数据的仲裁,仲裁方根据Marketplace 提供的API 查询到所需仲裁的数据,根据签订的仲裁合同中的仲裁方案发布执行结果。 + + + +#### 仲裁执行 + +1. 通过marketplace 提供的 API 查询到所需仲裁的订单数据,仲裁方根据仲裁合约判定仲裁的成功和失败,并进行合约的上链操作 + + 通过 marketplace 提供的 [API](../../../framework/marketplace/restful-api.md#仲裁) 传递所需参数,并返回二维码字符串 + + 示例二维码 + + ![a](../../res/ontid_qrcode.png) + + + + + + + + 仲裁完成之后,资金会根据结果自动发送到双方(需求方和提供方)的钱包,双方亦可根据marketplace API 查询到订单状态(包含仲裁结果) + +## 2. Enable offline judgement runtime + diff --git a/prod-doc/en/ddxf/business/solutions/resource-auditor.md b/prod-doc/en/ddxf/business/solutions/resource-auditor.md new file mode 100644 index 00000000..56604c8f --- /dev/null +++ b/prod-doc/en/ddxf/business/solutions/resource-auditor.md @@ -0,0 +1,31 @@ +# Solution for resource auditor + +For detail and technology support, please contact Ontology dev team. + +## 1. Enable resource auditor for resources + +需求方生成数据的 dataid 之前,可根据具体情况选定数据认证方,认证方通过 marketplace 提供的 API 可查询到需要认证的数据,然后进行认证。数据认证也可通过Trust Anchor 进行签发Cliam认证(可选),认证之后,需求方可继续进行其他操作。 + + + +- 通过marketplace 提供的 [API](../../framework/resource-audit/readme.md) 查询到所需认证的订单数据,认证方判定数据认证的成功和失败API 参数 + +```js + { + orderId: 'orderId', + isCer: true, + } +``` + +​ 提交 marketplace [API](../../framework/resource-audit) 进行数据的认证 + + + +- 通过 Trust Anchor 进行数据的认证 + + 具体可参照 [issue claim](../../../ontid/business/scenarios/trust-anchor/issue.md) + + 认证成功之后,marketplace 会自动同步认证的数据 + +## 2. Enable resource audit runtime + diff --git a/prod-doc/en/ddxf/framework/README.md b/prod-doc/en/ddxf/framework/README.md new file mode 100644 index 00000000..5ae201a1 --- /dev/null +++ b/prod-doc/en/ddxf/framework/README.md @@ -0,0 +1,81 @@ +# Ontology Decentralized Data Exchange Framework (DDXF) + +The accelerating use of Internet systems is increasing the pressure on the existing infrastructures to meet the needs of end users. Accordingly, there is an increasing demand for connected IoT or Internet systems. + +Traditional resource management, including information databases and analytics architectures and infrastructures, remain essential, with the growing data management demands, specific capabilities and capacities are required to be able to handle diverse and complex data streams from different sources. This data needs to be processed and managed properly to maximize its value in a secure manner, while complementing it with other information sources. + +Ontology DDXF is to define an infrastracture framework and guidelines to support comprehensive data processing and management frameworks which incorporate reasonable measures to achieve a layered, data-centric paradigm. Due to research, identify and study characteristics of effective data processing and management systems, DDXF is focusing on the data interoperability, classification, format and security issues that affect various stakeholders. + +![framework](../res/framework.png) + +Ontology DDXF uses Ontology blockchain infrastructure, follows an open protocol called [`Ontology GREP (Generic Resources Exchange Protocol)`](./spec/grep.md), and provides a series of functions and interfaces to meet the requirement of trust data interoperability cross multiple systems, which serves multiple business requirements and scenarios, esp., the data exchange scenarios. + +## Components and interfaces of DDXF + +根据 GREP 协议,DDXF 具备以下能力: + +1. 链外多系统资源整合; +2. 数据权限令牌化通证化,支持通证交易,支持跨链资产; +3. 以数据特征变化、令牌传递和通证交易形式实现资源交换和数据交互; +5. 数据加工和交易确权过程支持线下资源和链外仲裁,保证分成激励。 + +体现在框架功能模块之上,分成`自治资源管理`、`去中心化数据处理和资源交互`、`可信审计和仲裁`三个模块。 + +![component](../res/component.png) + +### 1. DToken model - self-sovereign data management + +The self-sovereign data management is to decouple the privilege of data ownership with data accessibility (or other data processing privileges) and manage data upon different privilege from the data owner(s). + +Ontology DDXF provides self-sovereign data management by a combination services of [`data storage`](./data-storage/README.md), [`ONT ID`](../../ontid/framework/README.md), [`DToken`](./spec/data-token.md) and Ontology blockchain infrastructure. + +- Data storage provides the capability to store data with data protection and data privacy, with lower cost; +- ONT ID provides the capability to identify the data and the data owner, data handler; +- DToken provides the capability to manage data privileges and ensure the data processing is stored on Ontology blockchain infrastructure; +- Ontology blockchain infrastructure provides the capability for the traceability and trust endorsement. + +The DToken model function defines the following features: + +- Resource modeling and mapping, provides static modeling and mapping functions, where the off-chain resources from Internet or IoT systems are able to be stored on-line in a form of modeling data and the on-line data will be mapped with on-chain identifiers; +- DToken generation, provides a static identifier mapping capability, where the privileges of data are able to be tokenized to DTokens, the use of DToken will be controlled and logged on-chain. + +DToken model provides interfaces to define the entities, resources and operations in DDXF. + +[>> Learn more](./data-storage/README.md) + +### 2. Decentralized data processing and management - resource exchange + +Decentralized data processing and management provides a runtime mechanism to control the business actions of resource exchange, data transfering and data processing. + +- Resource exchange, provides runtime for token based resource transfering and exchange. +- Token usability, provides runtime to manage the use of tokens, esp., the use of DToken to access data. + + +Decentralized data processing and management provides interfaces to process and manage data in DDXF. + +[>> Learn more](./marketplace/README.md) + +### 3. Trust audit + +The DDXF marketplace provides the capability to do resource exchange cross systems. + +Due to different business, data could be owned by the smart devices, end users or systems. Data processing will change the form of data. DDXF is to enable data processing, transfering and exchange with controlling of the ownership and accessibility of the data instances. Audit of off-chain resources and the transactions being taken by end users is to provide trust endorsement of DDXF. + +- Resource audit, provides a mechanism to ensure the ownership and accessibility of off-chain resources, the resource quality and the transaction behaviors; +- Reputation score, based on the use of DDXF, the transactions are able to provide trust endorsement for DDXF customers. + +Trust audit provides interfaces to do trust endorsement for transactions, data qualification and users in DDXF. + +[>> Learn more](./resource-audit/README.md) + +## Scenarios of DDXF + +DDXF covers the scenarios of most features in the data interoperability cross systems. The framework also covers the scenarios to bring valuable resources to a potential consumer(s), esp., marketplaces for resources cross systems. + +- [>> Learn more](../business/scenarios/README.md) + +## Business solutions using DDXF + +With DDXF, solutions are ready for different domains. + +- [>> Learn more](../business/business/README.md) \ No newline at end of file diff --git a/prod-doc/en/ddxf/framework/data-storage/README.md b/prod-doc/en/ddxf/framework/data-storage/README.md new file mode 100644 index 00000000..a16e6285 --- /dev/null +++ b/prod-doc/en/ddxf/framework/data-storage/README.md @@ -0,0 +1,109 @@ +# Data storage service + +Storage service in IT systems is refering to the storage of information, turns to be the data storage. + +数据,无论是模拟数据还是离散数据,是一种特殊的资源,是对客观事物的逻辑归纳。根据隐私性的考虑,有的数据可以以副本的形式提供给 RC,有的数据是对 RC 不可见的,只能采用 RC 提供的算法进行加工后形成数据结果。数据是多样性的,有的数据是静态数据,而有的数据是动态数据,需要实时采集。 + +## 1. 数据存储与访问 + +RP 需要为出售的数据准备存储和访问服务。存储方式有多种选择,既可以自己搭建存储服务,也可以选择使用符合接口标准的托管存储平台,如云存储以及某些去中心化存储平台等。若存储在托管平台上,强烈建议将数据进行加密处理。 + +当 RC 要访问数据时,需要向数据存储服务发送请求令牌,请求以 RC 对 DToken 签名形成 JWT 令牌的形式。数据存储服务查询区块链上的最新状态,检查 DToken 的有效性,同时获取持有者的信息(ONT ID 及绑定的公钥),验证 JWT 令牌的有效性。验证通过后,双方采用各自 ONT ID 下面的公钥建立安全的信道(例如 TLS 连接等),进行数据安全通信。 数据访问分为两种方式: + +1. 直接获取数据。此时可以看作交易的是数据的副本所有权。再次流转权等其它权利可以按照交易细则处理。获取数据时根据需要进行解密处理: + - RC 通过安全信道从存储服务获取到数据。比如实时流数据通过安全信道传递给 RC; + - 若数据是加密存储的(比如数据以密文的形式存储于某个托管平台),RC 还需要向 RP 请求解密密钥。RP 同样需要验证请求者身份,通过后向其提供解密密钥。另外,可以通过其它的密码技术来进行数据的安全又简便地分发。比如,可以通过代理重加密技术来处理加密内容的分发,减少加减密的次数。 +2. 请求分析结果。此时可以看作交易的是数据的访问权。当 RP 希望保护数据的隐私,而不希望将原始数据提供给他人时,RC 可以提供数据分析算法。在对原始数据执行分析计算后,结果通过安全的信道发送给 RC。这种情况下还需要执行数据分析运算的环境,这可以由 RP 提供,也可以使用第三方的平台。 + - 为了使计算结果更加可信,可以选择使用可信计算环境执行分析算法。当 RC 也不愿意暴露算法内容时,同样可以采用第三方可信计算环境执行分析算法,并将结果安全传输给 RC 或 RP。 + +## 2. 数据权限管理 + +根据 [`DToken`](../spec/data-token.md) 协议生成数据相关权限的令牌,使用区块链技术将令牌通证化。 + +- `DToken` 中关于数据访问权限的令牌属性,其使用遵循系统令牌权限管理规范; +- `DToken` 中关于区块链通证属性,其使用参与[`数据集市`](../marketplace/README.md)的资源交换和数据加工、交互过程,遵循区块链高安全、防篡改、可溯源的系统特性。 + +## 3. 数据自治化使用和交易证明 + +数据可以被清洗、建模和分析形成新数据,新数据同样拥有 ONT ID。数据使用 DDO 进行描述,形式如下: + +``` +type DataDDO struct{ + Name // 资源的名称 + Fingerprint // 抽取资源的唯一特征码生成数字指纹作为其特征值,该值也是生成资源 ONT ID 所需的素材。 + Description // 资源的简短描述 + ProviderID // 资源提供者的 ONT ID + EncKeys // 公钥列表,其对应私钥由该资源的 RP 掌握 + URL // 资源的访问地址 + SourceData // 源数据列表,列出每个源数据的 ONT ID + Transformer // 数据处理者的 ONT ID +} +``` + +数据主体将使用数据服务器进行储存,而数据的特征码将保持在链上,根据数据形态的不同,数据的特征码抽取方式也不同,静态数据使用 Hash 值,大量数据块可以采用 Merkle Tree 的形式形成 Merkle root 作为特征码;实时数据抽取数据源的唯一特征码。 + +对数据特征的描述是一类元数据规约,可以参考 [`schema.org`](https://schema.org) 规范。 + +### 2.1 数据描述模板 + +发布到链上的数据,需分配一个唯一标识符,是由发布者生成的 ID。同时还需给出名称、描述、关键字、发布者和发布时间,并指明数据类型。其中发布者可以是组织或个人,以 ONT ID 作为标识符。 元数据中可附加一些额外信息,如版本号、许可协议等。各类数据的元数据模板由交易市场制定。RP 发布数据时,输入所需的信息,生成元数据。如下是一个数据集模板: + +``` +{ + @context: "http://schema.org", + @type: Dataset, + identifier: did:ont:xxxx...., + name: sample data, + description: "Just a sample for structured data", + keywords: "sample, structured", + publisher: { + @type: Person, + identifier: did:ont:yyyy...., + name: My Name, + ... + }, + datePublished: 2019-01-01T00:00:00Z, + creator: {...}, + version: 1, + expires: 2020-02-01T00:00:00Z, + license: "http://example.license.com/v1", + ... +} +``` + +必要字段描述如下: + +- @type: 指明该数据的类型,需为 schema.org 定义的类型 +- identifier: 数据的唯一标识符,是一个 ONT ID +- name: 数据名称 +- description: 对数据内容的描述 +- keywords: 帮助搜索的关键字,使用’,’ 分割多个关键字 +- publisher: 数据发布者,是一个”Person” 对象(或 Orgnization 对象),其中 identifier 是发布者的 ONT ID,而名字、邮件地址等是可选字段。 + +可选字段描述如下: + +- creator: 数据集生产者,是一个”Person” 或”Orgnization” 对象 +- version: 版本号,可以是一个数字,也可以是一个字符串 +- expires: 失效时间 +- license: 数据使用的许可协议 + +### 2.2 数据处理和交易 + +同 ONT ID 和 DDO 形成对数据处理过程的完整记录和一致性证明。 + +![data-processing](../../res/data-processing.png) + +在数据交易的场景中,我们需要排除 RP 的数据服务器无法访问的问题。如果 RC 无法访问数据或者根本没有访问数据的话,那么应当将 RC 质押的 Token 退回到其质押地址中。我们可以使用数字签名来验证 RC 是否访问过数据服务器,即要求 RC 在访问数据服务器时,提供一个合法数字签名(该签名可以通过 RC 的 ONT ID 进行验证)。 + +一般来说,常见的证明类型有: + +- 数字签名:可帮助 RP 证明其确实提供了数据访问;当 RC 来访问完数据之后,向 RC 提供一份证明,证明数据服务器可连接; +- 哈希函数的原像:可用于将数据传输过程中发生的异常现象进行存证,例如,传输异常的 log 文件,异常过程的图片等等。 + +## Host data storage service + +1. [Deploy a storage service](./deployment.md) + - Use [`Ontology general storage service`](./saas-tenant.md) (SaaS) to run your own resource storage +2. [Data storage service RESTful api](./restful-api.md) + - [Smart contract api](./smart-contract-api.md) for DToken (to serve DDXF data storage) +3. [Data storage service SDK - java](./sdk/java/javadoc/README.md) diff --git a/prod-doc/en/ddxf/framework/data-storage/deployment.md b/prod-doc/en/ddxf/framework/data-storage/deployment.md new file mode 100644 index 00000000..cd4a9d88 --- /dev/null +++ b/prod-doc/en/ddxf/framework/data-storage/deployment.md @@ -0,0 +1,2 @@ +# Data storage service - deployment + diff --git a/prod-doc/en/ddxf/framework/data-storage/restful-api.md b/prod-doc/en/ddxf/framework/data-storage/restful-api.md new file mode 100644 index 00000000..b007f3cd --- /dev/null +++ b/prod-doc/en/ddxf/framework/data-storage/restful-api.md @@ -0,0 +1,300 @@ +# Data Storage Service Provider - RESTful api + +* 1. [RESTful api](#RESTful api) + * 1.1. [注册dataId](#注册dataId) + * 1.2. [ONT Auth发送注册dataId交易](#ONT Auth发送注册dataId交易) + * 1.3. [查询注册的dataId及结果](#查询注册的dataId及结果) + + **以下接口eshop类型场景适用** + * 1.4. [生成tokenId](#生成tokenId) + * 1.5. [ONT Auth发送生成tokenId交易](#ONT Auth发送生成tokenId交易) + * 1.6. [查询生成的tokenId及结果](#查询生成的tokenId及结果) + + +## RESTful api + +### 注册dataId + +``` +url:/api/v1/data/dataId +method:POST +``` + +请求: + +```json +{ + "ontid": "did:ont:ARCESVnP8Lbf6S7FuTei3smA35EQYog4LR" +} +``` + +| Field Name | Type | Description | +|---|---|---| +|ontid|String|用户ontid| + +响应: + +```json +{ + "action": "createDataId", + "error": 0, + "desc": "SUCCESS", + "result": { + "action": "signMessage", + "version": "v1.0.0", + "id": "10ba038e-48da-487b-96e8-8d3b99b6d18a", + "params": { + "type": "ontid", + "message": "7d7c4f01e0fa3c3203424644697b8d2266f337fb25b3ae89bc9575194a5d5ce7", + "ishex": true, + "callback": "http://101.132.193.149:4027/api/v1/data/invoke" + } + }, + "version": "v1" +} +``` + +| Field Name | Type | Description | +| :-- | :-- | :-- | +| action | String | 动作标志 | +| error | int | 错误码 | +| desc | String | 成功为SUCCESS,失败为错误描述 | +| result | Obj | 注册dataId的交易hex,将result内容生成二维码,并让ONT Auth扫码| +| version | String | 版本号 | + + +### ONT Auth发送注册dataId交易 + +``` +url:/back/invoke +method:Post +``` +请求 +````json +{ + "action": "signMessage", + "id": "string", + "params": { + "type": "ontid", + "user": "did:ont:AUEKhXNsoAT27HJwwqFGbpRy8QLHUMBMPz", + "message": "7d7c4f01e0fa3c3203424644697b8d2266f337fb25b3ae89bc9575194a5d5ce7", + "publickey": "0205c8fff4b1d21f4b2ec3b48cf88004e38402933d7e914b2a0eda0de15e73ba61", + "signature": "01abd7ea9d79c857cd838cabbbaad3efb44a6fc4f5a5ef52ea8461d6c055b8a7cf324d1a58962988709705cefe40df5b26e88af3ca387ec5036ec7f5e6640a1754" + }, + "version": "v1" +} +```` +| Field Name | Type | Description | +|---|---|---| +|message|String|签名的内容| +|publickey|String|ontid公钥| +|signature|String|签名数据| + +响应: + +```json +{ + "action": "createDataId", + "error": 0, + "desc": "SUCCESS", + "result": "SUCCESS", + "version": "v1" +} +``` + +| Field Name | Type | Description | +| :-- | :-- | :-- | +| action | String | 动作标志 | +| error | int | 错误码 | +| desc | String | 成功为SUCCESS,失败为错误描述 | +| result | Obj | 返回结果,失败为""| +| version | String | 版本号 | + + +### 查询注册的dataId及结果 + +``` +url:/back/result/{id} +method:Get +``` + +请求: +| Field Name | Type | Description | +|---|---|---| +|id |String|注册dataId返回的记录id | + +响应: + +```json +{ + "action": "registerDataIdResult", + "error": 0, + "desc": "SUCCESS", + "result": { + "dataId": "did:ont:ANYEUuWmPFrHM8XPYLJf2Z1PGAKSyBJ2G9", + "result": "1" + }, + "version": "v1" +} +``` +| Field Name | Type | Description | +| :-- | :-- | :-- | +| action | String | 动作标志 | +| error | int | 错误码 | +| desc | String | 成功为SUCCESS,失败为错误描述 | +| dataId | String | 注册生成的dataId | +| result | String | 成功返回"1",失败返回"0",没有查到链上信息返回null| +| version | String | 版本号 | + + +**以下接口eshop类型场景适用** +### 生成tokenId + +``` +url:/api/v1/data/tokenId/register +method:POST +``` + +请求: + +```json +{ + "address": "ARCESVnP8Lbf6S7FuTei3smA35EQYog4LR", + "dataId": "did:ont:ANYEUuWmPFrHM8XPYLJf2Z1PGAKSyBJ2G9", + "ontid": "did:ont:ARCESVnP8Lbf6S7FuTei3smA35EQYog4LR", + "index": 1, + "symbol": "symbol", + "name": "name", + "amount": 100, + "transferCount": 10, + "accessCount": 10, + "expireTime": 0 +} +``` + +| Field Name | Type | Description | +|---|---|---| +|address|String|生成data token的接收地址| +|dataId|String|已注册的dataId| +|ontid|String|dataId的控制人ONT ID| +|index|int|控制人ONT ID index| +|symbol|String|token的symbol| +|name|String|token的name| +|amount|int|生成token的数量| +|transferCount|int|token的可流转次数| +|accessCount|int|token的可访问次数| +|expireTime|int|token的过期时间| + +响应: + +```json +{ + "action": "createTokenId", + "error": 0, + "desc": "SUCCESS", + "result": { + "action": "signMessage", + "version": "v1.0.0", + "id": "10ba038e-48da-487b-96e8-8d3b99b6d18a", + "params": { + "type": "ontid", + "message": "7d7c4f01e0fa3c3203424644697b8d2266f337fb25b3ae89bc9575194a5d5ce7", + "ishex": true, + "callback": "http://101.132.193.149:4027/api/v1/data/invoke" + } + }, + "version": "v1" +} +``` + +| Field Name | Type | Description | +| :-- | :-- | :-- | +| action | String | 动作标志 | +| error | int | 错误码 | +| desc | String | 成功为SUCCESS,失败为错误描述 | +| result | Obj | 生成dataToken的交易hex,将result内容生成二维码,并让ONT Auth扫码| +| version | String | 版本号 | + + +### ONT Auth发送生成tokenId交易 + +``` +url:/back/invoke +method:Post +``` +请求 +````json +{ + "action": "signMessage", + "id": "string", + "params": { + "type": "ontid", + "user": "did:ont:AUEKhXNsoAT27HJwwqFGbpRy8QLHUMBMPz", + "message": "7d7c4f01e0fa3c3203424644697b8d2266f337fb25b3ae89bc9575194a5d5ce7", + "publickey": "0205c8fff4b1d21f4b2ec3b48cf88004e38402933d7e914b2a0eda0de15e73ba61", + "signature": "01abd7ea9d79c857cd838cabbbaad3efb44a6fc4f5a5ef52ea8461d6c055b8a7cf324d1a58962988709705cefe40df5b26e88af3ca387ec5036ec7f5e6640a1754" + }, + "version": "v1" +} +```` +| Field Name | Type | Description | +|---|---|---| +|message|String|签名的内容| +|publickey|String|ontid公钥| +|signature|String|签名数据| + +响应: + +```json +{ + "action": "createTokenId", + "error": 0, + "desc": "SUCCESS", + "result": "SUCCESS", + "version": "v1" +} +``` + +| Field Name | Type | Description | +| :-- | :-- | :-- | +| action | String | 动作标志 | +| error | int | 错误码 | +| desc | String | 成功为SUCCESS,失败为错误描述 | +| result | Obj | 返回结果,失败为""| +| version | String | 版本号 | + + +### 查询生成的tokenId及结果 + +``` +url:/back/result/{id} +method:Get +``` + +请求: +| Field Name | Type | Description | +|---|---|---| +|id |String|生成tokenId返回的记录id | + +响应: + +```json +{ + "action": "createTokenIdResult", + "error": 0, + "desc": "SUCCESS", + "result": { + "tokenId": [1,50], + "result": "1" + }, + "version": "v1" +} +``` +| Field Name | Type | Description | +| :-- | :-- | :-- | +| action | String | 动作标志 | +| error | int | 错误码 | +| desc | String | 成功为SUCCESS,失败为错误描述 | +| tokenId | List | 生成的tokenId,第一个元素表示起始id,第二个元素表示结束id| +| result | String | 成功返回"1",失败返回"0",没有查到链上信息返回null| +| version | String | 版本号 | \ No newline at end of file diff --git a/prod-doc/en/ddxf/framework/data-storage/saas-tenant.md b/prod-doc/en/ddxf/framework/data-storage/saas-tenant.md new file mode 100644 index 00000000..c4a96a77 --- /dev/null +++ b/prod-doc/en/ddxf/framework/data-storage/saas-tenant.md @@ -0,0 +1,15 @@ +# Data Storage Service Provider - tenant + +This document describes an easy way to use data storage services: become a tenant of Ontology public data storage service. + +## 1. Prerequisite + +*[TBD]* + +## 2. Configuration + +*[TBD]* + +## Appendix I. the pricing model + +*[TBD]* \ No newline at end of file diff --git a/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/README.md b/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/README.md new file mode 100644 index 00000000..46d8e5e4 --- /dev/null +++ b/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/README.md @@ -0,0 +1 @@ +Javadoc is generated here. For usecase, please view [scenarios](../../../../business/scenarios/README.md) \ No newline at end of file diff --git a/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/allclasses-frame.html b/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/allclasses-frame.html new file mode 100644 index 00000000..0e9911e6 --- /dev/null +++ b/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/allclasses-frame.html @@ -0,0 +1,23 @@ + + + + + + +All Classes + + + + + +

All Classes

+
+ +
+ + diff --git a/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/allclasses-noframe.html b/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/allclasses-noframe.html new file mode 100644 index 00000000..173c9187 --- /dev/null +++ b/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/allclasses-noframe.html @@ -0,0 +1,23 @@ + + + + + + +All Classes + + + + + +

All Classes

+
+ +
+ + diff --git a/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/com/ontology/exception/DataStorageSdkException.html b/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/com/ontology/exception/DataStorageSdkException.html new file mode 100644 index 00000000..30b67627 --- /dev/null +++ b/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/com/ontology/exception/DataStorageSdkException.html @@ -0,0 +1,365 @@ + + + + + + +DataStorageSdkException + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + + +
+
com.ontology.exception
+

Class DataStorageSdkException

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/com/ontology/exception/package-frame.html b/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/com/ontology/exception/package-frame.html new file mode 100644 index 00000000..62f83cff --- /dev/null +++ b/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/com/ontology/exception/package-frame.html @@ -0,0 +1,21 @@ + + + + + + +com.ontology.exception + + + + + +

com.ontology.exception

+
+

Exceptions

+ +
+ + diff --git a/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/com/ontology/exception/package-summary.html b/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/com/ontology/exception/package-summary.html new file mode 100644 index 00000000..e81552c3 --- /dev/null +++ b/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/com/ontology/exception/package-summary.html @@ -0,0 +1,141 @@ + + + + + + +com.ontology.exception + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
+

Package com.ontology.exception

+
+
+ +
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/com/ontology/exception/package-tree.html b/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/com/ontology/exception/package-tree.html new file mode 100644 index 00000000..13de4411 --- /dev/null +++ b/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/com/ontology/exception/package-tree.html @@ -0,0 +1,148 @@ + + + + + + +com.ontology.exception Class Hierarchy + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
+

Hierarchy For Package com.ontology.exception

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/com/ontology/sdk/DataStorageSdk.html b/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/com/ontology/sdk/DataStorageSdk.html new file mode 100644 index 00000000..7444afe6 --- /dev/null +++ b/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/com/ontology/sdk/DataStorageSdk.html @@ -0,0 +1,285 @@ + + + + + + +DataStorageSdk + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + + +
+
com.ontology.sdk
+

Class DataStorageSdk

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/com/ontology/sdk/package-frame.html b/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/com/ontology/sdk/package-frame.html new file mode 100644 index 00000000..7af1f31b --- /dev/null +++ b/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/com/ontology/sdk/package-frame.html @@ -0,0 +1,21 @@ + + + + + + +com.ontology.sdk + + + + + +

com.ontology.sdk

+
+

Classes

+ +
+ + diff --git a/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/com/ontology/sdk/package-summary.html b/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/com/ontology/sdk/package-summary.html new file mode 100644 index 00000000..5dddbf0e --- /dev/null +++ b/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/com/ontology/sdk/package-summary.html @@ -0,0 +1,141 @@ + + + + + + +com.ontology.sdk + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
+

Package com.ontology.sdk

+
+
+ +
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/com/ontology/sdk/package-tree.html b/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/com/ontology/sdk/package-tree.html new file mode 100644 index 00000000..e4a59412 --- /dev/null +++ b/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/com/ontology/sdk/package-tree.html @@ -0,0 +1,136 @@ + + + + + + +com.ontology.sdk Class Hierarchy + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
+

Hierarchy For Package com.ontology.sdk

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/com/ontology/utils/ErrorInfo.html b/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/com/ontology/utils/ErrorInfo.html new file mode 100644 index 00000000..2d2ec614 --- /dev/null +++ b/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/com/ontology/utils/ErrorInfo.html @@ -0,0 +1,820 @@ + + + + + + +ErrorInfo + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + + +
+
com.ontology.utils
+

Enum ErrorInfo

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/com/ontology/utils/HttpClientUtils.html b/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/com/ontology/utils/HttpClientUtils.html new file mode 100644 index 00000000..25fd4c07 --- /dev/null +++ b/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/com/ontology/utils/HttpClientUtils.html @@ -0,0 +1,319 @@ + + + + + + +HttpClientUtils + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + + +
+
com.ontology.utils
+

Class HttpClientUtils

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/com/ontology/utils/package-frame.html b/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/com/ontology/utils/package-frame.html new file mode 100644 index 00000000..964ad3ab --- /dev/null +++ b/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/com/ontology/utils/package-frame.html @@ -0,0 +1,25 @@ + + + + + + +com.ontology.utils + + + + + +

com.ontology.utils

+
+

Classes

+ +

Enums

+ +
+ + diff --git a/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/com/ontology/utils/package-summary.html b/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/com/ontology/utils/package-summary.html new file mode 100644 index 00000000..b18eadd8 --- /dev/null +++ b/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/com/ontology/utils/package-summary.html @@ -0,0 +1,156 @@ + + + + + + +com.ontology.utils + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
+

Package com.ontology.utils

+
+
+ +
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/com/ontology/utils/package-tree.html b/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/com/ontology/utils/package-tree.html new file mode 100644 index 00000000..5ffead09 --- /dev/null +++ b/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/com/ontology/utils/package-tree.html @@ -0,0 +1,148 @@ + + + + + + +com.ontology.utils Class Hierarchy + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
+

Hierarchy For Package com.ontology.utils

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +

Enum Hierarchy

+ +
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/constant-values.html b/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/constant-values.html new file mode 100644 index 00000000..2aa60c55 --- /dev/null +++ b/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/constant-values.html @@ -0,0 +1,123 @@ + + + + + + +Constant Field Values + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
+

Constant Field Values

+

Contents

+
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/deprecated-list.html b/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/deprecated-list.html new file mode 100644 index 00000000..d9f0ff84 --- /dev/null +++ b/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/deprecated-list.html @@ -0,0 +1,123 @@ + + + + + + +Deprecated List + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
+

Deprecated API

+

Contents

+
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/help-doc.html b/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/help-doc.html new file mode 100644 index 00000000..6be0fd7b --- /dev/null +++ b/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/help-doc.html @@ -0,0 +1,224 @@ + + + + + + +API Help + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
+

How This API Document Is Organized

+
This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.
+
+
+ +This help file applies to API documentation generated using the standard doclet.
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/index-files/index-1.html b/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/index-files/index-1.html new file mode 100644 index 00000000..c65bdb21 --- /dev/null +++ b/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/index-files/index-1.html @@ -0,0 +1,134 @@ + + + + + + +C-Index + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
C D E G H R S T V  + + +

C

+
+
code() - Method in enum com.ontology.utils.ErrorInfo
+
 
+
com.ontology.exception - package com.ontology.exception
+
 
+
com.ontology.sdk - package com.ontology.sdk
+
 
+
com.ontology.utils - package com.ontology.utils
+
 
+
+C D E G H R S T V 
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/index-files/index-2.html b/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/index-files/index-2.html new file mode 100644 index 00000000..69478694 --- /dev/null +++ b/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/index-files/index-2.html @@ -0,0 +1,140 @@ + + + + + + +D-Index + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
C D E G H R S T V  + + +

D

+
+
dataIdResult(String) - Method in class com.ontology.sdk.DataStorageSdk
+
 
+
DataStorageSdk - Class in com.ontology.sdk
+
 
+
DataStorageSdkException - Exception in com.ontology.exception
+
 
+
DataStorageSdkException(long, String, String, String) - Constructor for exception com.ontology.exception.DataStorageSdkException
+
 
+
DataStorageSdkException(long, String, String) - Constructor for exception com.ontology.exception.DataStorageSdkException
+
 
+
descCN() - Method in enum com.ontology.utils.ErrorInfo
+
 
+
descEN() - Method in enum com.ontology.utils.ErrorInfo
+
 
+
+C D E G H R S T V 
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/index-files/index-3.html b/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/index-files/index-3.html new file mode 100644 index 00000000..7163f12e --- /dev/null +++ b/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/index-files/index-3.html @@ -0,0 +1,128 @@ + + + + + + +E-Index + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
C D E G H R S T V  + + +

E

+
+
ErrorInfo - Enum in com.ontology.utils
+
 
+
+C D E G H R S T V 
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/index-files/index-4.html b/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/index-files/index-4.html new file mode 100644 index 00000000..4dc1bf30 --- /dev/null +++ b/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/index-files/index-4.html @@ -0,0 +1,134 @@ + + + + + + +G-Index + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
C D E G H R S T V  + + +

G

+
+
getErrCode() - Method in exception com.ontology.exception.DataStorageSdkException
+
 
+
getErrDesCN() - Method in exception com.ontology.exception.DataStorageSdkException
+
 
+
getErrDesEN() - Method in exception com.ontology.exception.DataStorageSdkException
+
 
+
getInstance(String) - Static method in class com.ontology.sdk.DataStorageSdk
+
 
+
+C D E G H R S T V 
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/index-files/index-5.html b/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/index-files/index-5.html new file mode 100644 index 00000000..39c554d1 --- /dev/null +++ b/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/index-files/index-5.html @@ -0,0 +1,138 @@ + + + + + + +H-Index + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
C D E G H R S T V  + + +

H

+
+
httpClientGet(String, Map<String, Object>, Map<String, Object>) - Method in class com.ontology.utils.HttpClientUtils
+
+
httpclient get请求
+
+
httpClientPost(String, String, Map<String, Object>) - Method in class com.ontology.utils.HttpClientUtils
+
+
httpclient post请求
+
+
HttpClientUtils - Class in com.ontology.utils
+
 
+
HttpClientUtils() - Constructor for class com.ontology.utils.HttpClientUtils
+
 
+
+C D E G H R S T V 
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/index-files/index-6.html b/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/index-files/index-6.html new file mode 100644 index 00000000..90a4abd9 --- /dev/null +++ b/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/index-files/index-6.html @@ -0,0 +1,128 @@ + + + + + + +R-Index + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
C D E G H R S T V  + + +

R

+
+
registDataId(String) - Method in class com.ontology.sdk.DataStorageSdk
+
 
+
+C D E G H R S T V 
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/index-files/index-7.html b/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/index-files/index-7.html new file mode 100644 index 00000000..a0ee6ac6 --- /dev/null +++ b/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/index-files/index-7.html @@ -0,0 +1,128 @@ + + + + + + +S-Index + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
C D E G H R S T V  + + +

S

+
+
setRestfulUrl(String) - Method in class com.ontology.sdk.DataStorageSdk
+
 
+
+C D E G H R S T V 
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/index-files/index-8.html b/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/index-files/index-8.html new file mode 100644 index 00000000..6780a4b3 --- /dev/null +++ b/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/index-files/index-8.html @@ -0,0 +1,128 @@ + + + + + + +T-Index + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
C D E G H R S T V  + + +

T

+
+
toString() - Method in exception com.ontology.exception.DataStorageSdkException
+
 
+
+C D E G H R S T V 
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/index-files/index-9.html b/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/index-files/index-9.html new file mode 100644 index 00000000..1a1df5b4 --- /dev/null +++ b/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/index-files/index-9.html @@ -0,0 +1,135 @@ + + + + + + +V-Index + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
C D E G H R S T V  + + +

V

+
+
valueOf(String) - Static method in enum com.ontology.utils.ErrorInfo
+
+
Returns the enum constant of this type with the specified name.
+
+
values() - Static method in enum com.ontology.utils.ErrorInfo
+
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
+C D E G H R S T V 
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/index.html b/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/index.html new file mode 100644 index 00000000..2a4c5aca --- /dev/null +++ b/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/index.html @@ -0,0 +1,76 @@ + + + + + + +Generated Documentation (Untitled) + + + + + + + + + +<noscript> +<div>JavaScript is disabled on your browser.</div> +</noscript> +<h2>Frame Alert</h2> +<p>This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. Link to <a href="overview-summary.html">Non-frame version</a>.</p> + + + diff --git a/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/overview-frame.html b/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/overview-frame.html new file mode 100644 index 00000000..c139db96 --- /dev/null +++ b/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/overview-frame.html @@ -0,0 +1,24 @@ + + + + + + +Overview List + + + + + +
All Classes
+
+

Packages

+ +
+

 

+ + diff --git a/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/overview-summary.html b/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/overview-summary.html new file mode 100644 index 00000000..a01b0a1d --- /dev/null +++ b/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/overview-summary.html @@ -0,0 +1,142 @@ + + + + + + +Overview + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
+ + + + + + + + + + + + + + + + + + + + +
Packages 
PackageDescription
com.ontology.exception 
com.ontology.sdk 
com.ontology.utils 
+
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/overview-tree.html b/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/overview-tree.html new file mode 100644 index 00000000..8e46c6de --- /dev/null +++ b/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/overview-tree.html @@ -0,0 +1,164 @@ + + + + + + +Class Hierarchy + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
+

Hierarchy For All Packages

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +

Enum Hierarchy

+ +
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/package-list b/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/package-list new file mode 100644 index 00000000..40b8ef24 --- /dev/null +++ b/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/package-list @@ -0,0 +1,3 @@ +com.ontology.exception +com.ontology.sdk +com.ontology.utils diff --git a/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/script.js b/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/script.js new file mode 100644 index 00000000..b3463569 --- /dev/null +++ b/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/script.js @@ -0,0 +1,30 @@ +function show(type) +{ + count = 0; + for (var key in methods) { + var row = document.getElementById(key); + if ((methods[key] & type) != 0) { + row.style.display = ''; + row.className = (count++ % 2) ? rowColor : altColor; + } + else + row.style.display = 'none'; + } + updateTabs(type); +} + +function updateTabs(type) +{ + for (var value in tabs) { + var sNode = document.getElementById(tabs[value][0]); + var spanNode = sNode.firstChild; + if (value == type) { + sNode.className = activeTableTab; + spanNode.innerHTML = tabs[value][1]; + } + else { + sNode.className = tableTab; + spanNode.innerHTML = "" + tabs[value][1] + ""; + } + } +} diff --git a/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/serialized-form.html b/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/serialized-form.html new file mode 100644 index 00000000..67270617 --- /dev/null +++ b/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/serialized-form.html @@ -0,0 +1,155 @@ + + + + + + +Serialized Form + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
+

Serialized Form

+
+
+ +
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/stylesheet.css b/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/stylesheet.css new file mode 100644 index 00000000..98055b22 --- /dev/null +++ b/prod-doc/en/ddxf/framework/data-storage/sdk/java/javadoc/data-storage-sdk/stylesheet.css @@ -0,0 +1,574 @@ +/* Javadoc style sheet */ +/* +Overall document style +*/ + +@import url('resources/fonts/dejavu.css'); + +body { + background-color:#ffffff; + color:#353833; + font-family:'DejaVu Sans', Arial, Helvetica, sans-serif; + font-size:14px; + margin:0; +} +a:link, a:visited { + text-decoration:none; + color:#4A6782; +} +a:hover, a:focus { + text-decoration:none; + color:#bb7a2a; +} +a:active { + text-decoration:none; + color:#4A6782; +} +a[name] { + color:#353833; +} +a[name]:hover { + text-decoration:none; + color:#353833; +} +pre { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; +} +h1 { + font-size:20px; +} +h2 { + font-size:18px; +} +h3 { + font-size:16px; + font-style:italic; +} +h4 { + font-size:13px; +} +h5 { + font-size:12px; +} +h6 { + font-size:11px; +} +ul { + list-style-type:disc; +} +code, tt { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + padding-top:4px; + margin-top:8px; + line-height:1.4em; +} +dt code { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + padding-top:4px; +} +table tr td dt code { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + vertical-align:top; + padding-top:4px; +} +sup { + font-size:8px; +} +/* +Document title and Copyright styles +*/ +.clear { + clear:both; + height:0px; + overflow:hidden; +} +.aboutLanguage { + float:right; + padding:0px 21px; + font-size:11px; + z-index:200; + margin-top:-9px; +} +.legalCopy { + margin-left:.5em; +} +.bar a, .bar a:link, .bar a:visited, .bar a:active { + color:#FFFFFF; + text-decoration:none; +} +.bar a:hover, .bar a:focus { + color:#bb7a2a; +} +.tab { + background-color:#0066FF; + color:#ffffff; + padding:8px; + width:5em; + font-weight:bold; +} +/* +Navigation bar styles +*/ +.bar { + background-color:#4D7A97; + color:#FFFFFF; + padding:.8em .5em .4em .8em; + height:auto;/*height:1.8em;*/ + font-size:11px; + margin:0; +} +.topNav { + background-color:#4D7A97; + color:#FFFFFF; + float:left; + padding:0; + width:100%; + clear:right; + height:2.8em; + padding-top:10px; + overflow:hidden; + font-size:12px; +} +.bottomNav { + margin-top:10px; + background-color:#4D7A97; + color:#FFFFFF; + float:left; + padding:0; + width:100%; + clear:right; + height:2.8em; + padding-top:10px; + overflow:hidden; + font-size:12px; +} +.subNav { + background-color:#dee3e9; + float:left; + width:100%; + overflow:hidden; + font-size:12px; +} +.subNav div { + clear:left; + float:left; + padding:0 0 5px 6px; + text-transform:uppercase; +} +ul.navList, ul.subNavList { + float:left; + margin:0 25px 0 0; + padding:0; +} +ul.navList li{ + list-style:none; + float:left; + padding: 5px 6px; + text-transform:uppercase; +} +ul.subNavList li{ + list-style:none; + float:left; +} +.topNav a:link, .topNav a:active, .topNav a:visited, .bottomNav a:link, .bottomNav a:active, .bottomNav a:visited { + color:#FFFFFF; + text-decoration:none; + text-transform:uppercase; +} +.topNav a:hover, .bottomNav a:hover { + text-decoration:none; + color:#bb7a2a; + text-transform:uppercase; +} +.navBarCell1Rev { + background-color:#F8981D; + color:#253441; + margin: auto 5px; +} +.skipNav { + position:absolute; + top:auto; + left:-9999px; + overflow:hidden; +} +/* +Page header and footer styles +*/ +.header, .footer { + clear:both; + margin:0 20px; + padding:5px 0 0 0; +} +.indexHeader { + margin:10px; + position:relative; +} +.indexHeader span{ + margin-right:15px; +} +.indexHeader h1 { + font-size:13px; +} +.title { + color:#2c4557; + margin:10px 0; +} +.subTitle { + margin:5px 0 0 0; +} +.header ul { + margin:0 0 15px 0; + padding:0; +} +.footer ul { + margin:20px 0 5px 0; +} +.header ul li, .footer ul li { + list-style:none; + font-size:13px; +} +/* +Heading styles +*/ +div.details ul.blockList ul.blockList ul.blockList li.blockList h4, div.details ul.blockList ul.blockList ul.blockListLast li.blockList h4 { + background-color:#dee3e9; + border:1px solid #d0d9e0; + margin:0 0 6px -8px; + padding:7px 5px; +} +ul.blockList ul.blockList ul.blockList li.blockList h3 { + background-color:#dee3e9; + border:1px solid #d0d9e0; + margin:0 0 6px -8px; + padding:7px 5px; +} +ul.blockList ul.blockList li.blockList h3 { + padding:0; + margin:15px 0; +} +ul.blockList li.blockList h2 { + padding:0px 0 20px 0; +} +/* +Page layout container styles +*/ +.contentContainer, .sourceContainer, .classUseContainer, .serializedFormContainer, .constantValuesContainer { + clear:both; + padding:10px 20px; + position:relative; +} +.indexContainer { + margin:10px; + position:relative; + font-size:12px; +} +.indexContainer h2 { + font-size:13px; + padding:0 0 3px 0; +} +.indexContainer ul { + margin:0; + padding:0; +} +.indexContainer ul li { + list-style:none; + padding-top:2px; +} +.contentContainer .description dl dt, .contentContainer .details dl dt, .serializedFormContainer dl dt { + font-size:12px; + font-weight:bold; + margin:10px 0 0 0; + color:#4E4E4E; +} +.contentContainer .description dl dd, .contentContainer .details dl dd, .serializedFormContainer dl dd { + margin:5px 0 10px 0px; + font-size:14px; + font-family:'DejaVu Sans Mono',monospace; +} +.serializedFormContainer dl.nameValue dt { + margin-left:1px; + font-size:1.1em; + display:inline; + font-weight:bold; +} +.serializedFormContainer dl.nameValue dd { + margin:0 0 0 1px; + font-size:1.1em; + display:inline; +} +/* +List styles +*/ +ul.horizontal li { + display:inline; + font-size:0.9em; +} +ul.inheritance { + margin:0; + padding:0; +} +ul.inheritance li { + display:inline; + list-style:none; +} +ul.inheritance li ul.inheritance { + margin-left:15px; + padding-left:15px; + padding-top:1px; +} +ul.blockList, ul.blockListLast { + margin:10px 0 10px 0; + padding:0; +} +ul.blockList li.blockList, ul.blockListLast li.blockList { + list-style:none; + margin-bottom:15px; + line-height:1.4; +} +ul.blockList ul.blockList li.blockList, ul.blockList ul.blockListLast li.blockList { + padding:0px 20px 5px 10px; + border:1px solid #ededed; + background-color:#f8f8f8; +} +ul.blockList ul.blockList ul.blockList li.blockList, ul.blockList ul.blockList ul.blockListLast li.blockList { + padding:0 0 5px 8px; + background-color:#ffffff; + border:none; +} +ul.blockList ul.blockList ul.blockList ul.blockList li.blockList { + margin-left:0; + padding-left:0; + padding-bottom:15px; + border:none; +} +ul.blockList ul.blockList ul.blockList ul.blockList li.blockListLast { + list-style:none; + border-bottom:none; + padding-bottom:0; +} +table tr td dl, table tr td dl dt, table tr td dl dd { + margin-top:0; + margin-bottom:1px; +} +/* +Table styles +*/ +.overviewSummary, .memberSummary, .typeSummary, .useSummary, .constantsSummary, .deprecatedSummary { + width:100%; + border-left:1px solid #EEE; + border-right:1px solid #EEE; + border-bottom:1px solid #EEE; +} +.overviewSummary, .memberSummary { + padding:0px; +} +.overviewSummary caption, .memberSummary caption, .typeSummary caption, +.useSummary caption, .constantsSummary caption, .deprecatedSummary caption { + position:relative; + text-align:left; + background-repeat:no-repeat; + color:#253441; + font-weight:bold; + clear:none; + overflow:hidden; + padding:0px; + padding-top:10px; + padding-left:1px; + margin:0px; + white-space:pre; +} +.overviewSummary caption a:link, .memberSummary caption a:link, .typeSummary caption a:link, +.useSummary caption a:link, .constantsSummary caption a:link, .deprecatedSummary caption a:link, +.overviewSummary caption a:hover, .memberSummary caption a:hover, .typeSummary caption a:hover, +.useSummary caption a:hover, .constantsSummary caption a:hover, .deprecatedSummary caption a:hover, +.overviewSummary caption a:active, .memberSummary caption a:active, .typeSummary caption a:active, +.useSummary caption a:active, .constantsSummary caption a:active, .deprecatedSummary caption a:active, +.overviewSummary caption a:visited, .memberSummary caption a:visited, .typeSummary caption a:visited, +.useSummary caption a:visited, .constantsSummary caption a:visited, .deprecatedSummary caption a:visited { + color:#FFFFFF; +} +.overviewSummary caption span, .memberSummary caption span, .typeSummary caption span, +.useSummary caption span, .constantsSummary caption span, .deprecatedSummary caption span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + padding-bottom:7px; + display:inline-block; + float:left; + background-color:#F8981D; + border: none; + height:16px; +} +.memberSummary caption span.activeTableTab span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + margin-right:3px; + display:inline-block; + float:left; + background-color:#F8981D; + height:16px; +} +.memberSummary caption span.tableTab span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + margin-right:3px; + display:inline-block; + float:left; + background-color:#4D7A97; + height:16px; +} +.memberSummary caption span.tableTab, .memberSummary caption span.activeTableTab { + padding-top:0px; + padding-left:0px; + padding-right:0px; + background-image:none; + float:none; + display:inline; +} +.overviewSummary .tabEnd, .memberSummary .tabEnd, .typeSummary .tabEnd, +.useSummary .tabEnd, .constantsSummary .tabEnd, .deprecatedSummary .tabEnd { + display:none; + width:5px; + position:relative; + float:left; + background-color:#F8981D; +} +.memberSummary .activeTableTab .tabEnd { + display:none; + width:5px; + margin-right:3px; + position:relative; + float:left; + background-color:#F8981D; +} +.memberSummary .tableTab .tabEnd { + display:none; + width:5px; + margin-right:3px; + position:relative; + background-color:#4D7A97; + float:left; + +} +.overviewSummary td, .memberSummary td, .typeSummary td, +.useSummary td, .constantsSummary td, .deprecatedSummary td { + text-align:left; + padding:0px 0px 12px 10px; +} +th.colOne, th.colFirst, th.colLast, .useSummary th, .constantsSummary th, +td.colOne, td.colFirst, td.colLast, .useSummary td, .constantsSummary td{ + vertical-align:top; + padding-right:0px; + padding-top:8px; + padding-bottom:3px; +} +th.colFirst, th.colLast, th.colOne, .constantsSummary th { + background:#dee3e9; + text-align:left; + padding:8px 3px 3px 7px; +} +td.colFirst, th.colFirst { + white-space:nowrap; + font-size:13px; +} +td.colLast, th.colLast { + font-size:13px; +} +td.colOne, th.colOne { + font-size:13px; +} +.overviewSummary td.colFirst, .overviewSummary th.colFirst, +.useSummary td.colFirst, .useSummary th.colFirst, +.overviewSummary td.colOne, .overviewSummary th.colOne, +.memberSummary td.colFirst, .memberSummary th.colFirst, +.memberSummary td.colOne, .memberSummary th.colOne, +.typeSummary td.colFirst{ + width:25%; + vertical-align:top; +} +td.colOne a:link, td.colOne a:active, td.colOne a:visited, td.colOne a:hover, td.colFirst a:link, td.colFirst a:active, td.colFirst a:visited, td.colFirst a:hover, td.colLast a:link, td.colLast a:active, td.colLast a:visited, td.colLast a:hover, .constantValuesContainer td a:link, .constantValuesContainer td a:active, .constantValuesContainer td a:visited, .constantValuesContainer td a:hover { + font-weight:bold; +} +.tableSubHeadingColor { + background-color:#EEEEFF; +} +.altColor { + background-color:#FFFFFF; +} +.rowColor { + background-color:#EEEEEF; +} +/* +Content styles +*/ +.description pre { + margin-top:0; +} +.deprecatedContent { + margin:0; + padding:10px 0; +} +.docSummary { + padding:0; +} + +ul.blockList ul.blockList ul.blockList li.blockList h3 { + font-style:normal; +} + +div.block { + font-size:14px; + font-family:'DejaVu Serif', Georgia, "Times New Roman", Times, serif; +} + +td.colLast div { + padding-top:0px; +} + + +td.colLast a { + padding-bottom:3px; +} +/* +Formatting effect styles +*/ +.sourceLineNo { + color:green; + padding:0 30px 0 0; +} +h1.hidden { + visibility:hidden; + overflow:hidden; + font-size:10px; +} +.block { + display:block; + margin:3px 10px 2px 0px; + color:#474747; +} +.deprecatedLabel, .descfrmTypeLabel, .memberNameLabel, .memberNameLink, +.overrideSpecifyLabel, .packageHierarchyLabel, .paramLabel, .returnLabel, +.seeLabel, .simpleTagLabel, .throwsLabel, .typeNameLabel, .typeNameLink { + font-weight:bold; +} +.deprecationComment, .emphasizedPhrase, .interfaceName { + font-style:italic; +} + +div.block div.block span.deprecationComment, div.block div.block span.emphasizedPhrase, +div.block div.block span.interfaceName { + font-style:normal; +} + +div.contentContainer ul.blockList li.blockList h2{ + padding-bottom:0px; +} diff --git a/prod-doc/en/ddxf/framework/data-storage/smart-contract-api.md b/prod-doc/en/ddxf/framework/data-storage/smart-contract-api.md new file mode 100644 index 00000000..de101faa --- /dev/null +++ b/prod-doc/en/ddxf/framework/data-storage/smart-contract-api.md @@ -0,0 +1,408 @@ +# DToken - smart contract api + +# eshop类型的 Data Token设计接口 + +## 1. Overview + +本文档是关于data Token的设计文档,主要参考[OEP-8](https://github.com/ontio/OEPs/blob/master/OEPS/OEP-8.mediawiki)标准 + + + +## 2. Method + + +### 2.1 createToken + +```python +def createToken(account:address, dataId:string, ontId:string, index:int, symbol:string, name:string, amount:int, transferCount:int, accessCount:int, expireTime:int) +``` + + + +- `account` + + 生成data token的接收地址,此地址必然已绑定在传入的ONT ID下 + +- `dataId` + + 已注册的dataId + +- `ontid` + + 控制人ONT ID + +- `index` + + 控制人ONT ID index + +- `symbol` + +- `name` + +- `amount` + + 生成data token的数量,每个data token 有唯一的token id,数量递增 + + 例如,当前最大的token id是100,amount 是10,则10个token 的token id + + 是101-110 + +- `transferCount` + + token可以流转的次数,初始大于0 + + 每transfer一次,次数减1 + +- `accessCount` + + token可以访问数据的次数,初始大于0 + + 每访问数据一次,可使用次数减1 + +- `expireTime` + + token的过期时间,如果为0,则意味不设置过期时间,如果大于0,则该该字段必须当前当前时间 + + 超过过期时间之后,token失效,无法流转 + + + +**tokenId:dataId:data = N:1:1** + + + +### 2.2 consumeToken + +```python +def consumeToken(tokenId:string) +``` + +- `tokenId` + +调用成功后,token的访问次数减1 + +### 2.3 getTransferCount + +```python +def getTransferCount(tokenId:string) +``` + +- `tokenId` + +查询token可以转账的次数 + +### 2.4 getAccessCount + +```python +def getAccessCount(tokenId:string) +``` + +- `tokenId` + +查询token可以访问数据的次数 + +### 2.5 getExpireTime + +```python +def getExpireTime(tokenId:string) +``` + +- `tokenId` + +查询token的过期时间 + +### 2.6 name + +```python +def name(tokenId:string) +``` +- `tokenId` + + 查询token名称 + +### 2.7 symbol +```python +def symbol(tokenid:string) +``` +- `tokenId` + + 查询token符号 + +### 2.8 totalSupply + +```python +def totalSupply() +``` + +查询已发行的token总量 + +### 2.9 transfer + +```python +def transfer(from:address, to:address, tokenId:string) +``` + +- `from` + +- `to` + +- `tokenId` + + + +### 2.10 transferMulti +```python +def transferMulti(args:array) +``` +- `args` + + args是**2.5 Transfer**接口的参数数组 + + + +### 2.11 approve +```python +def approve(owner:address, spender:address, tokenId:string) +``` +- `owner` +- `spender` +- `tokenId` + + + +本接口由`owner`调用,允许`spendner`消费指定`tokenId` 的token + +### 2.12 transferFrom +```python +def transferFrom(from:address, to:address, tokenId:string) +``` +- `from` + +- `to` + +- `tokenId` + + + +调用人`from`账户的的token支付给接收人`to`账户,此接口的调用人必须被`from`账户`approve`相应的权限 + +### 2.12 approveMulti +```python +def approveMulti(args:array) +``` +- `args` + + args是**2.7 approve**接口的参数数组 + + + +### 2.13 transferFromMulti +```python +def transferFromMulti(args:array) +``` +- `args` + + args是**2.8 transferFrom**接口的参数数组 + + + + +# data类型的 Data Token设计接口 + +## 1. Overview + +本文档是关于data Token的设计文档,主要参考[OEP-8](https://github.com/ontio/OEPs/blob/master/OEPS/OEP-8.mediawiki)标准 + + + +## 2. Method + + +### 2.1 mintToken + +```python +def mintToken(account:address, dataId:string, ontId:string, symbol:string, name:string, amount:int, transferCount:int, accessCount:int, expireTime:int) +``` + +**本接口 只提供给MarketPlace合约调用,个人账户无法调用** + +- `account` + + 生成data token的接收地址,此地址必然已绑定在传入的ONT ID下 + +- `dataId` + + 已注册的dataId + +- `ontid` + + 控制人ONT ID + +- `symbol` + +- `name` + +- `amount` + + 生成data token的数量,每个data token 有唯一的token id,数量递增 + + 例如,当前最大的token id是100,amount 是10,则10个token 的token id + + 是101-110 + +- `transferCount` + + token可以流转的次数,初始大于0 + + 每transfer一次,次数减1 + +- `accessCount` + + token可以访问数据的次数,初始大于0 + + 每访问数据一次,可使用次数减1 + +- `expireTime` + + token的过期时间,如果为0,则意味不设置过期时间,如果大于0,则该该字段必须当前当前时间 + + 超过过期时间之后,token失效,无法流转 + + + +**tokenId:dataId:data = N:1:1** + + + +### 2.2 consumeToken + +```python +def consumeToken(tokenId:string) +``` + +- `tokenId` + +调用成功后,token的访问次数减1 + +### 2.3 getTransferCount + +```python +def getTransferCount(tokenId:string) +``` + +- `tokenId` + +查询token可以转账的次数 + +### 2.4 getAccessCount + +```python +def getAccessCount(tokenId:string) +``` + +- `tokenId` + +查询token可以访问数据的次数 + +### 2.5 getExpireTime + +```python +def getExpireTime(tokenId:string) +``` + +- `tokenId` + +查询token的过期时间 + +### 2.6 name + +```python +def name(tokenId:string) +``` +- `tokenId` + + 查询token名称 + +### 2.7 symbol +```python +def symbol(tokenid:string) +``` +- `tokenId` + + 查询token符号 + +### 2.8 totalSupply + +```python +def totalSupply() +``` + +查询已发行的token总量 + +### 2.9 transfer + +```python +def transfer(from:address, to:address, tokenId:string) +``` + +- `from` + +- `to` + +- `tokenId` + + + +### 2.10 transferMulti +```python +def transferMulti(args:array) +``` +- `args` + + args是**2.5 Transfer**接口的参数数组 + + + +### 2.11 approve +```python +def approve(owner:address, spender:address, tokenId:string) +``` +- `owner` +- `spender` +- `tokenId` + + + +本接口由`owner`调用,允许`spendner`消费指定`tokenId` 的token + +### 2.12 transferFrom +```python +def transferFrom(from:address, to:address, tokenId:string) +``` +- `from` + +- `to` + +- `tokenId` + + + +调用人`from`账户的的token支付给接收人`to`账户,此接口的调用人必须被`from`账户`approve`相应的权限 + +### 2.12 approveMulti +```python +def approveMulti(args:array) +``` +- `args` + + args是**2.7 approve**接口的参数数组 + + + +### 2.13 transferFromMulti +```python +def transferFromMulti(args:array) +``` +- `args` + + args是**2.8 transferFrom**接口的参数数组 \ No newline at end of file diff --git a/prod-doc/en/ddxf/framework/extensions/README.md b/prod-doc/en/ddxf/framework/extensions/README.md new file mode 100644 index 00000000..63b7974b --- /dev/null +++ b/prod-doc/en/ddxf/framework/extensions/README.md @@ -0,0 +1,4 @@ +# Extensions of DDXF + +- More resource, more asset + - [cross chain asset](./cross-chain/README.md) \ No newline at end of file diff --git a/prod-doc/en/ddxf/framework/extensions/cross-chain/README.md b/prod-doc/en/ddxf/framework/extensions/cross-chain/README.md new file mode 100644 index 00000000..c6ad91ac --- /dev/null +++ b/prod-doc/en/ddxf/framework/extensions/cross-chain/README.md @@ -0,0 +1,2 @@ +# DDXF ext - cross chain + diff --git a/prod-doc/en/ddxf/framework/marketplace/README.md b/prod-doc/en/ddxf/framework/marketplace/README.md new file mode 100644 index 00000000..9781fe5c --- /dev/null +++ b/prod-doc/en/ddxf/framework/marketplace/README.md @@ -0,0 +1,35 @@ +# Marketplace + +## Roles and components + +角色定义遵从 GREP 描述。 + +1. 资源准备 + 1. 资源信息化(信息化安全存储) + 2. 资源数据特征抽取 +2. 资源(marketplace)发布 + 1. 资源审核 + 2. 资源交换元数据对齐 + 3. 交易合约确定 + 4. 违约保证金缴纳 +3. 交易 + 1. 需求确认,资源加工工作流预设 + 2. 资源整合和撮合,生成交易 + 1. 用户委托和数据特征撮合 + 2. 合约订单生成 + 3. 执行交易 + 1. 合约工作流驱动,数据加工、资源交换和数据交互 +4. 即时结算和纠纷仲裁 + +在实际使用过程中,根据交易特征和资源类型设计专属市场,根据实际情况对功能组件进行组合,实现资源市场的搭建。 + +## Host resource exchange + +1. [Deploy a marketplace](./deployment.md) + - Use [`Ontology general marketplace`](./saas-tenant.md) (SaaS) to run your own marketplace +2. [Marketplace RESTful api](./restful-api.md) + - [Smart contract api](./smart-contract-api.md) for marketplace +3. [Marketplace SDK - java](./sdk/java/javadoc/README.md) +4. Choose [scenarios](../../business/scenarios/README.md) to for the marketplace +5. Follow the workflow of the marketplace + diff --git a/prod-doc/en/ddxf/framework/marketplace/deployment.md b/prod-doc/en/ddxf/framework/marketplace/deployment.md new file mode 100644 index 00000000..39876ff9 --- /dev/null +++ b/prod-doc/en/ddxf/framework/marketplace/deployment.md @@ -0,0 +1,7 @@ +# Marketplace - deployment + +1. Deploy smart contract +2. Deploy docker +3. Config and run + 1. Smart contract configuration + 2. Server configuration \ No newline at end of file diff --git a/prod-doc/en/ddxf/framework/marketplace/restful-api.md b/prod-doc/en/ddxf/framework/marketplace/restful-api.md new file mode 100644 index 00000000..11c94ee7 --- /dev/null +++ b/prod-doc/en/ddxf/framework/marketplace/restful-api.md @@ -0,0 +1,332 @@ +# Marketplace - RESTful api + +* 1. [RESTful api](#RESTful api) + * 1.1. [上架](#上架) + * 1.2. [购买](#购买) + * 1.3. [确认](#确认) + * 1.4. [申诉](#申诉) + * 1.5. [仲裁](#仲裁) + * 1.6. [查询交易结果及返回的参数](#查询交易结果及返回的参数) + + +## RESTful api + +### 上架 +``` +url:/api/v1/order/auth +method:POST +``` + +请求: + +```json +{ + "dataId": "did:ont:ANYEUuWmPFrHM8XPYLJf2Z1PGAKSyBJ2G9", + "symbol": "symbol", + "name": "name", + "amount": 100, + "price": 10, + "transferCount": 10, + "accessCount": 10, + "expireTime": 0, + "makerReceiveAddress": "ARCESVnP8Lbf6S7FuTei3smA35EQYog4LR", + "mpReceiveAddress": "AR9NDnK3iMSZodbENnt7eX5TJ2s27fnHra", + "ojList": ["AR9NDnK3iMSZodbENnt7eX5TJ2s27fnHra"] +} +``` + +| Field Name | Type | Description | +|---|---|---| +|dataId|String|为数据生成的dataId| +|symbol|String|token的symbol| +|name|String|token的name| +|amount|int|授权生成token的数量| +|price|long|单价| +|transferCount|int|token的可流转次数| +|accessCount|int|token的可访问次数| +|expireTime|long|token的过期时间,0为永久有效| +|makerReceiveAddress|String|卖家收款地址| +|mpReceiveAddress|String|平台收款地址| +|ojList|List|仲裁者列表| + +响应: + +```json +{ + "action": "authOrder", + "error": 0, + "desc": "SUCCESS", + "result": { + "action": "signMessage", + "version": "v1.0.0", + "id": "10ba038e-48da-487b-96e8-8d3b99b6d18a", + "params": { + "type": "ontid", + "message": "7d7c4f01e0fa3c3203424644697b8d2266f337fb25b3ae89bc9575194a5d5ce7", + "ishex": true, + "callback": "http://101.132.193.149:4027/api/v1/data/invoke" + } + }, + "version": "v1" +} +``` + +| Field Name | Type | Description | +| :-- | :-- | :-- | +| action | String | 动作标志 | +| error | int | 错误码 | +| desc | String | 成功为SUCCESS,失败为错误描述 | +| result | Obj | 授权订单的交易hex,将result内容生成二维码,并让ONT Auth扫码| +| version | String | 版本号 | + + +### 购买 +``` +url:/api/v1/order/take +method:POST +``` + +请求: + +```json +{ + "authId": "b1f929778f7aaa9aed007e61eda05253dc0fef1c", + "takerReceiveAddress": "AMZvjuJNxD21uVgJ5c8VDdGUiT4TudtLFU", + "tokenAmount": 1, + "oj": "AJYEUcQi9jp157QXNWpKybwkCVSTuTNsh1" +} +``` + +| Field Name | Type | Description | +|---|---|---| +|authId|String|authOrder操作后在链上生成的id| +|takerReceiveAddress|String|买家付款及收取token地址| +|tokenAmount|int|购买的token数量| +|oj|String|选取的仲裁方| + + +响应: + +```json +{ + "action": "takeOrder", + "error": 0, + "desc": "SUCCESS", + "result": { + "action": "signMessage", + "version": "v1.0.0", + "id": "10ba038e-48da-487b-96e8-8d3b99b6d18a", + "params": { + "type": "ontid", + "message": "7d7c4f01e0fa3c3203424644697b8d2266f337fb25b3ae89bc9575194a5d5ce7", + "ishex": true, + "callback": "http://101.132.193.149:4027/api/v1/data/invoke" + } + }, + "version": "v1" +} +``` + +| Field Name | Type | Description | +| :-- | :-- | :-- | +| action | String | 动作标志 | +| error | int | 错误码 | +| desc | String | 成功为SUCCESS,失败为错误描述 | +| result | Obj | 下单的交易hex,将result内容生成二维码,并让ONT Auth扫码| +| version | String | 版本号 | + + +### 确认 +``` +url:/api/v1/order/confirm +method:POST +``` + +请求: + +```json +{ + "orderId": "2d8042e7d50a3e012ad3231a90f06b8615318319" +} +``` + +| Field Name | Type | Description | +|---|---|---| +|orderId|String|takeOrder操作后在链上生成的id| + + +响应: + +```json +{ + "action": "confirm", + "error": 0, + "desc": "SUCCESS", + "result": { + "action": "signMessage", + "version": "v1.0.0", + "id": "10ba038e-48da-487b-96e8-8d3b99b6d18a", + "params": { + "type": "ontid", + "message": "7d7c4f01e0fa3c3203424644697b8d2266f337fb25b3ae89bc9575194a5d5ce7", + "ishex": true, + "callback": "http://101.132.193.149:4027/api/v1/data/invoke" + } + }, + "version": "v1" +} +``` + +| Field Name | Type | Description | +| :-- | :-- | :-- | +| action | String | 动作标志 | +| error | int | 错误码 | +| desc | String | 成功为SUCCESS,失败为错误描述 | +| result | Obj | 确认订单的交易hex,将result内容生成二维码,并让ONT Auth扫码| +| version | String | 版本号 | + + +### 申诉 +``` +url:/api/v1/order/apply +method:POST +``` + +请求: + +```json +{ + "orderId": "2d8042e7d50a3e012ad3231a90f06b8615318319" +} +``` + +| Field Name | Type | Description | +|---|---|---| +|orderId|String|takeOrder操作后在链上生成的id| + + +响应: + +```json +{ + "action": "apply", + "error": 0, + "desc": "SUCCESS", + "result": { + "action": "signMessage", + "version": "v1.0.0", + "id": "10ba038e-48da-487b-96e8-8d3b99b6d18a", + "params": { + "type": "ontid", + "message": "7d7c4f01e0fa3c3203424644697b8d2266f337fb25b3ae89bc9575194a5d5ce7", + "ishex": true, + "callback": "http://101.132.193.149:4027/api/v1/data/invoke" + } + }, + "version": "v1" +} +``` + +| Field Name | Type | Description | +| :-- | :-- | :-- | +| action | String | 动作标志 | +| error | int | 错误码 | +| desc | String | 成功为SUCCESS,失败为错误描述 | +| result | Obj | 申诉的交易hex,将result内容生成二维码,并让ONT Auth扫码| +| version | String | 版本号 | + + +### 仲裁 +``` +url:/api/v1/order/arbitrage +method:POST +``` + +请求: + +```json +{ + "orderId": "2d8042e7d50a3e012ad3231a90f06b8615318319", + "isWin": true, + "makerReceiveAmount": 50000000, + "takerReceiveAmount": 1150000000 +} +``` + +| Field Name | Type | Description | +|---|---|---| +|orderId|String|takeOrder操作后在链上生成的id| +|isWin|boolean|仲裁判断结果,true为买家赢,false为卖家赢| +|makerReceiveAmount|long|卖家收款金额| +|takerReceiveAmount|long|买家收款金额| + + +响应: + +```json +{ + "action": "arbitrage", + "error": 0, + "desc": "SUCCESS", + "result": { + "action": "signMessage", + "version": "v1.0.0", + "id": "10ba038e-48da-487b-96e8-8d3b99b6d18a", + "params": { + "type": "ontid", + "message": "7d7c4f01e0fa3c3203424644697b8d2266f337fb25b3ae89bc9575194a5d5ce7", + "ishex": true, + "callback": "http://101.132.193.149:4027/api/v1/data/invoke" + } + }, + "version": "v1" +} +``` + +| Field Name | Type | Description | +| :-- | :-- | :-- | +| action | String | 动作标志 | +| error | int | 错误码 | +| desc | String | 成功为SUCCESS,失败为错误描述 | +| result | Obj | 仲裁的交易hex,将result内容生成二维码,并让ONT Auth扫码| +| version | String | 版本号 | + + +### 查询交易结果及返回的参数 + +``` +url:/back/result/{id} +method:Get +``` + +请求: +| Field Name | Type | Description | +|---|---|---| +|id |String|调用`上架`,`购买等`交易接口,返回result中的id | + +响应: + +```json +{ + "action": "actionResult", + "error": 0, + "desc": "SUCCESS", + "result": { + "result": "1", + "authId": "b1f929778f7aaa9aed007e61eda05253dc0fef1c", + "orderId": "2d8042e7d50a3e012ad3231a90f06b8615318319", + "tokenId": [1,10] + }, + "version": "v1" +} +``` +| Field Name | Type | Description | +| :-- | :-- | :-- | +| action | String | 动作标志 | +| error | int | 错误码 | +| desc | String | 成功为SUCCESS,失败为错误描述 | +| result | String | 成功返回"1",失败返回"0",没有查到链上信息返回null| +| authId | String | 上架后生成的授权id(只有调用上架接口才会返回) | +| orderId | String | 购买后生成的订单id(只有调用购买接口才会返回) | +| tokenId | List | 购买后生成的tokenId(只有调用购买接口才会返回),第一个元素表示起始token,第二个元素表示结束token | +| version | String | 版本号 | \ No newline at end of file diff --git a/prod-doc/en/ddxf/framework/marketplace/saas-tenant.md b/prod-doc/en/ddxf/framework/marketplace/saas-tenant.md new file mode 100644 index 00000000..3c53824c --- /dev/null +++ b/prod-doc/en/ddxf/framework/marketplace/saas-tenant.md @@ -0,0 +1,15 @@ +# Marketplace - tenant + +This document describes an easy way to use marketplace services: become a tenant of Ontology public data market. + +## 1. Prerequisite + +*[TBD]* + +## 2. Configuration + +*[TBD]* + +## Appendix I. the pricing model + +*[TBD]* \ No newline at end of file diff --git a/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/README.md b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/README.md new file mode 100644 index 00000000..46d8e5e4 --- /dev/null +++ b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/README.md @@ -0,0 +1 @@ +Javadoc is generated here. For usecase, please view [scenarios](../../../../business/scenarios/README.md) \ No newline at end of file diff --git a/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/allclasses-frame.html b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/allclasses-frame.html new file mode 100644 index 00000000..472f6c0b --- /dev/null +++ b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/allclasses-frame.html @@ -0,0 +1,26 @@ + + + + + + +All Classes + + + + + +

All Classes

+
+ +
+ + diff --git a/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/allclasses-noframe.html b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/allclasses-noframe.html new file mode 100644 index 00000000..4d9c9039 --- /dev/null +++ b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/allclasses-noframe.html @@ -0,0 +1,26 @@ + + + + + + +All Classes + + + + + +

All Classes

+
+ +
+ + diff --git a/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/com/ontology/dto/ArbitrageDto.html b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/com/ontology/dto/ArbitrageDto.html new file mode 100644 index 00000000..a9f47a65 --- /dev/null +++ b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/com/ontology/dto/ArbitrageDto.html @@ -0,0 +1,361 @@ + + + + + + +ArbitrageDto + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + + +
+
com.ontology.dto
+

Class ArbitrageDto

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/com/ontology/dto/AuthDto.html b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/com/ontology/dto/AuthDto.html new file mode 100644 index 00000000..8460e655 --- /dev/null +++ b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/com/ontology/dto/AuthDto.html @@ -0,0 +1,543 @@ + + + + + + +AuthDto + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + + +
+
com.ontology.dto
+

Class AuthDto

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/com/ontology/dto/PurchaseDto.html b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/com/ontology/dto/PurchaseDto.html new file mode 100644 index 00000000..e83f0eb8 --- /dev/null +++ b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/com/ontology/dto/PurchaseDto.html @@ -0,0 +1,361 @@ + + + + + + +PurchaseDto + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + + +
+
com.ontology.dto
+

Class PurchaseDto

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/com/ontology/dto/package-frame.html b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/com/ontology/dto/package-frame.html new file mode 100644 index 00000000..0d97d368 --- /dev/null +++ b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/com/ontology/dto/package-frame.html @@ -0,0 +1,23 @@ + + + + + + +com.ontology.dto + + + + + +

com.ontology.dto

+
+

Classes

+ +
+ + diff --git a/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/com/ontology/dto/package-summary.html b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/com/ontology/dto/package-summary.html new file mode 100644 index 00000000..01f4ed1a --- /dev/null +++ b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/com/ontology/dto/package-summary.html @@ -0,0 +1,149 @@ + + + + + + +com.ontology.dto + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
+

Package com.ontology.dto

+
+
+ +
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/com/ontology/dto/package-tree.html b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/com/ontology/dto/package-tree.html new file mode 100644 index 00000000..5ad4358e --- /dev/null +++ b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/com/ontology/dto/package-tree.html @@ -0,0 +1,138 @@ + + + + + + +com.ontology.dto Class Hierarchy + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
+

Hierarchy For Package com.ontology.dto

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/com/ontology/exception/MarketplaceSdkException.html b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/com/ontology/exception/MarketplaceSdkException.html new file mode 100644 index 00000000..1c34e434 --- /dev/null +++ b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/com/ontology/exception/MarketplaceSdkException.html @@ -0,0 +1,365 @@ + + + + + + +MarketplaceSdkException + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + + +
+
com.ontology.exception
+

Class MarketplaceSdkException

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/com/ontology/exception/package-frame.html b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/com/ontology/exception/package-frame.html new file mode 100644 index 00000000..e148eaf1 --- /dev/null +++ b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/com/ontology/exception/package-frame.html @@ -0,0 +1,21 @@ + + + + + + +com.ontology.exception + + + + + +

com.ontology.exception

+
+

Exceptions

+ +
+ + diff --git a/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/com/ontology/exception/package-summary.html b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/com/ontology/exception/package-summary.html new file mode 100644 index 00000000..b2c03ef4 --- /dev/null +++ b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/com/ontology/exception/package-summary.html @@ -0,0 +1,141 @@ + + + + + + +com.ontology.exception + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
+

Package com.ontology.exception

+
+
+ +
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/com/ontology/exception/package-tree.html b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/com/ontology/exception/package-tree.html new file mode 100644 index 00000000..44ec171e --- /dev/null +++ b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/com/ontology/exception/package-tree.html @@ -0,0 +1,148 @@ + + + + + + +com.ontology.exception Class Hierarchy + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
+

Hierarchy For Package com.ontology.exception

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/com/ontology/sdk/MarketplaceSdk.html b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/com/ontology/sdk/MarketplaceSdk.html new file mode 100644 index 00000000..62e9f43f --- /dev/null +++ b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/com/ontology/sdk/MarketplaceSdk.html @@ -0,0 +1,357 @@ + + + + + + +MarketplaceSdk + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + + +
+
com.ontology.sdk
+

Class MarketplaceSdk

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/com/ontology/sdk/package-frame.html b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/com/ontology/sdk/package-frame.html new file mode 100644 index 00000000..e39a05bc --- /dev/null +++ b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/com/ontology/sdk/package-frame.html @@ -0,0 +1,21 @@ + + + + + + +com.ontology.sdk + + + + + +

com.ontology.sdk

+
+

Classes

+ +
+ + diff --git a/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/com/ontology/sdk/package-summary.html b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/com/ontology/sdk/package-summary.html new file mode 100644 index 00000000..28e2ef32 --- /dev/null +++ b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/com/ontology/sdk/package-summary.html @@ -0,0 +1,141 @@ + + + + + + +com.ontology.sdk + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
+

Package com.ontology.sdk

+
+
+ +
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/com/ontology/sdk/package-tree.html b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/com/ontology/sdk/package-tree.html new file mode 100644 index 00000000..a00e1fc9 --- /dev/null +++ b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/com/ontology/sdk/package-tree.html @@ -0,0 +1,136 @@ + + + + + + +com.ontology.sdk Class Hierarchy + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
+

Hierarchy For Package com.ontology.sdk

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/com/ontology/utils/ErrorInfo.html b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/com/ontology/utils/ErrorInfo.html new file mode 100644 index 00000000..9382fcc9 --- /dev/null +++ b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/com/ontology/utils/ErrorInfo.html @@ -0,0 +1,820 @@ + + + + + + +ErrorInfo + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + + +
+
com.ontology.utils
+

Enum ErrorInfo

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/com/ontology/utils/HttpClientUtils.html b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/com/ontology/utils/HttpClientUtils.html new file mode 100644 index 00000000..6951c06a --- /dev/null +++ b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/com/ontology/utils/HttpClientUtils.html @@ -0,0 +1,319 @@ + + + + + + +HttpClientUtils + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + + +
+
com.ontology.utils
+

Class HttpClientUtils

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/com/ontology/utils/package-frame.html b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/com/ontology/utils/package-frame.html new file mode 100644 index 00000000..d0ad5a28 --- /dev/null +++ b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/com/ontology/utils/package-frame.html @@ -0,0 +1,25 @@ + + + + + + +com.ontology.utils + + + + + +

com.ontology.utils

+
+

Classes

+ +

Enums

+ +
+ + diff --git a/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/com/ontology/utils/package-summary.html b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/com/ontology/utils/package-summary.html new file mode 100644 index 00000000..12009db4 --- /dev/null +++ b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/com/ontology/utils/package-summary.html @@ -0,0 +1,156 @@ + + + + + + +com.ontology.utils + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
+

Package com.ontology.utils

+
+
+ +
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/com/ontology/utils/package-tree.html b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/com/ontology/utils/package-tree.html new file mode 100644 index 00000000..f0cb755f --- /dev/null +++ b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/com/ontology/utils/package-tree.html @@ -0,0 +1,148 @@ + + + + + + +com.ontology.utils Class Hierarchy + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
+

Hierarchy For Package com.ontology.utils

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +

Enum Hierarchy

+ +
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/constant-values.html b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/constant-values.html new file mode 100644 index 00000000..d06a24d1 --- /dev/null +++ b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/constant-values.html @@ -0,0 +1,123 @@ + + + + + + +Constant Field Values + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
+

Constant Field Values

+

Contents

+
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/deprecated-list.html b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/deprecated-list.html new file mode 100644 index 00000000..e2cc8106 --- /dev/null +++ b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/deprecated-list.html @@ -0,0 +1,123 @@ + + + + + + +Deprecated List + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
+

Deprecated API

+

Contents

+
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/help-doc.html b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/help-doc.html new file mode 100644 index 00000000..83b9fec3 --- /dev/null +++ b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/help-doc.html @@ -0,0 +1,224 @@ + + + + + + +API Help + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
+

How This API Document Is Organized

+
This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.
+
+
+ +This help file applies to API documentation generated using the standard doclet.
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/index-files/index-1.html b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/index-files/index-1.html new file mode 100644 index 00000000..f1240fbe --- /dev/null +++ b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/index-files/index-1.html @@ -0,0 +1,140 @@ + + + + + + +A-Index + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
A C D E G H M O P S T V  + + +

A

+
+
applyArbitrage(String) - Method in class com.ontology.sdk.MarketplaceSdk
+
 
+
arbitrage(ArbitrageDto) - Method in class com.ontology.sdk.MarketplaceSdk
+
 
+
ArbitrageDto - Class in com.ontology.dto
+
 
+
ArbitrageDto() - Constructor for class com.ontology.dto.ArbitrageDto
+
 
+
AuthDto - Class in com.ontology.dto
+
 
+
AuthDto() - Constructor for class com.ontology.dto.AuthDto
+
 
+
authOrder(AuthDto) - Method in class com.ontology.sdk.MarketplaceSdk
+
 
+
+A C D E G H M O P S T V 
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/index-files/index-10.html b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/index-files/index-10.html new file mode 100644 index 00000000..1b578f78 --- /dev/null +++ b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/index-files/index-10.html @@ -0,0 +1,166 @@ + + + + + + +S-Index + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
A C D E G H M O P S T V  + + +

S

+
+
setAccessCount(int) - Method in class com.ontology.dto.AuthDto
+
 
+
setAmount(int) - Method in class com.ontology.dto.AuthDto
+
 
+
setAuthId(String) - Method in class com.ontology.dto.PurchaseDto
+
 
+
setDataId(String) - Method in class com.ontology.dto.AuthDto
+
 
+
setExpireTime(long) - Method in class com.ontology.dto.AuthDto
+
 
+
setMakerReceiveAddress(String) - Method in class com.ontology.dto.AuthDto
+
 
+
setMakerReceiveAmount(long) - Method in class com.ontology.dto.ArbitrageDto
+
 
+
setMpReceiveAddress(String) - Method in class com.ontology.dto.AuthDto
+
 
+
setName(String) - Method in class com.ontology.dto.AuthDto
+
 
+
setOj(String) - Method in class com.ontology.dto.PurchaseDto
+
 
+
setOjList(List<String>) - Method in class com.ontology.dto.AuthDto
+
 
+
setOrderId(String) - Method in class com.ontology.dto.ArbitrageDto
+
 
+
setPrice(long) - Method in class com.ontology.dto.AuthDto
+
 
+
setRestfulUrl(String) - Method in class com.ontology.sdk.MarketplaceSdk
+
 
+
setSymbol(String) - Method in class com.ontology.dto.AuthDto
+
 
+
setTakerReceiveAddress(String) - Method in class com.ontology.dto.PurchaseDto
+
 
+
setTakerReceiveAmount(long) - Method in class com.ontology.dto.ArbitrageDto
+
 
+
setTokenAmount(String) - Method in class com.ontology.dto.PurchaseDto
+
 
+
setTransferCount(int) - Method in class com.ontology.dto.AuthDto
+
 
+
setWin(Boolean) - Method in class com.ontology.dto.ArbitrageDto
+
 
+
+A C D E G H M O P S T V 
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/index-files/index-11.html b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/index-files/index-11.html new file mode 100644 index 00000000..7e0a5fcf --- /dev/null +++ b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/index-files/index-11.html @@ -0,0 +1,130 @@ + + + + + + +T-Index + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
A C D E G H M O P S T V  + + +

T

+
+
takeOrder(PurchaseDto) - Method in class com.ontology.sdk.MarketplaceSdk
+
 
+
toString() - Method in exception com.ontology.exception.MarketplaceSdkException
+
 
+
+A C D E G H M O P S T V 
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/index-files/index-12.html b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/index-files/index-12.html new file mode 100644 index 00000000..41d0740f --- /dev/null +++ b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/index-files/index-12.html @@ -0,0 +1,135 @@ + + + + + + +V-Index + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
A C D E G H M O P S T V  + + +

V

+
+
valueOf(String) - Static method in enum com.ontology.utils.ErrorInfo
+
+
Returns the enum constant of this type with the specified name.
+
+
values() - Static method in enum com.ontology.utils.ErrorInfo
+
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
+A C D E G H M O P S T V 
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/index-files/index-2.html b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/index-files/index-2.html new file mode 100644 index 00000000..fdb983da --- /dev/null +++ b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/index-files/index-2.html @@ -0,0 +1,138 @@ + + + + + + +C-Index + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
A C D E G H M O P S T V  + + +

C

+
+
code() - Method in enum com.ontology.utils.ErrorInfo
+
 
+
com.ontology.dto - package com.ontology.dto
+
 
+
com.ontology.exception - package com.ontology.exception
+
 
+
com.ontology.sdk - package com.ontology.sdk
+
 
+
com.ontology.utils - package com.ontology.utils
+
 
+
confirmOrder(String) - Method in class com.ontology.sdk.MarketplaceSdk
+
 
+
+A C D E G H M O P S T V 
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/index-files/index-3.html b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/index-files/index-3.html new file mode 100644 index 00000000..db24ecd4 --- /dev/null +++ b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/index-files/index-3.html @@ -0,0 +1,130 @@ + + + + + + +D-Index + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
A C D E G H M O P S T V  + + +

D

+
+
descCN() - Method in enum com.ontology.utils.ErrorInfo
+
 
+
descEN() - Method in enum com.ontology.utils.ErrorInfo
+
 
+
+A C D E G H M O P S T V 
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/index-files/index-4.html b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/index-files/index-4.html new file mode 100644 index 00000000..110a3fc0 --- /dev/null +++ b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/index-files/index-4.html @@ -0,0 +1,128 @@ + + + + + + +E-Index + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
A C D E G H M O P S T V  + + +

E

+
+
ErrorInfo - Enum in com.ontology.utils
+
 
+
+A C D E G H M O P S T V 
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/index-files/index-5.html b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/index-files/index-5.html new file mode 100644 index 00000000..1913d5ef --- /dev/null +++ b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/index-files/index-5.html @@ -0,0 +1,172 @@ + + + + + + +G-Index + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
A C D E G H M O P S T V  + + +

G

+
+
getAccessCount() - Method in class com.ontology.dto.AuthDto
+
 
+
getAmount() - Method in class com.ontology.dto.AuthDto
+
 
+
getAuthId() - Method in class com.ontology.dto.PurchaseDto
+
 
+
getDataId() - Method in class com.ontology.dto.AuthDto
+
 
+
getErrCode() - Method in exception com.ontology.exception.MarketplaceSdkException
+
 
+
getErrDesCN() - Method in exception com.ontology.exception.MarketplaceSdkException
+
 
+
getErrDesEN() - Method in exception com.ontology.exception.MarketplaceSdkException
+
 
+
getExpireTime() - Method in class com.ontology.dto.AuthDto
+
 
+
getInstance(String) - Static method in class com.ontology.sdk.MarketplaceSdk
+
 
+
getMakerReceiveAddress() - Method in class com.ontology.dto.AuthDto
+
 
+
getMakerReceiveAmount() - Method in class com.ontology.dto.ArbitrageDto
+
 
+
getMpReceiveAddress() - Method in class com.ontology.dto.AuthDto
+
 
+
getName() - Method in class com.ontology.dto.AuthDto
+
 
+
getOj() - Method in class com.ontology.dto.PurchaseDto
+
 
+
getOjList() - Method in class com.ontology.dto.AuthDto
+
 
+
getOrderId() - Method in class com.ontology.dto.ArbitrageDto
+
 
+
getPrice() - Method in class com.ontology.dto.AuthDto
+
 
+
getSymbol() - Method in class com.ontology.dto.AuthDto
+
 
+
getTakerReceiveAddress() - Method in class com.ontology.dto.PurchaseDto
+
 
+
getTakerReceiveAmount() - Method in class com.ontology.dto.ArbitrageDto
+
 
+
getTokenAmount() - Method in class com.ontology.dto.PurchaseDto
+
 
+
getTransferCount() - Method in class com.ontology.dto.AuthDto
+
 
+
getWin() - Method in class com.ontology.dto.ArbitrageDto
+
 
+
+A C D E G H M O P S T V 
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/index-files/index-6.html b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/index-files/index-6.html new file mode 100644 index 00000000..e6149acf --- /dev/null +++ b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/index-files/index-6.html @@ -0,0 +1,138 @@ + + + + + + +H-Index + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
A C D E G H M O P S T V  + + +

H

+
+
httpClientGet(String, Map<String, Object>, Map<String, Object>) - Method in class com.ontology.utils.HttpClientUtils
+
+
httpclient get请求
+
+
httpClientPost(String, String, Map<String, Object>) - Method in class com.ontology.utils.HttpClientUtils
+
+
httpclient post请求
+
+
HttpClientUtils - Class in com.ontology.utils
+
 
+
HttpClientUtils() - Constructor for class com.ontology.utils.HttpClientUtils
+
 
+
+A C D E G H M O P S T V 
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/index-files/index-7.html b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/index-files/index-7.html new file mode 100644 index 00000000..eab04582 --- /dev/null +++ b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/index-files/index-7.html @@ -0,0 +1,134 @@ + + + + + + +M-Index + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
A C D E G H M O P S T V  + + +

M

+
+
MarketplaceSdk - Class in com.ontology.sdk
+
 
+
MarketplaceSdkException - Exception in com.ontology.exception
+
 
+
MarketplaceSdkException(long, String, String, String) - Constructor for exception com.ontology.exception.MarketplaceSdkException
+
 
+
MarketplaceSdkException(long, String, String) - Constructor for exception com.ontology.exception.MarketplaceSdkException
+
 
+
+A C D E G H M O P S T V 
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/index-files/index-8.html b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/index-files/index-8.html new file mode 100644 index 00000000..b4710c59 --- /dev/null +++ b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/index-files/index-8.html @@ -0,0 +1,128 @@ + + + + + + +O-Index + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
A C D E G H M O P S T V  + + +

O

+
+
orderResult(String) - Method in class com.ontology.sdk.MarketplaceSdk
+
 
+
+A C D E G H M O P S T V 
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/index-files/index-9.html b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/index-files/index-9.html new file mode 100644 index 00000000..b54b8b17 --- /dev/null +++ b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/index-files/index-9.html @@ -0,0 +1,130 @@ + + + + + + +P-Index + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
A C D E G H M O P S T V  + + +

P

+
+
PurchaseDto - Class in com.ontology.dto
+
 
+
PurchaseDto() - Constructor for class com.ontology.dto.PurchaseDto
+
 
+
+A C D E G H M O P S T V 
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/index.html b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/index.html new file mode 100644 index 00000000..9f787d1c --- /dev/null +++ b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/index.html @@ -0,0 +1,76 @@ + + + + + + +Generated Documentation (Untitled) + + + + + + + + + +<noscript> +<div>JavaScript is disabled on your browser.</div> +</noscript> +<h2>Frame Alert</h2> +<p>This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. Link to <a href="overview-summary.html">Non-frame version</a>.</p> + + + diff --git a/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/overview-frame.html b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/overview-frame.html new file mode 100644 index 00000000..c56cb8a4 --- /dev/null +++ b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/overview-frame.html @@ -0,0 +1,25 @@ + + + + + + +Overview List + + + + + +
All Classes
+
+

Packages

+ +
+

 

+ + diff --git a/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/overview-summary.html b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/overview-summary.html new file mode 100644 index 00000000..5f64ddce --- /dev/null +++ b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/overview-summary.html @@ -0,0 +1,146 @@ + + + + + + +Overview + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
Packages 
PackageDescription
com.ontology.dto 
com.ontology.exception 
com.ontology.sdk 
com.ontology.utils 
+
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/overview-tree.html b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/overview-tree.html new file mode 100644 index 00000000..87795224 --- /dev/null +++ b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/overview-tree.html @@ -0,0 +1,168 @@ + + + + + + +Class Hierarchy + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
+

Hierarchy For All Packages

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +

Enum Hierarchy

+ +
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/package-list b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/package-list new file mode 100644 index 00000000..3cc93746 --- /dev/null +++ b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/package-list @@ -0,0 +1,4 @@ +com.ontology.dto +com.ontology.exception +com.ontology.sdk +com.ontology.utils diff --git a/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/script.js b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/script.js new file mode 100644 index 00000000..b3463569 --- /dev/null +++ b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/script.js @@ -0,0 +1,30 @@ +function show(type) +{ + count = 0; + for (var key in methods) { + var row = document.getElementById(key); + if ((methods[key] & type) != 0) { + row.style.display = ''; + row.className = (count++ % 2) ? rowColor : altColor; + } + else + row.style.display = 'none'; + } + updateTabs(type); +} + +function updateTabs(type) +{ + for (var value in tabs) { + var sNode = document.getElementById(tabs[value][0]); + var spanNode = sNode.firstChild; + if (value == type) { + sNode.className = activeTableTab; + spanNode.innerHTML = tabs[value][1]; + } + else { + sNode.className = tableTab; + spanNode.innerHTML = "" + tabs[value][1] + ""; + } + } +} diff --git a/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/serialized-form.html b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/serialized-form.html new file mode 100644 index 00000000..270ff92a --- /dev/null +++ b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/serialized-form.html @@ -0,0 +1,155 @@ + + + + + + +Serialized Form + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
+

Serialized Form

+
+
+ +
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/stylesheet.css b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/stylesheet.css new file mode 100644 index 00000000..98055b22 --- /dev/null +++ b/prod-doc/en/ddxf/framework/marketplace/sdk/java/javadoc/marketplace-sdk/stylesheet.css @@ -0,0 +1,574 @@ +/* Javadoc style sheet */ +/* +Overall document style +*/ + +@import url('resources/fonts/dejavu.css'); + +body { + background-color:#ffffff; + color:#353833; + font-family:'DejaVu Sans', Arial, Helvetica, sans-serif; + font-size:14px; + margin:0; +} +a:link, a:visited { + text-decoration:none; + color:#4A6782; +} +a:hover, a:focus { + text-decoration:none; + color:#bb7a2a; +} +a:active { + text-decoration:none; + color:#4A6782; +} +a[name] { + color:#353833; +} +a[name]:hover { + text-decoration:none; + color:#353833; +} +pre { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; +} +h1 { + font-size:20px; +} +h2 { + font-size:18px; +} +h3 { + font-size:16px; + font-style:italic; +} +h4 { + font-size:13px; +} +h5 { + font-size:12px; +} +h6 { + font-size:11px; +} +ul { + list-style-type:disc; +} +code, tt { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + padding-top:4px; + margin-top:8px; + line-height:1.4em; +} +dt code { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + padding-top:4px; +} +table tr td dt code { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + vertical-align:top; + padding-top:4px; +} +sup { + font-size:8px; +} +/* +Document title and Copyright styles +*/ +.clear { + clear:both; + height:0px; + overflow:hidden; +} +.aboutLanguage { + float:right; + padding:0px 21px; + font-size:11px; + z-index:200; + margin-top:-9px; +} +.legalCopy { + margin-left:.5em; +} +.bar a, .bar a:link, .bar a:visited, .bar a:active { + color:#FFFFFF; + text-decoration:none; +} +.bar a:hover, .bar a:focus { + color:#bb7a2a; +} +.tab { + background-color:#0066FF; + color:#ffffff; + padding:8px; + width:5em; + font-weight:bold; +} +/* +Navigation bar styles +*/ +.bar { + background-color:#4D7A97; + color:#FFFFFF; + padding:.8em .5em .4em .8em; + height:auto;/*height:1.8em;*/ + font-size:11px; + margin:0; +} +.topNav { + background-color:#4D7A97; + color:#FFFFFF; + float:left; + padding:0; + width:100%; + clear:right; + height:2.8em; + padding-top:10px; + overflow:hidden; + font-size:12px; +} +.bottomNav { + margin-top:10px; + background-color:#4D7A97; + color:#FFFFFF; + float:left; + padding:0; + width:100%; + clear:right; + height:2.8em; + padding-top:10px; + overflow:hidden; + font-size:12px; +} +.subNav { + background-color:#dee3e9; + float:left; + width:100%; + overflow:hidden; + font-size:12px; +} +.subNav div { + clear:left; + float:left; + padding:0 0 5px 6px; + text-transform:uppercase; +} +ul.navList, ul.subNavList { + float:left; + margin:0 25px 0 0; + padding:0; +} +ul.navList li{ + list-style:none; + float:left; + padding: 5px 6px; + text-transform:uppercase; +} +ul.subNavList li{ + list-style:none; + float:left; +} +.topNav a:link, .topNav a:active, .topNav a:visited, .bottomNav a:link, .bottomNav a:active, .bottomNav a:visited { + color:#FFFFFF; + text-decoration:none; + text-transform:uppercase; +} +.topNav a:hover, .bottomNav a:hover { + text-decoration:none; + color:#bb7a2a; + text-transform:uppercase; +} +.navBarCell1Rev { + background-color:#F8981D; + color:#253441; + margin: auto 5px; +} +.skipNav { + position:absolute; + top:auto; + left:-9999px; + overflow:hidden; +} +/* +Page header and footer styles +*/ +.header, .footer { + clear:both; + margin:0 20px; + padding:5px 0 0 0; +} +.indexHeader { + margin:10px; + position:relative; +} +.indexHeader span{ + margin-right:15px; +} +.indexHeader h1 { + font-size:13px; +} +.title { + color:#2c4557; + margin:10px 0; +} +.subTitle { + margin:5px 0 0 0; +} +.header ul { + margin:0 0 15px 0; + padding:0; +} +.footer ul { + margin:20px 0 5px 0; +} +.header ul li, .footer ul li { + list-style:none; + font-size:13px; +} +/* +Heading styles +*/ +div.details ul.blockList ul.blockList ul.blockList li.blockList h4, div.details ul.blockList ul.blockList ul.blockListLast li.blockList h4 { + background-color:#dee3e9; + border:1px solid #d0d9e0; + margin:0 0 6px -8px; + padding:7px 5px; +} +ul.blockList ul.blockList ul.blockList li.blockList h3 { + background-color:#dee3e9; + border:1px solid #d0d9e0; + margin:0 0 6px -8px; + padding:7px 5px; +} +ul.blockList ul.blockList li.blockList h3 { + padding:0; + margin:15px 0; +} +ul.blockList li.blockList h2 { + padding:0px 0 20px 0; +} +/* +Page layout container styles +*/ +.contentContainer, .sourceContainer, .classUseContainer, .serializedFormContainer, .constantValuesContainer { + clear:both; + padding:10px 20px; + position:relative; +} +.indexContainer { + margin:10px; + position:relative; + font-size:12px; +} +.indexContainer h2 { + font-size:13px; + padding:0 0 3px 0; +} +.indexContainer ul { + margin:0; + padding:0; +} +.indexContainer ul li { + list-style:none; + padding-top:2px; +} +.contentContainer .description dl dt, .contentContainer .details dl dt, .serializedFormContainer dl dt { + font-size:12px; + font-weight:bold; + margin:10px 0 0 0; + color:#4E4E4E; +} +.contentContainer .description dl dd, .contentContainer .details dl dd, .serializedFormContainer dl dd { + margin:5px 0 10px 0px; + font-size:14px; + font-family:'DejaVu Sans Mono',monospace; +} +.serializedFormContainer dl.nameValue dt { + margin-left:1px; + font-size:1.1em; + display:inline; + font-weight:bold; +} +.serializedFormContainer dl.nameValue dd { + margin:0 0 0 1px; + font-size:1.1em; + display:inline; +} +/* +List styles +*/ +ul.horizontal li { + display:inline; + font-size:0.9em; +} +ul.inheritance { + margin:0; + padding:0; +} +ul.inheritance li { + display:inline; + list-style:none; +} +ul.inheritance li ul.inheritance { + margin-left:15px; + padding-left:15px; + padding-top:1px; +} +ul.blockList, ul.blockListLast { + margin:10px 0 10px 0; + padding:0; +} +ul.blockList li.blockList, ul.blockListLast li.blockList { + list-style:none; + margin-bottom:15px; + line-height:1.4; +} +ul.blockList ul.blockList li.blockList, ul.blockList ul.blockListLast li.blockList { + padding:0px 20px 5px 10px; + border:1px solid #ededed; + background-color:#f8f8f8; +} +ul.blockList ul.blockList ul.blockList li.blockList, ul.blockList ul.blockList ul.blockListLast li.blockList { + padding:0 0 5px 8px; + background-color:#ffffff; + border:none; +} +ul.blockList ul.blockList ul.blockList ul.blockList li.blockList { + margin-left:0; + padding-left:0; + padding-bottom:15px; + border:none; +} +ul.blockList ul.blockList ul.blockList ul.blockList li.blockListLast { + list-style:none; + border-bottom:none; + padding-bottom:0; +} +table tr td dl, table tr td dl dt, table tr td dl dd { + margin-top:0; + margin-bottom:1px; +} +/* +Table styles +*/ +.overviewSummary, .memberSummary, .typeSummary, .useSummary, .constantsSummary, .deprecatedSummary { + width:100%; + border-left:1px solid #EEE; + border-right:1px solid #EEE; + border-bottom:1px solid #EEE; +} +.overviewSummary, .memberSummary { + padding:0px; +} +.overviewSummary caption, .memberSummary caption, .typeSummary caption, +.useSummary caption, .constantsSummary caption, .deprecatedSummary caption { + position:relative; + text-align:left; + background-repeat:no-repeat; + color:#253441; + font-weight:bold; + clear:none; + overflow:hidden; + padding:0px; + padding-top:10px; + padding-left:1px; + margin:0px; + white-space:pre; +} +.overviewSummary caption a:link, .memberSummary caption a:link, .typeSummary caption a:link, +.useSummary caption a:link, .constantsSummary caption a:link, .deprecatedSummary caption a:link, +.overviewSummary caption a:hover, .memberSummary caption a:hover, .typeSummary caption a:hover, +.useSummary caption a:hover, .constantsSummary caption a:hover, .deprecatedSummary caption a:hover, +.overviewSummary caption a:active, .memberSummary caption a:active, .typeSummary caption a:active, +.useSummary caption a:active, .constantsSummary caption a:active, .deprecatedSummary caption a:active, +.overviewSummary caption a:visited, .memberSummary caption a:visited, .typeSummary caption a:visited, +.useSummary caption a:visited, .constantsSummary caption a:visited, .deprecatedSummary caption a:visited { + color:#FFFFFF; +} +.overviewSummary caption span, .memberSummary caption span, .typeSummary caption span, +.useSummary caption span, .constantsSummary caption span, .deprecatedSummary caption span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + padding-bottom:7px; + display:inline-block; + float:left; + background-color:#F8981D; + border: none; + height:16px; +} +.memberSummary caption span.activeTableTab span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + margin-right:3px; + display:inline-block; + float:left; + background-color:#F8981D; + height:16px; +} +.memberSummary caption span.tableTab span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + margin-right:3px; + display:inline-block; + float:left; + background-color:#4D7A97; + height:16px; +} +.memberSummary caption span.tableTab, .memberSummary caption span.activeTableTab { + padding-top:0px; + padding-left:0px; + padding-right:0px; + background-image:none; + float:none; + display:inline; +} +.overviewSummary .tabEnd, .memberSummary .tabEnd, .typeSummary .tabEnd, +.useSummary .tabEnd, .constantsSummary .tabEnd, .deprecatedSummary .tabEnd { + display:none; + width:5px; + position:relative; + float:left; + background-color:#F8981D; +} +.memberSummary .activeTableTab .tabEnd { + display:none; + width:5px; + margin-right:3px; + position:relative; + float:left; + background-color:#F8981D; +} +.memberSummary .tableTab .tabEnd { + display:none; + width:5px; + margin-right:3px; + position:relative; + background-color:#4D7A97; + float:left; + +} +.overviewSummary td, .memberSummary td, .typeSummary td, +.useSummary td, .constantsSummary td, .deprecatedSummary td { + text-align:left; + padding:0px 0px 12px 10px; +} +th.colOne, th.colFirst, th.colLast, .useSummary th, .constantsSummary th, +td.colOne, td.colFirst, td.colLast, .useSummary td, .constantsSummary td{ + vertical-align:top; + padding-right:0px; + padding-top:8px; + padding-bottom:3px; +} +th.colFirst, th.colLast, th.colOne, .constantsSummary th { + background:#dee3e9; + text-align:left; + padding:8px 3px 3px 7px; +} +td.colFirst, th.colFirst { + white-space:nowrap; + font-size:13px; +} +td.colLast, th.colLast { + font-size:13px; +} +td.colOne, th.colOne { + font-size:13px; +} +.overviewSummary td.colFirst, .overviewSummary th.colFirst, +.useSummary td.colFirst, .useSummary th.colFirst, +.overviewSummary td.colOne, .overviewSummary th.colOne, +.memberSummary td.colFirst, .memberSummary th.colFirst, +.memberSummary td.colOne, .memberSummary th.colOne, +.typeSummary td.colFirst{ + width:25%; + vertical-align:top; +} +td.colOne a:link, td.colOne a:active, td.colOne a:visited, td.colOne a:hover, td.colFirst a:link, td.colFirst a:active, td.colFirst a:visited, td.colFirst a:hover, td.colLast a:link, td.colLast a:active, td.colLast a:visited, td.colLast a:hover, .constantValuesContainer td a:link, .constantValuesContainer td a:active, .constantValuesContainer td a:visited, .constantValuesContainer td a:hover { + font-weight:bold; +} +.tableSubHeadingColor { + background-color:#EEEEFF; +} +.altColor { + background-color:#FFFFFF; +} +.rowColor { + background-color:#EEEEEF; +} +/* +Content styles +*/ +.description pre { + margin-top:0; +} +.deprecatedContent { + margin:0; + padding:10px 0; +} +.docSummary { + padding:0; +} + +ul.blockList ul.blockList ul.blockList li.blockList h3 { + font-style:normal; +} + +div.block { + font-size:14px; + font-family:'DejaVu Serif', Georgia, "Times New Roman", Times, serif; +} + +td.colLast div { + padding-top:0px; +} + + +td.colLast a { + padding-bottom:3px; +} +/* +Formatting effect styles +*/ +.sourceLineNo { + color:green; + padding:0 30px 0 0; +} +h1.hidden { + visibility:hidden; + overflow:hidden; + font-size:10px; +} +.block { + display:block; + margin:3px 10px 2px 0px; + color:#474747; +} +.deprecatedLabel, .descfrmTypeLabel, .memberNameLabel, .memberNameLink, +.overrideSpecifyLabel, .packageHierarchyLabel, .paramLabel, .returnLabel, +.seeLabel, .simpleTagLabel, .throwsLabel, .typeNameLabel, .typeNameLink { + font-weight:bold; +} +.deprecationComment, .emphasizedPhrase, .interfaceName { + font-style:italic; +} + +div.block div.block span.deprecationComment, div.block div.block span.emphasizedPhrase, +div.block div.block span.interfaceName { + font-style:normal; +} + +div.contentContainer ul.blockList li.blockList h2{ + padding-bottom:0px; +} diff --git a/prod-doc/en/ddxf/framework/marketplace/smart-contract-api.md b/prod-doc/en/ddxf/framework/marketplace/smart-contract-api.md new file mode 100644 index 00000000..4dd3a709 --- /dev/null +++ b/prod-doc/en/ddxf/framework/marketplace/smart-contract-api.md @@ -0,0 +1,179 @@ +# Marketplace - smart contract api + +# 交易合约 + +## 1. 概述 + +**术语**: + +- `RP ` + + 资源提供者 + +- `RC` + + 资源需求者 + +- `RA` + + 资源认证方 + +- `OJ` + + 链下仲裁者 + +- `MP` + + market place + + + + +## 2. 相关合约 + +- MaketPlace交易合约 + + 该本合约是Market place主合约,涉及到交易从挂单到成交所有阶段 + +- market place手续费规则合约 + + 目前以交易额的5%收取,保留升级接口 + +- OJ仲裁费规则合约 + + 目前以交易额的5%收取,保留升级接口 + +- RP挂单抵押金额规则合约 + + 目前以交易金额的20%收取保证金,保留升级接口 + + + +## 3. 接口 + +#### 3.1 AuthOrder + +参数: + +- `dataId` + +- `index` + +- `symbol` + +- `name` + +- `authAmount` + + 授权marketplace生成token的数量,例如authAmount=10,即最多生成10个data token + +- `price` + + 单个token的价格,以ONG标价 + +- `transferCount` + +- `accessCount` + +- `expireTime` + +- `makerTokenHash` + Maker 抵押的data token合约hash + +- `makerReceiveAddress` + + RP收款钱包地址 + +- `mpReceiveAddress` + + MP收款钱包地址 + +- `OJList` + + 仲裁者地址(wallet address)列表,至少有一个OJ + +调用成功后,合约会生成唯一的Auth ID + +### 3.2 cancelAuth + +本接口供`RC`调用,RC取消生成dataToken的授权 + +调用成功后,authId失效,RP无法通过authId购买商品 + +参数: + +- `authId` + + + + +### 3.3 takeOrder + +参数: + +- `authId` + + `3.1`接口生成的auth id + +- `takerReceiveAddress` + + RC的钱包地址 + +- `tokenAmount` + + RP购买token的数量,RP购买成功后,对应authId的authAmount会扣减相应数量 + +- `OJ` + + 由`RC`选择的唯一的OJ + +### 3.4 applyArbitrage + +`RC`申请仲裁,RC需要抵押仲裁费到合约 + +参数: + +- `orderId` + +- `arbitrageFee` + + 仲裁费数量,该数量应该和**3.1**RP挂单的仲裁费相同,否则交易失败 + + + +### 3.5 arbitrage + +`OJ`对指定一笔交易发起线下仲裁,得出结论后,调用本接口最终裁定。 + +调用本接口代表订单结束,订单分润一并完成 + +参数: + +- `orderId` + +- `winOrLoss` + + 挑战是否成功 + +- `makerReceiveAmount` + + RC仲裁后收到的ONG数量 + +- `takerReceiveAmount` + + RP仲裁后收到的ONG数量 + + + +**注意:makerReceiveAmount + takerReceiveAmount = 总交易额(ONG) + RC已抵押的抵押费** + +### 3.6 confirm + +本接口可以在订单`expire time`之后由任意人调用,若在此之前,只有`RC`可以调用 + +订单一经确认,不可更改,订单分润一并完成。 + +- `orderId` + + + diff --git a/prod-doc/en/ddxf/framework/resource-audit/README.md b/prod-doc/en/ddxf/framework/resource-audit/README.md new file mode 100644 index 00000000..cd311595 --- /dev/null +++ b/prod-doc/en/ddxf/framework/resource-audit/README.md @@ -0,0 +1,12 @@ +# Resource audit + +- Resource audit + - [Data audit](./data-audit.md) + - [Traceability on data transactions](./tx-trace.md) + - [Offline audit](./offline-audit.md) +- [Dispute arbitration](./ont-sign.md) + - Resource claim and audit before go to market + - Contract/eContract sign for token transfering and exchange + - Fulfill the terms of a contract +- [Reputation score](./reputation-score.md) upon completed transactions +- [Smart contract api](./smart-contract-api.md) for resource audit diff --git a/prod-doc/en/ddxf/framework/resource-audit/data-audit.md b/prod-doc/en/ddxf/framework/resource-audit/data-audit.md new file mode 100644 index 00000000..1d5b6f78 --- /dev/null +++ b/prod-doc/en/ddxf/framework/resource-audit/data-audit.md @@ -0,0 +1,2 @@ +# Data audit + diff --git a/prod-doc/en/ddxf/framework/resource-audit/offline-audit.md b/prod-doc/en/ddxf/framework/resource-audit/offline-audit.md new file mode 100644 index 00000000..cfe8b7ae --- /dev/null +++ b/prod-doc/en/ddxf/framework/resource-audit/offline-audit.md @@ -0,0 +1,3 @@ +# Offline audit + +Offline audit and judgement \ No newline at end of file diff --git a/prod-doc/en/ddxf/framework/resource-audit/ont-sign.md b/prod-doc/en/ddxf/framework/resource-audit/ont-sign.md new file mode 100644 index 00000000..7aa5b3a2 --- /dev/null +++ b/prod-doc/en/ddxf/framework/resource-audit/ont-sign.md @@ -0,0 +1,2 @@ +# ONT Sign + diff --git a/prod-doc/en/ddxf/framework/resource-audit/reputation-score.md b/prod-doc/en/ddxf/framework/resource-audit/reputation-score.md new file mode 100644 index 00000000..ae4ed74f --- /dev/null +++ b/prod-doc/en/ddxf/framework/resource-audit/reputation-score.md @@ -0,0 +1,8 @@ +# Reputation system of trust mechanism - ONT Score + +声誉机制是交易系统的重要组成部分,可以促进交易的合法执行,减少欺诈行为,同时帮助交易参与者甄选交易对手。良好的声誉可以帮助用户得到更多的交易机会。每个用户通过获得评价来积累声誉。因为使用 ONT ID 作为用户身份标识,所以用户的声誉也会绑定到其 ONT ID。声誉的计算包含三个层次: + +- 单次交易评价:一次交易之后用户评价获得的声誉; +- 累积声誉:用户在一个市场多次交易累积的声誉; +- 全局声誉:用户在链上累积的各市场的声誉汇总。 + diff --git a/prod-doc/en/ddxf/framework/resource-audit/smart-contract-api.md b/prod-doc/en/ddxf/framework/resource-audit/smart-contract-api.md new file mode 100644 index 00000000..0e510d08 --- /dev/null +++ b/prod-doc/en/ddxf/framework/resource-audit/smart-contract-api.md @@ -0,0 +1,2 @@ +# Resource audit - smart contract api + diff --git a/prod-doc/en/ddxf/framework/resource-audit/tx-trace.md b/prod-doc/en/ddxf/framework/resource-audit/tx-trace.md new file mode 100644 index 00000000..48730fc4 --- /dev/null +++ b/prod-doc/en/ddxf/framework/resource-audit/tx-trace.md @@ -0,0 +1,3 @@ +# Transaction trace + +- Data traceability upon transfering, exchange and processing \ No newline at end of file diff --git a/prod-doc/en/ddxf/framework/spec/data-token.md b/prod-doc/en/ddxf/framework/spec/data-token.md new file mode 100644 index 00000000..86ecc1a2 --- /dev/null +++ b/prod-doc/en/ddxf/framework/spec/data-token.md @@ -0,0 +1,25 @@ +# Data token specification + +在执行交易时,RP 为该资源生成一个 DToken(以智能合约的形式实现),包含对该资源 [`ONT ID`](../../../ontid/framework/README.md) 的引用、该 DToken 持有者的的 ONT ID 以及有效期等。DToken 可以是同质化 Token,例如,对房产的众筹分割。也可以是非同质化 Token,如一对一的数据交割。 + +DToken 的标准格式如下(在实际数据和资源使用过程中定义的DToken,根据需要添加其它属性), + +``` +type DToken struct { + Name //该 DToken 的名字 + Symbol //该 DToken 的符号 + Amount //该 DToken 的数量 + ResourceID //对应资源的引用,该资源的 ONT ID + RealContractDigest //双方经由 ONT Sign 签订的电子合同存证信息 + Expires //资源权力的有效期 + Exchange //该 DToken 可以流转的次数,设为 0 即表示不可流转 + Status //该 DToken 的使用状态,表示是否可使用。也可使用计数器方式 +} +``` + +DToken 的初始持有者即为 RC,随后该 DToken 可被(签发交易)流转给其他人。RP 在 DToken 时可以生成设定其流转次数限制,每次流转时该次数递减,流转次数为 0 即表示不可流转。 + +DToken 的使用状态初始置于 “未使用” 状态(即使剩余流转次数为 0)。当持有者要从 RP 处获取 链外资源权限时,需要先将 DToken 的状态置为 “使用”。处于该状态的 DToken 不能够再进行流转转移。当资源可以被多次 “使用” 时,可以将使用状态设置成计数方式,初始值为可允许的次数。当持有者要从 RP 处获取链外资源权限时,需要先将 DToken 的使用状态计数减一。计数值不能小于零,某 一计数值下的 DToken 只能使用一次。 + +RP 接收到链外资源获取请求后,为了防止作恶,RP 将验证访问者 RC 是否为 DToken 的当前 持有者,并检查 DToken 的使用状态是否可用等,然后再向其提供对应资源的权利。例如,可以使用 DToken 和 RC 签名形成 JWT 进行访问数据。 + diff --git a/prod-doc/en/ddxf/framework/spec/grep.md b/prod-doc/en/ddxf/framework/spec/grep.md new file mode 100644 index 00000000..ddcf0da8 --- /dev/null +++ b/prod-doc/en/ddxf/framework/spec/grep.md @@ -0,0 +1,91 @@ +# Generic Resources Exchange Protocol (GREP) +GREP 是一套建立于 Ontlogy 主链基础设施上的去中心化资源交换协议。通过使用 GREP,用户可以快速建立数据等资源的链上确权和流转平台。得益于 Ontology 信任生态体系基础设施的完备性,在去中心化身份标识 ONT ID、去中心多源认证系统 Trust Anchor、可信链外数据连接器 Oracle 以及去中心化电子合同及签章系统 ONT Sign 等多种信任协作组件的协同支撑下, GREP 可以为去中心化资源交换提供坚实的信任基础。 + +![overall](../../res/overall.png) + +## 1. Resource tokenization and assetization + +通过 GREP,任何人都可以快速而又便捷地建立多样化的资源链上确权和流转平台。 + +- 资源可以是数字资源,例如,数据、CPU 算力、GPU 算力、存储、链上 Oracle 和可信计算平台等; +- 一些实体资源,例如房产、古董字画等。 + +平台可以是个通用性平台,能实现多种资源的流转;它可以是一个特定资源的交换平台,精细化地实现某种特定资源的流转。 + +资源流转是资源以 ONG、OEP-4 代币等的形式,或是以资源或资源的形式。可能的资源流转形式包括但不限于: + +- 数据资源流转,例如:医疗大数据(的分析结果)换取 ONG; +- 算力资源流转,例如:可信计算算力换取 PAX; +- 实体资源流转,例如:名画所有权进行分割拍卖等。 + +资源的流转实际上就是将资源相应权利 Token 化,并进行 Token 流转。对于某个资源来说,其流转的可能是其所有权,或者是使用权以及其它相应的权利。具有链下实体的资源需要进行链下交割,而链下交割的方式将由资源的性质等方面决定。 + +在 GREP 中,公链 Ontology 提供了重要的去中心化信任基础。GREP 的用户需要为自己生成一个相应 的 ONT ID,并根据交易市场的需要进行注册和/或相关的用户资质认证。资源在交易过程中同样需要在链上进行注册,一般会抽取资源的唯一特征码生成数字指纹,并为资源生成相应的 ONT ID。 + +## 2. Token-based exchange mechanism + +资源交换或数据交互的过程可以看做是 Token 流转和交换的过程,通过智能合约保证执行。 + +### 2.1 角色 + +GREP 定义以下几类角色实现可信的 Token 交换: + +- 资源提供者 Resource Privoder (RP):拥有资源的实体,并将资源开放给市场,以资源通过 某种定价体系换取一定的报酬(例如, ONG 或其它某种资源)。此类实体有很多种类,比如数据所有者、算力拥有者、数据收集平台以及具有一定权限的数据托管方等等。 +- 资源需求者 Resource Consumer (RC):资源提供者的交易对手方,是需要某种资源的实体,从资源提供者中获取资源的(部分)所有权或者使用权,并为此支付一定的报酬(例如 ONG)。 +- 资源认证方 Resource Authenticator(RA):具有一定权威性的第三方,拥有自己的资源质量认证体系,根据该体系可以给资源或者资源提供者提供一定方式的认证增强资源或者资源提供者的可信度。认证根据不同的模式可以收取或者不收取认证费用。与没有经过认证的资源相比,经过认证的资源会拥有更多的潜在买家以及可能获得更高的报酬。 +- 链下仲裁者 Off-chain Judge (OJ):资源提供者和资源需求者在资源交易中都认可的链下纠纷仲裁者。链下产生的纠纷(如资源没有获取到)将由链下仲裁者进行裁定。 +- 交易市场 Marketplace (MP):是连系资源提供者和资源需求者的纽带,存储资源的元信息,为资源提供灵活的展示和快捷的搜索,收取交易费用。每个交易市场可以按照自身交易的特性提供伸缩化的灵活服务,比如提供元信息模板、解决链下纠纷的电子合同模板等供交易双方具现化 后使用。MP 一般拥有资源交易定价体系。另外,MP 一般也拥有资源交易信息披露体系,可以对公众或者监管部门进行交易信息披露。 + +### 2.2 Token 交易流程 + +隐私是 GREP 设计过程中考虑的首要因素。GREP 致力于保护交易双方个人信息、买卖信息的隐私。GREP 遵循的一个重点是:资源(特别是数据资源)本身以及资源元信息不上链。 + +GREP 提供了资源价值锚定的方法。定价有多种方式,如拍卖定价、集合竞价等。常见的有以下两种: + +1. 一口价:由 RP 在发布时给出价格,买卖双方按此价格完成交易。 +``` +{ + pricing: fixed // 定价方式为一口价 + price: 10.23 // 价格 + currency: ONG // 定价货币单位,如,ONG、OEP-4 等 +} +``` +2. 协商定价:RP 发布数据时不给出具体价格,而是在 RC 购买时双方协商价格。价格商定后将价格写入交易合约。 +``` +{ + pricing:negotiatory // 定价方式为协商 +} +``` + +GREP 规定了资源交换和数据交互的流程规范。用户根据自身需要选择想要进行交易的场所 MP。可以多次交付的资源可以在不同的 MP 上以不同的方式进行交易,如数据的使用权可以在多个 MP 进行交易。假定用户,包括 RP、RC 以及 OJ 等,都已经根据该 MP 的相应要求进行资质验证。整个资源的流转过程涉及到[资源准备](../../business/scenarios/resource-preparation.md)、[资源发布](../../business/scenarios/resource-publish.md)、[资源交易](../../business/scenarios/resource-transaction.md)、[分润](../../business/scenarios/resource-incentive-share.md)和[交易后评价](../../business/scenarios/tx-evaluation.md)。完整的流程规范在场景之中描述。在交易评价的基础上,GREP 实现的资源交换和数据交互的记录形成[声誉体系](../resource-audit/reputation-score.md),进一步促进本体可信生态体系。 + +1. 资源准备 + 1. 资源链上注册。RP 针对将要发布的资源在链上生成一个 ONT ID 以及相应的 DDO 信息,作为资源在链上的映射; + 2. 资源认证(可选)。RP 从 RA 处取得对准备发布资源的认证; + 3. 资源定价。根据 MP 提供的定价体系,确定具体的定价方式; + 4. 资源元信息生成。根据 MP 提供的资源元信息模板生成相应的资源元信息。 +2. 资源发布 + 3. 资源提交。RP 提交资源 ONT ID、元信息、待交易权利以及定价方式等上传给 MP; + 4. 资源信息处理。MP 从链上以及自身数据库等处获取该资源对应的信息; + 5. 资源展示。MP 做资源展示,使得 RC 能根据资源元信息等快速检索相应资源。 +3. 资源交易 + 1. 资源检索。RC 在 MP 处根据资源元信息等快速检索到所需资源,确定想要交易的资源; + 2. 资源交易电子合同签订(可选)。RP 和 RC 根据 MP 的电子合同模板具现化双方交易的电子合同,指定 OJ,并经由 ONT Sign 进行签名,并在交易智能合约中进行记录。根据 MP或者合同要求,RP 和 RC 可能需要分别向交易智能合约质押一定量的 ONG,用做纠纷处 理和交易后分润; + 3. 资源权利 Token 化和链上转移。RP 根据电子合同生成 DToken,将资源的某项权利,例如(部分)所有权或者使用权,授权给 RC; + 4. 资源链下交易及纠纷裁定。交易进入锁定期,RP 将使用 DToken 来换取对资源相应的处置权利;如果在交易锁定期中产生纠纷,双方提交链上证据或者链下证据。链下证据由 OJ 或 者 Ontology Oracle 将介入并进行裁定。 +4. 分润 + 1. 交易分润。在锁定期结束后,根据交易结果进行分润。OJ 或者 Ontology Oracle 对纠纷的判定可能会提前触发分润。 +5. 交易后评价 + 1. 交易评价。在一定的声誉体系内,RP 和 RC 进行双方互相评价,评价可以针对资源或者用户。用户或者资源所得的评价得分将影响在交易市场上的排名以及交易成交可能性。 + +## 3. Resource verification and audit + +链下实体的资源需要进行链下交割。链下行为,例如资源的所有权和合法性的确定,牵涉到现实世界中行为的认定和权利的确定。这种认定的方式需要由双方协定,并在必要的情况下采用去中心化电子合同以及签章系统 ONT Sign 来约定,并明确链下纠纷的处理方式,比如,违约后的链下责任处理方式。 + +链下仲裁者,在交易双方签定合同时由双方共同指定,是解决链下纠纷的一种较为可靠和高效的方式。链下仲裁者或者其代理人(例如,交易市场)将纠纷裁定结果上链。链下仲裁者不处理链上纠纷,链上纠纷将直接通过链上证明裁定。同时,某些链外证据可以通过 Ontology Oracle 送到链上,在链上进行直接裁定。 + +## 4. Extension + +GREP 是一个开放性协议,随着技术发展和本体生态的衍化,会有越来越多的扩展功能参与本体基础设施之中,GREP 也需要由相应的[协议集合](../extensions/README.md)去配合。 + +- GREP 支持对资源的定价,提供基于定价的资源交易。在实际的交易过程中,支持 Token 支付。由于目前区块链的 Token 资产位于多条链上,因此 GREP 支持[跨链资产支付](../extensions/cross-chain/README.md)。 diff --git a/prod-doc/en/ddxf/res/component.png b/prod-doc/en/ddxf/res/component.png new file mode 100644 index 00000000..9d8e3745 Binary files /dev/null and b/prod-doc/en/ddxf/res/component.png differ diff --git a/prod-doc/en/ddxf/res/data-processing.png b/prod-doc/en/ddxf/res/data-processing.png new file mode 100644 index 00000000..bd987088 Binary files /dev/null and b/prod-doc/en/ddxf/res/data-processing.png differ diff --git a/prod-doc/en/ddxf/res/dtoken-transfer.png b/prod-doc/en/ddxf/res/dtoken-transfer.png new file mode 100644 index 00000000..b740c96f Binary files /dev/null and b/prod-doc/en/ddxf/res/dtoken-transfer.png differ diff --git a/prod-doc/en/ddxf/res/framework.png b/prod-doc/en/ddxf/res/framework.png new file mode 100644 index 00000000..d3846e7a Binary files /dev/null and b/prod-doc/en/ddxf/res/framework.png differ diff --git a/prod-doc/en/ddxf/res/home_search.jpeg b/prod-doc/en/ddxf/res/home_search.jpeg new file mode 100644 index 00000000..a05db0bd Binary files /dev/null and b/prod-doc/en/ddxf/res/home_search.jpeg differ diff --git a/prod-doc/en/ddxf/res/ontid_qrcode.png b/prod-doc/en/ddxf/res/ontid_qrcode.png new file mode 100644 index 00000000..1e1c7aa6 Binary files /dev/null and b/prod-doc/en/ddxf/res/ontid_qrcode.png differ diff --git a/prod-doc/en/ddxf/res/overall.png b/prod-doc/en/ddxf/res/overall.png new file mode 100644 index 00000000..0087ae4f Binary files /dev/null and b/prod-doc/en/ddxf/res/overall.png differ diff --git a/prod-doc/en/ddxf/res/res-pub-stage.png b/prod-doc/en/ddxf/res/res-pub-stage.png new file mode 100644 index 00000000..c2fae950 Binary files /dev/null and b/prod-doc/en/ddxf/res/res-pub-stage.png differ diff --git a/prod-doc/en/ontid/business/scenarios/README.md b/prod-doc/en/ontid/business/scenarios/README.md new file mode 100644 index 00000000..c8ccf281 --- /dev/null +++ b/prod-doc/en/ontid/business/scenarios/README.md @@ -0,0 +1,6 @@ +# Scenarios for ONT ID framework + +- [web-app](./web-app/README.md) +- [trust anchor](./trust-anchor/README.md) +- [claim store](./claim-store/README.md) +- [ONT auth](./ont-auth/README.md) diff --git a/prod-doc/en/ontid/business/scenarios/claim-store/README.md b/prod-doc/en/ontid/business/scenarios/claim-store/README.md new file mode 100644 index 00000000..aa51f982 --- /dev/null +++ b/prod-doc/en/ontid/business/scenarios/claim-store/README.md @@ -0,0 +1,8 @@ +# Scenarios for claim store + +### Ontology trust mechanism (the claim system) + +1. accept [delegate claim items](./delegate.md) from [end user](../ont-auth/delegate.md) +2. accept query request from web-app, matchup query condition and notify end user + - [>>> detail](./matchup.md) + diff --git a/prod-doc/en/ontid/business/scenarios/claim-store/delegate.md b/prod-doc/en/ontid/business/scenarios/claim-store/delegate.md new file mode 100644 index 00000000..3dafae9b --- /dev/null +++ b/prod-doc/en/ontid/business/scenarios/claim-store/delegate.md @@ -0,0 +1,3 @@ +# Claim store - delegate + +// TODO \ No newline at end of file diff --git a/prod-doc/en/ontid/business/scenarios/claim-store/matchup.md b/prod-doc/en/ontid/business/scenarios/claim-store/matchup.md new file mode 100644 index 00000000..c2a46fb2 --- /dev/null +++ b/prod-doc/en/ontid/business/scenarios/claim-store/matchup.md @@ -0,0 +1,3 @@ +# Claim store - matchup + +// TODO \ No newline at end of file diff --git a/prod-doc/en/ontid/business/scenarios/ont-auth/README.md b/prod-doc/en/ontid/business/scenarios/ont-auth/README.md new file mode 100644 index 00000000..c0479eb8 --- /dev/null +++ b/prod-doc/en/ontid/business/scenarios/ont-auth/README.md @@ -0,0 +1,13 @@ +# Scenarios for ONT Auth + +### 1. Self-sovereign identity + +1. [register](./register.md) +2. [login](./login.md) +3. [on chain action](./action.md) + +### 2. Ontology trust mechanism (the claim system) + +1. [acquire claim](./acquire-claim.md) from [`trust anchor`](../trust-anchor/issue.md) +2. [delegate claim items](./delegate.md) to [`claim store`](../claim-store/delegate.md) +3. [provide claim](./provide-claim.md) to [`claim consumer`](../web-app/acquire-claim.md), get [notified](../claim-store/matchup.md) if necessary \ No newline at end of file diff --git a/prod-doc/en/ontid/business/scenarios/ont-auth/acquire-claim.md b/prod-doc/en/ontid/business/scenarios/ont-auth/acquire-claim.md new file mode 100644 index 00000000..e613e8d8 --- /dev/null +++ b/prod-doc/en/ontid/business/scenarios/ont-auth/acquire-claim.md @@ -0,0 +1,8 @@ +# ONT Auth - acquire claim + +1. 用户使用 ONT Auth 注册自我管理的`ONT ID` // TODO:概念的链接 +2. 根据对应资质项的 [`trust anchor`](../trust-anchor/issue.md),申请 claim +3. 完成 claim 需要提供的认证任务 +4. 获得 trust anchor 签发的 claim +5. 本地保存 + diff --git a/prod-doc/en/ontid/business/scenarios/ont-auth/action.md b/prod-doc/en/ontid/business/scenarios/ont-auth/action.md new file mode 100644 index 00000000..32ee3f09 --- /dev/null +++ b/prod-doc/en/ontid/business/scenarios/ont-auth/action.md @@ -0,0 +1,10 @@ +# ONT Auth - on-chain action + +1. 用户使用 ONT Auth 注册自我管理的`ONT ID` // TODO:概念的链接 +2. 注册并登录 web-app +3. 根据 web-app 引导,使用 ONT Auth 扫描二维码,签名并提交 + - **注意比较服务的域名是否和二维码签名的域名一致** + - **注意签名内容的 web-app 提示** +4. 完成动作调用 + +// TODO:链接 \ No newline at end of file diff --git a/prod-doc/en/ontid/business/scenarios/ont-auth/delegate.md b/prod-doc/en/ontid/business/scenarios/ont-auth/delegate.md new file mode 100644 index 00000000..fdb01661 --- /dev/null +++ b/prod-doc/en/ontid/business/scenarios/ont-auth/delegate.md @@ -0,0 +1,3 @@ +# ONT Auth - delegate claim items + +// TODO \ No newline at end of file diff --git a/prod-doc/en/ontid/business/scenarios/ont-auth/login.md b/prod-doc/en/ontid/business/scenarios/ont-auth/login.md new file mode 100644 index 00000000..5382bd04 --- /dev/null +++ b/prod-doc/en/ontid/business/scenarios/ont-auth/login.md @@ -0,0 +1,8 @@ +# ONT Auth - login + +1. 用户使用 ONT Auth 注册自我管理的`ONT ID` // TODO:概念的链接 +2. 注册 web-app +3. 根据 web-app 引导,使用 ONT Auth 扫描二维码,签名并提交 +4. 完成登录 + +// TODO:链接 \ No newline at end of file diff --git a/prod-doc/en/ontid/business/scenarios/ont-auth/provide-claim.md b/prod-doc/en/ontid/business/scenarios/ont-auth/provide-claim.md new file mode 100644 index 00000000..5c4ebea2 --- /dev/null +++ b/prod-doc/en/ontid/business/scenarios/ont-auth/provide-claim.md @@ -0,0 +1,12 @@ +# ONT Auth - provide claim + +1. 用户使用 ONT Auth 注册自我管理的`ONT ID` // TODO:概念的链接 +2. 获得来自 web-app 的资质认证需求(通过扫码二维码获得) +3. 调用二维码资质需求模板,查询个人名下已有的 claim 项 + 1. 已经满足的 + 1. 寻找对应的资质项,选取 + 2. 根据选择项,生成新的匿名声明 + 2. 未满足的 + 1. 根据对应资质项的 `trust anchor`,[申请 claim](./acquire-claim.md) + 2. 重复 3. +4. 调用二维码回调方法,将匿名声明发送给 web-app \ No newline at end of file diff --git a/prod-doc/en/ontid/business/scenarios/ont-auth/register.md b/prod-doc/en/ontid/business/scenarios/ont-auth/register.md new file mode 100644 index 00000000..9d1ec511 --- /dev/null +++ b/prod-doc/en/ontid/business/scenarios/ont-auth/register.md @@ -0,0 +1,14 @@ +# ONT Auth - register + +1. 用户使用 ONT Auth 注册自我管理的`ONT ID` // TODO:概念的链接 +2. 收到 web-app [资质审查](./acquire-claim.md) 的需求,[提供 claim](./provide-claim.md),如果[审查通过](../web-app/verify-claim.md) +3. Web-app 注册流程,填写账户内容 +4. 根据 web-app 引导,使用 ONT Auth 扫描二维码,签名并提交 + 1. 发送给 signing-server + 2. signing-server 收到 ONT Auth 的签名数据并验证签名,若验证通过则会将用户使用 ONT Auth 签名的 `ONT ID` 返回给 web-app + 3. Web-app 自行将用户账号和 `ONT ID` 进行绑定 +5. 完成注册 + +注册方案也可以采用 1-->2-->4-->3 的流程 + +// TODO:链接 \ No newline at end of file diff --git a/prod-doc/en/ontid/business/scenarios/trust-anchor/README.md b/prod-doc/en/ontid/business/scenarios/trust-anchor/README.md new file mode 100644 index 00000000..5de95ecb --- /dev/null +++ b/prod-doc/en/ontid/business/scenarios/trust-anchor/README.md @@ -0,0 +1,6 @@ +# Scenarios for trust anchor + +### Ontology trust mechanism (the claim system) + +1. [provide claim](./issue.md) to [end user](../ont-auth/acquire-claim.md) +2. [verify claim](./verify.md) provide from [end user](../ont-auth/provide-claim.md) \ No newline at end of file diff --git a/prod-doc/en/ontid/business/scenarios/trust-anchor/issue.md b/prod-doc/en/ontid/business/scenarios/trust-anchor/issue.md new file mode 100644 index 00000000..b9aba3dc --- /dev/null +++ b/prod-doc/en/ontid/business/scenarios/trust-anchor/issue.md @@ -0,0 +1,96 @@ +# Trust anchor - issue claim + +1. 定义自身 claim 模板 +2. 确定 claim 验签公钥,开放给验签方 +3. 响应用户获取 claim 的请求 +4. 根据用户行为,签发 claim + - 可做签发缓存 +5. 链上保存状态 + - 可以定期对签发的 claim 进行校验,如果无效,更新链上 claim 状态 + +// TODO:链接和方法 + +## 举例 + +1. 申请者需提交TA的资格审查的数据,通过可进行下一步; + + 资格审查内容需要TA自定义,根据不同的场景可定义不同的审查内容 + + 例如学信网的学历认证 + + ![a](../../../res/xjbg-sample.png) + + 学信网信任锚通过提供 Restful 服务(或者其他类型的服务),接收用户提交的学籍在线验证码,并向学信网数据库请求对应的学籍信息。 + + + +2. 签发相应的可信申明 + + * 在获得验证报告之后,你需要为你的用户签发相应的可信申明,需页面程序生成 协议二维码,申请者通过 ONT Auth 进行签名; + * 不需要第三方数据认证的情况下,Trust Anchor 可自己签发可信声明,通过 ONT Auth 进行签名; + * 数据认证方也可自己签发 claim + + 实施步骤: + + ​ * 需要先注册 [获取可信声明](../web-app/action.md) 的Action Name + + ```json + { + "domain": "on.ont", + "enableONS": true, + "defaultPayer": "AFmseVrdL9f9oyCzZefL9tG6UbvhUMqNMV", + "actions": [{ + "type": "getClaim", + "onchainRec": false + }, + { + "type": "...", + "onchainRec": false + }, + { + "type": "...", + "onchainRec": true, + "payer": "AFmseVrdL9f9oyCzZefL9tG6UbvhUMqNMV", + "qrcodeUrl": "", + "callback": "" + } + ] + } + ``` + + ​ * 通过 Singing-SDK [方法](../../../framework/signing-server/sdk/java/javadoc/[README.md](README.md))获取二维码协议参数 + + ```js + let qrStr = singingSdk.verify('getClaim', 'ad12-dis') + ``` + + + + 示例二维码 + + ![a](../../../res/qrcode_img.png) + + + +3. 签名通过后,TA通过Clain合约执行[上链操作](../../../framework/trust-anchor/smart-contract-api.md),申请者 通过TA API拿到生成的claim; + + [TA Claim Result API](../../../framework/trust-anchor/restful-api.md#claim_res) + + + +4. 申请者拿到claim之后可进行保存,至此,一份区块链上的学籍报告声明签发完成。 + + ```json + { + "action": "getClaim", + "version": "v1", + "error": 0, + "id": "10ba038e-48da-487b-96e8-8d3b99b6d18a", + "result": { + "claimTemplate": "claims:yus_chinese_id_authentication", + "claim":"eyJraWQiOiJkaWQ6b250OkFhUEVnNzdmR3FqM2RZUDcxYUFrWnU3M0ZLc01KUWVxaTEja2V5cy0xIiwidHlwIjoiSldULVgiLCJhbGciOiJPTlQtRVMyNTYifQ==.eyJjbG0tcmV2Ijp7InR5cCI6IkF0dGVzdENvbnRyYWN0IiwiYWRkciI6IjM2YmI1YzA1M2I2YjgzOWM4ZjZiOTIzZmU4NTJmOTEyMzliOWZjY2MifSwic3ViIjoiZGlkOm9udDpBSnVhN0M2dGVvRlVzMktoUmVjcWJmYlB3ckY5OWtISGdqIiwidmVyIjoidjEuMCIsImNsbSI6eyJJc3N1ZXJOYW1lIjoiU2Vuc2V0aW1lIiwi5aeT5ZCNIjoi5LiB5bCP57KJIiwi6Lqr5Lu96K+B5Y+3IjoiMzQxMjgxMTk4NzA4MzA2OTA4In0sImlzcyI6ImRpZDpvbnQ6QWFQRWc3N2ZHcWozZFlQNzFhQWtadTczRktzTUpRZXFpMSIsImV4cCI6MTU5NTQxNDMzMywiaWF0IjoxNTYzNzkxOTM1LCJAY29udGV4dCI6ImNsYWltOnl1c19jaGluZXNlX2lkX2F1dGhlbnRpY2F0aW9uIiwianRpIjoiZDNlYzBjZWFkNWEzN2JjNTQ2OTAzODUwY2QxMGY4OTM0NGUyZWVlZGUwM2UxMGJmNTNhZjA1ZGI3YmY4NjY1NCJ9.AZniJRQtytUzoaWAS5CjnqQdTHD4mW9lQnyepwuzwkqA5ZeOM6Jr2ZnHI42R981YHCyRse7qHpC6xhxeQc0XunM=\.eyJUeXBlIjoiTWVya2xlUHJvb2YiLCJNZXJrbGVSb290IjoiYjFmNjUwMGI3MGM0ZGY3YmNlNDQ2MDgxNzIxNDQ1M2E3ZmI4MTZiNjMwZGI1NTRmZDFhM2FhMjgwZDM1ZTA3MSIsIlR4bkhhc2giOiI0MTEyYzE3MDM1OTljMWM1ZThmNmM5NWY4YTNjMGI0ZGYwMDk2MWU0NmIxZDdiMjk3MmY5MjVhYjIyZGM5OTViIiwiQmxvY2tIZWlnaHQiOjMwMzMzNDAsIk5vZGVzIjpbeyJUYXJnZXRIYXNoIjoiZTE0MTcyYzhhNmUxOTM5NDM0NjU2NDhlMWM1ODZhOTE4NmEzNzg0ZWU3ZWUyOWRiOWVkYmY2YWZlMDRmNTM5MCIsIkRpcmVjdGlvbiI6IkxlZnQifSx7IlRhcmdldEhhc2giOiJmNDQwNTMxOTk5YzU0N2RiMDhmNTE2Njc3YzE1MjIxNTQ3NWE2OWRjY2I4MjE3NmU0YmNhMWI3MjYyNjFhMWJlIiwiRGlyZWN0aW9uIjoiTGVmdCJ9LHsiVGFyZ2V0SGFzaCI6IjMzZDQ0ZmIxOTMxZWMwYTVjMjZiMzg1ZmZhYmQwYjUzYTQ5YTE4MDIxZWQxYjljMTEyNmU5ODAzNGFjNzZkNjAiLCJEaXJlY3Rpb24iOiJMZWZ0In0seyJUYXJnZXRIYXNoIjoiYzMzZTg5ZTZhYjcwZjg0YjY2MDkyYThjY2FjMjk5ZWY5MjBlNWQ0NTg2MDc3ZGFlNDk1M2I2MjFhN2Q4NDhjOCIsIkRpcmVjdGlvbiI6IkxlZnQifSx7IlRhcmdldEhhc2giOiI3YTI1MTA1NzkyNmQ5MTc0NGRlYjcyMWYyMjExYjZlZTIwODMwMzRkM2EzOWM5NzFjZDY2ZDhhMzNhMjI1OGU1IiwiRGlyZWN0aW9uIjoiTGVmdCJ9LHsiVGFyZ2V0SGFzaCI6Ijk1ZDY0YThhYmM2NzU5YzU1ZWJjYThiNzU0MGM5OGU0NWUxYzI4NWE4MDk0Zjg4MDdlMjI1NDI4NTRhMDZhOGIiLCJEaXJlY3Rpb24iOiJMZWZ0In0seyJUYXJnZXRIYXNoIjoiNjgxMTY1MmY1ZTI2ZDNjZDk0NjY2ZWI3MDkyMTMxYzU0NThkYTUxYzZmOTBlM2YxMDg3MDU5ODc2M2NjZGVkMSIsIkRpcmVjdGlvbiI6IkxlZnQifSx7IlRhcmdldEhhc2giOiJkNzE1YzllODE3ZmU4NjYzMTkzYjU5N2MzYjZhMjhiNTlmYTY4NWQxZjNmMjVhNjhkZmJhMGYyYzA2Y2I5MjFiIiwiRGlyZWN0aW9uIjoiTGVmdCJ9LHsiVGFyZ2V0SGFzaCI6IjFmMGU4ZTA2YmU5MGQzYTM2MWNlZTk5OWMwYWM5OGVkYjBmNjA4YTViMzNhMTU3ODM4ZTMyNWU0ZmFlMjRkY2MiLCJEaXJlY3Rpb24iOiJMZWZ0In0seyJUYXJnZXRIYXNoIjoiNjA5NDQyYmEyYjk5NWEzYTA4ZTk5ZmE3MTQ3ZDY4NDQ2YjNmY2IzYjNiZTU4ZmQ2MzI3NWU1NDAxM2M1YmM1MSIsIkRpcmVjdGlvbiI6IkxlZnQifSx7IlRhcmdldEhhc2giOiJiMGNkY2I2ZmM1NzRjMzQyMDgyMDYwNzllYzBiNDc4NDM1NGE4YzUwZGI4NTJkNGQ3ZGMzMjY1NjkwOTE5N2Q4IiwiRGlyZWN0aW9uIjoiTGVmdCJ9LHsiVGFyZ2V0SGFzaCI6Ijc5YTgyYzkzZGZiZWNjODhmNzZhYjMzMDk1NWMyZjY0ODlhMmYyNmFkOThhY2FiOGI3NDY4MWViNzJhYjM4YzYiLCJEaXJlY3Rpb24iOiJMZWZ0In1dLCJDb250cmFjdEFkZHIiOiIzNmJiNWMwNTNiNmI4MzljOGY2YjkyM2ZlODUyZjkxMjM5YjlmY2NjIn0=" + } + } + ``` + + diff --git a/prod-doc/en/ontid/business/scenarios/trust-anchor/verify.md b/prod-doc/en/ontid/business/scenarios/trust-anchor/verify.md new file mode 100644 index 00000000..1be978e8 --- /dev/null +++ b/prod-doc/en/ontid/business/scenarios/trust-anchor/verify.md @@ -0,0 +1,7 @@ +# Trust anchor - verify claim + +1. 确定 claim 验签公钥,开放给验签方 +2. Web-app 根据用户提供的 claim,配合 Trust anchor 提供的公钥进行验签 +3. 验签通过,claim 有效,进一步向链上查询 claim 状态 +4. 链上状态通过,claim 校验通过 + diff --git a/prod-doc/en/ontid/business/scenarios/web-app/README.md b/prod-doc/en/ontid/business/scenarios/web-app/README.md new file mode 100644 index 00000000..409a7756 --- /dev/null +++ b/prod-doc/en/ontid/business/scenarios/web-app/README.md @@ -0,0 +1,18 @@ +# Scenarios for web-app + +### 1. Self-sovereign identity + +1. [register](./register.md) +2. [login](./login.md) +3. [on-chain action](./action.md) + +### 1.1 Workaround - centralized identity + +- [register, login and on-chain actions](./centralized-id.md) + +### 2. Ontology trust mechanism (the claim system) + +1. [query qualified user](./query-user.md) from [`claim store`](../claim-store/matchup.md). *optional* +2. [acquire claim](./acquire-claim.md) from [end user](../ont-auth/provide-claim.md) +3. [verify claim](./verify-claim.md) from [`trust anchor`](../trust-anchor/verify.md) + diff --git a/prod-doc/en/ontid/business/scenarios/web-app/acquire-claim.md b/prod-doc/en/ontid/business/scenarios/web-app/acquire-claim.md new file mode 100644 index 00000000..5d573e55 --- /dev/null +++ b/prod-doc/en/ontid/business/scenarios/web-app/acquire-claim.md @@ -0,0 +1,9 @@ +# Web-app - acquire claim + +1. 定义自身校验需求的 claim 模板 +2. 确定 claim 验签公钥 +3. 向用户提出获取 claim 的请求 +4. 根据用户提交的 claim,[校验 claim](./verify-claim.md) + 1. 本应用存档 + +// TODO:链接 diff --git a/prod-doc/en/ontid/business/scenarios/web-app/action.md b/prod-doc/en/ontid/business/scenarios/web-app/action.md new file mode 100644 index 00000000..b74d2a82 --- /dev/null +++ b/prod-doc/en/ontid/business/scenarios/web-app/action.md @@ -0,0 +1,20 @@ +# Web-app - on-chain action + +1. 定义预设上链动作的模板 // TODO: 模板链接 +2. 判断是否上链还是作为验签和驱动动作 // TODO:举例和链接 + 3. 如果 上链,实现上链动作的智能合约 // TODO:举例和链接 +4. 实现上链动作的后续链外动作 // TODO:举例和链接 +5. 配置 Gas 代付钱包,预存 ONG + 1. 可以自行部署同步节点 // TODO:链接 + 2. 监控钱包余额,不足时报警 +6. [自定义配置上链操作](../../../framework/signing-server/deployment.md) + +- 在 signing-server 配置文件`TODO:文件名`中注册自定义的on-chain action + + | field | description | + | ---------- | ------------------------------------------------------------ | + | type | action类型 | + | onchainRec | 设置为true表示需要上链,false表示不需要上链 | + | payer | 若不配置,则由用户支付手续费,为""则由defaultPayer支付手续费,同时需要在启动服务时,将payer对应的私钥在命令行输入,用于后续对交易的payer签名 | + | qrcodeUrl | 1.onchainRec为true时,可以获取交易参数的url,ONT Auth会根据参数构造交易并让用户签名。
2.onchainRec为false时,可以获取指定签名内容,ONT Auth会根据该内容让用 | + | callback | ONT Auth将签完名的交易发送给signing-server验签,验签通过会回调wep-app提供的callback。由wep-app决定并执行发送交易上链 | diff --git a/prod-doc/en/ontid/business/scenarios/web-app/centralized-id.md b/prod-doc/en/ontid/business/scenarios/web-app/centralized-id.md new file mode 100644 index 00000000..82aeda85 --- /dev/null +++ b/prod-doc/en/ontid/business/scenarios/web-app/centralized-id.md @@ -0,0 +1,21 @@ +# Web-app - centralized identity + +1. Generate `root key` for "delegated ONT IDs" + 1. // TODO:api in signing SDK +2. Enable actions with signing SDK + 1. register + 1. Generate `ONT ID` for end users after the `root key` + 2. Map `ONT ID` with user account + 3. Sign with `root key` and publish to Ontology mainnet for on-chain registration, if necessary + 2. login + 1. Common login + 2. Query `ONT ID` with user account + 3. Sign with `root key` and publish to Ontology mainnet for on-chain login, if necessary + 3. on-chain actions + 1. Query `ONT ID` with user account + 2. Sign with `root key` and publish to Ontology mainnet for on-chain action +3. Hand centralized `ONT ID` back to the identity owner + 1. change the `Owner` of `ONT ID` DDO from web-app to the end user + 1. [add user key](../../../framework/spec/ontid.md#addKey) + 2. [remove web-app key](../../../framework/spec/ontid.md#removeKey) + diff --git a/prod-doc/en/ontid/business/scenarios/web-app/login.md b/prod-doc/en/ontid/business/scenarios/web-app/login.md new file mode 100644 index 00000000..f6f7bd1a --- /dev/null +++ b/prod-doc/en/ontid/business/scenarios/web-app/login.md @@ -0,0 +1,12 @@ +# Web-app - login + +1. Web-app +2. Web-app 配置 Gas 代付钱包,预存 ONG + 1. 可以自行部署同步节点 // TODO:链接 + 2. 监控钱包余额,不足时报警 +3. Web-app 使用 signing sdk 或调用 restful api 的 `verify`接口,用返回的数据生成二维码 + 1. 预定义方法参数为:`login` + 2. // TODO:调用方法细节和链接,signing sdk?restful api ? verify ?如何生成二维码 +4. Web-app 使用 signing sdk 或调用 restful api 的 `result`接口,将上一步成功返回的 id 作为参数传入,轮询该 action 的执行结果 // TODO:方法细节和链接 + 1. 用户使用 ONT Auth 扫描二维码并签名,发送给 signing-server // TODO:链接 + 2. signing-server 收到 ONT Auth 的签名数据并验证签名,若验证通过则会返回给 web-app 成功结果,不通过则返回给 web-app 失败结果 \ No newline at end of file diff --git a/prod-doc/en/ontid/business/scenarios/web-app/query-user.md b/prod-doc/en/ontid/business/scenarios/web-app/query-user.md new file mode 100644 index 00000000..3cead02a --- /dev/null +++ b/prod-doc/en/ontid/business/scenarios/web-app/query-user.md @@ -0,0 +1,3 @@ +# Web-app - query qualified user + +// TODO \ No newline at end of file diff --git a/prod-doc/en/ontid/business/scenarios/web-app/register.md b/prod-doc/en/ontid/business/scenarios/web-app/register.md new file mode 100644 index 00000000..a29d9032 --- /dev/null +++ b/prod-doc/en/ontid/business/scenarios/web-app/register.md @@ -0,0 +1,24 @@ +# Web-app - register + +1. 用户使用 ONT Auth 注册自我管理的`ONT ID` // TODO:概念的链接 +2. Web-app 配置 Gas 代付钱包,预存 ONG + 1. 可以自行部署同步节点 // TODO:链接 + 2. 监控钱包余额,不足时报警 +3. [资质审查](./acquire-claim.md),如果[审查通过](./verify-claim.md) +4. Web-app 注册流程,账户内容准备 + 3. 注册信息填写 + 4. 老账户查重 + 5. 新账户锁定,注册信息缓存 + - session 绑定缓存,过期删除 + - 由于异步返回,建议对账户锁定缓存 +5. Web-app 使用 signing sdk 或调用 restful api `verify` 接口,用返回的数据生成二维码。提醒用户安装 ONT Auth 并注册 `ONT ID` + 1. 预定义方法参数为:`register` + 2. // TODO:调用方法细节和链接,signing sdk?restful api ? verify ?如何生成二维码 +6. Web-app 使用signing sdk或调用restful api `result`接口,将上一步成功返回的id作为参数传入,轮询该action的执行结果 // TODO:方法细节和链接 + 1. 用户使用 ONT Auth 扫描二维码并签名,发送给signing-server + 2. signing-server 收到 ONT Auth 的签名数据并验证签名,若验证通过则会将用户使用 ONT Auth 签名的 `ONT ID` 返回给 web-app +7. Web-app 自行将用户账号和 `ONT ID` 进行绑定,注册缓存信息转成用户账户信息 + +注册方案也可以采用 1-->2-->5-->6-->7-->3-->4 的流程 + +// TODO:链接 \ No newline at end of file diff --git a/prod-doc/en/ontid/business/scenarios/web-app/verify-claim.md b/prod-doc/en/ontid/business/scenarios/web-app/verify-claim.md new file mode 100644 index 00000000..955079b3 --- /dev/null +++ b/prod-doc/en/ontid/business/scenarios/web-app/verify-claim.md @@ -0,0 +1,51 @@ +# Web-app - verify claim + +1. 根据Singing-SDK 方法 得到二维码参数,通过 ontoAuth Signing server 扫码签名 + + * 需要先注册 [获取可信声明](../web-app/action.md) 的Action Name + + ```json + { + "domain": "on.ont", + "enableONS": true, + "defaultPayer": "AFmseVrdL9f9oyCzZefL9tG6UbvhUMqNMV", + "actions": [{ + "type": "claimQuery", + "onchainRec": false + }, + { + "type": "...", + "onchainRec": false + }, + { + "type": "...", + "onchainRec": true, + "payer": "AFmseVrdL9f9oyCzZefL9tG6UbvhUMqNMV", + "qrcodeUrl": "", + "callback": "" + } + ] + } + ``` + + * 通过 Singing-SDK [方法](../../../framework/signing-server/sdk/java/javadoc/[README.md](README.md))获取二维码协议参数 + + ![a](../../../res/queryClaim.png?lastModify=1568624986) + + 2. 签名之后,ontoAuth 调用接口把本地存储的claim发送到web-app[接口及参数说明](../../../framework/trust-anchor/restful-api.md#credential_id) + + * web-app会向TA验证公钥, 并且会向[链上查询](../../../framework/trust-anchor/smart-contract-api.md)claim状态,返回结果 + + ``` + { + "action": "claimCallback", + "id": "10ba038e-48da-487b-96e8-8d3b99b6d18a", + "error": 0, + "desc": "SUCCESS", // 最终结果 + "version": "v1" + } + ``` + + 至此验证流程完毕 + + \ No newline at end of file diff --git a/prod-doc/en/ontid/business/solutions/README.md b/prod-doc/en/ontid/business/solutions/README.md new file mode 100644 index 00000000..899ab9ed --- /dev/null +++ b/prod-doc/en/ontid/business/solutions/README.md @@ -0,0 +1,6 @@ +# ONT ID Solution + +- [web-app](./web-app.md) +- [offer claim](./claim.md) +- personal - [relationship management](./self-sovereign.md) + diff --git a/prod-doc/en/ontid/business/solutions/claim.md b/prod-doc/en/ontid/business/solutions/claim.md new file mode 100644 index 00000000..747982d7 --- /dev/null +++ b/prod-doc/en/ontid/business/solutions/claim.md @@ -0,0 +1,18 @@ +# Solution to offer claim + +Tech document is way behind. For detail and technology support, please contact Ontology dev team. + +## 1. Claim offering + +1. Register on-chain domain to identify the credential service provider + 1. ONT ID ready + 2. Default payer ready + 3. Domain in ONS ready +2. Setup a trust anchor + 1. Use [`Ontology general trust anchor`](../../framework/trust-anchor/saas-tenant.md) or deploy a [new one](../../framework/trust-anchor/deployment.md) + 2. Config claim template +3. Provide [claim service](../scenarios/trust-anchor/issue.md) + - Log claim action on-chain if necessary +4. Enable [claim verification](../scenarios/trust-anchor/verify.md) (for client use only) +5. Done + diff --git a/prod-doc/en/ontid/business/solutions/self-sovereign.md b/prod-doc/en/ontid/business/solutions/self-sovereign.md new file mode 100644 index 00000000..a94262d6 --- /dev/null +++ b/prod-doc/en/ontid/business/solutions/self-sovereign.md @@ -0,0 +1,16 @@ +# Solution to manage relationship and personal assets + +## 1. Manage circle of relationship + + + +### 1.1 Qualification endorsement + + + +### 1.2 Self-sovereign linked data + + + +## 2. Data privacy and data protection + diff --git a/prod-doc/en/ontid/business/solutions/web-app.md b/prod-doc/en/ontid/business/solutions/web-app.md new file mode 100644 index 00000000..aeecb14f --- /dev/null +++ b/prod-doc/en/ontid/business/solutions/web-app.md @@ -0,0 +1,62 @@ +# Solution for web-app + +Tech document is way behind. For detail and technology support, please contact Ontology dev team. + +## 1. Enable self-sovereign account to buy in more stakeholders + +1. Register on-chain domain to identify the web-app + 1. ONT ID ready + 2. Default payer ready + 3. Domain in ONS ready +2. Setup a signing server + 1. Use [`Ontology general signing server`](../../framework/signing-server/saas-tenant.md) or deploy a [new one](../../framework/signing-server/deployment.md) + 2. Config web-app actions with signing server one by one +3. Use signing SDK in web-app + 1. Map account in web-app with ONT ID + 2. [optional] enable ONS on sub-domain for account +4. Register new actions to be record on-chain +5. Enable registration and login with signing SDK + 1. [register](../scenarios/web-app/register.md) + 2. [login](../scenarios/web-app/login.md) + 3. [on-chain actions](../scenarios/web-app/action.md) +6. Done + +### 1.1 Workaround for centralized identities + +1. Register on-chain domain to identify the web-app +2. Have `root key` ready for "delegated ONT IDs" +3. Enable [actions](../scenarios/web-app/centralized-id.md) with signing SDK + 1. register + 1. Generate `ONT ID` for end users after the `root key` + 2. Map `ONT ID` with user account + 3. Sign with `root key` and publish to Ontology mainnet for on-chain registration, if necessary + 2. login + 1. Common login + 2. Query `ONT ID` with user account + 3. Sign with `root key` and publish to Ontology mainnet for on-chain login, if necessary + 3. on-chain actions + 1. Query `ONT ID` with user account + 2. Sign with `root key` and publish to Ontology mainnet for on-chain action +4. Done + +## 2. Enable qualification filtering on customer registration + +1. Use claim system (trust anchor) SDK in server side +2. Create claim template to use +3. Add claim query on the first step of user registration, enable [claim verification](../scenarios/web-app/verify-claim.md) + 1. claim verificaton passed, + 2. move on to the next step +4. Done + +## 3. Share high value customers with lower cost over network + +1. Define the cost model of customer acquisition and publish + - [>>> Learn more.](../../../ddxf/business/solutions/mp/id.md) +2. Generate claim template and forward to claim store +3. Wait for new customers to give a try +4. Done + +## 4. A new business to offer credential of qualified users + +[>>> Learn more.](./claim.md) + diff --git a/prod-doc/en/ontid/framework/README.md b/prod-doc/en/ontid/framework/README.md new file mode 100644 index 00000000..f59ebae2 --- /dev/null +++ b/prod-doc/en/ontid/framework/README.md @@ -0,0 +1,64 @@ +# Ontology Distributed Identity Framework (ONT ID) + +Ontology DID (AKA: ONT ID) is a decentralized identification protocol which based on W3C DID specifications. It supports collaborative services such as distributed and diversified ownership confirmation, identification, and authentication of various entities including individuals, legal entities, objects, and contents. ONT ID establishes a cryptographically-based digital identity for each entity, allowing self-sovereign of data authorization and ownership confirmation, which makes the identity and data truly assets that the user can control. ONT ID has the characteristics of decentralization, self-management, privacy protection, security and ease of use. + +Ontology establishes a decentralized trust model and distributed trust delivery system through ONT ID and verifiable claim, and uses the C-L signature algorithm and zero-knowledge proof protocol to assure privacy protection of verifiable claim. Through ONT ID, Ontology will also incorporate various authentication service agencies, and establish multi-source authentication of the entity’s identity to achieve complete identity portrait. + +In addition to relying on specific central entities to build trust relationships, entities can also build equally strong trust relationships by themselves. Trust transfer is achieved through mutual authentication between entities. Entities will have higher credibility if they receive more authentications from other entities – especially if those other entities have high credibility. + +## Components of ONT ID framework + +![img-overall](../res/img-overall.png) + +ONT ID framework is targeting to provide +1. self-sovereign identity for web applications, to buy in end user(s) of web-apps as stakeholder(s), and, +2. a platform to match the targeting user(s) for web-app(s) via a collection of third party claims, which results as the trust mechanism of Ontology. + +### 1. Self-sovereign identity + +In Ontology `ONT ID framework`, "entity" refers to individuals, legal entities (organizations, enterprises, institutions, etc.), objects (mobile phones, automobiles, IoT devices, etc.), and contents (articles, copyrights, etc.) in the real world, and "identity" refers to the entity's identity within the network. + +1. **ONT ID** `ONT ID(s)` are identifier(s) of ONT ID framework. All entities in Ontology system shall have an `ONT ID`. Ontology uses Ontology Identifier (`ONT ID`) to identify and manage the entities' identities. On Ontology blockchain, one entity can correspond to multiple individual identities, and there is no relation between multiple identities. [>> Learn more](./spec/ontid.md) +2. **ONT Auth** and **Signing server** `ONT ID` services are deployed to Ontology mainnet. Users own `ONT IDs`. To make full use of `ONT ID`, a mobile application `ONT Auth` is used to enable self-sovereign identity. A `signing server` is a server side service to bridge `ONT ID` from end user to account system inside web-app. + - [>> Learn more about `signing server`](./signing-server/README.md) + - [>> Learn more about `ONT Auth`](./ont-auth/guide/README.md) +3. **Ontology Name System** [>> Learn more](./ons/README.md) + +#### 1.1 Workaround for centralized business + +In order to satisfy traditional web-app user experiences, some web-apps may start with centralized id business. ONT ID framework provides workaround solution to meet the requirement above. + +The centralized identifiers are able to be handed back to the ONT ID owners, via change the `Owner` of `ONT ID` DDO from web-app to the end user. + +[>> Learn more](./signing-server/centralized-id.md) + +### 2. Ontology trust mechanism (the claim system) + +Entities issue claims and "sell" them to their customers, where there are verification scenarios. The close loop of issuing request, creation and consuming of claims setup the Ontology trust mechanim. + +- **Claim owner** Owner of an ONT ID. The entity acquires a verifiable claim issued by `claim issuer`. The entity is able to manipulate claims, with [`anonymous credential`](./claim-store/anonymous-credential.md) technology, and provide the credential to `claim consumer`. This role is the "`trust seller`". +- **Claim Issuer** Owner of an ONT ID. The entity is to issue claim to provide endorsement of target entity for certain qualifications or credentials. "`Claim Issuer`" includes a `trust anchor` (the partner that provides authentication services in Ontology ecosystem), could be government agencies, universities, banks, third-party authentication service agencies, biometric technology companies, etc. `Claim issuer` provides multi-dimensional authentication for entities, its authentication behavior and result will be record to Ontology blockchain with data privacy protection. `Claim issuer` provides a standardized and credible authentication method for `claim consumers` to verify the claims. This role is the "`trust endorser`". +- **Claim Consumer** "`Claim Consumer`" accepts the user's verifiable claim and have the claim verified. The verification covers many useful scenarios, e.g., the employers who need to verify the interviewer's identity information/degree/industry skills. This role is the "`trust buyer`". + +The following diagram demostrates the claim sytem workflow, for detail, please view the [claim specification](./spec/claim.md). + +![img-claim-system](../res/img-claim-system.png) + +To active the mechanism, the following components are setup in `ONT ID framework`. + +1. **Trust anchor** Trust anchor refers to the partner that provides authentication services on the Ontology ecosystem. It may be government agencies, universities, banks, third-party authentication service agencies (such as CA agencies), biometric technology companies, etc. [>> Learn more](./turst-anchor/README.md) + - **Verifiable Claim Protocol** A statement to confirm a claim made by one entity about another (including themselves). The claim is accompanied by a digital signature that can be used by other entities for authentication. The verifiable claim protocol describes in detail the procedures and specifications about issue, store, and verification of verifiable claim. [>> Learn more](./spec/claim.md) +2. **Claim store** A `claim store` is an entity to provide service for "`claim owners`" to manage their claims online, notify `claim owner(s)` when there is `claim consumer` for certain credentials. A `claim store` is usually an entity with NDA to ensure data privacy. [>> Learn more](./claim-store/README.md) +3. **ONT Auth** `ONT Auth` is a mobile application to manage personal claims. [>> Learn more](./ont-auth/guide/README.md) + +## Scenarios of ONT ID framework + +ONT ID framework covers the scenarios of most features in the account system of centralized web-app. The framework also covers the scenarios to bring qualified entity(ies) to their potential qualification consumer(s), esp., KYC (know your customer) in financial services. + +- [>> Learn more](../business/scenarios/README.md) + +## Business solutions using ONT ID + +With ONT ID framework, solutions are ready for different domains. + +- [>> Learn more](../business/solutions/README.md) \ No newline at end of file diff --git a/prod-doc/en/ontid/framework/claim-store/README.md b/prod-doc/en/ontid/framework/claim-store/README.md new file mode 100644 index 00000000..e5a852c5 --- /dev/null +++ b/prod-doc/en/ontid/framework/claim-store/README.md @@ -0,0 +1,13 @@ +# Claim store + +`Claim store` is a place to help ONT ID users managing their claims. + +- Any ONT ID user can delegate the match-up of any of their qualified items in claims with web-app requirement to `claim store`. +- Any web-app with potential customer qualification requirement can generate their customer requirement to `claim store` and `claim store` will match-up the requirement with qualified items of ONT ID users and notify them. ONT ID users decide whether to provide their `anonymous credential` to the app and become customer(s). + + + +1. [Deploy a claim store](./deployment.md) + 1. Use Ontology claim store (SaaS) to issue your own claims - TBD +2. [Claim store RESTful api](./restful-api.md) + diff --git a/prod-doc/en/ontid/framework/claim-store/anonymous-credential.md b/prod-doc/en/ontid/framework/claim-store/anonymous-credential.md new file mode 100644 index 00000000..d246ff34 --- /dev/null +++ b/prod-doc/en/ontid/framework/claim-store/anonymous-credential.md @@ -0,0 +1,360 @@ +# Anonymous Credential + +In an anonymous credential scheme there are **three** participants: issuer, user(prover), verifier. + +Issuer creates a certificate to user which contains a list of user's attributes and issuer's signature(use BBS+ signature). This protocol is formally called **credential issuance protocol**. + +The user who is in possession of that credential can selectively disclose some parts to some verifier. This protocol is formally called +**credential presentation protocol**. + +## 1. Background + +### BBS signature +- Setup: generate a pairing-friendly curve G, and target group Gt, pairing func e: G x G -> Gt. +- KeyGen: sk = (x), pk = (g^x). +- Sign(m): sig = g^{1/(x+mprime)}, where mprime = H(m). +- Verify(m, sig): check if e(pk * g^{H(m)}, g^sig) == e(g, g). --> + +### 1.1 BBS+ signature +- *Setup*: group G1, G2, Gt. pairing function e: G1 x G2 -> Gt. G1 and G2 are both of order p. + + common params: + - g1 is a generator of G1. + + - g2 is a generator of G2. + + - HRand, h1, ..., hL are elements from G1. + +- *KeyGen*: sample x from uniform distribution on Zp, output sk = x, pk = g2^x. + +- *Sign(sk, m1, ..., mL)*: choose two random numbers `E` and `s` from Zp. Compute + `B = g1 * HRand^s * (h1^m1 * ... * hL^mL)`, then compute `A = B^{1/(E+x)}`. + The signature is (A, B, E, s). + +- *Verify(pk, m1, ..., mL, sig)*: + decode `sig` as (A, B, E, s), and check if `e(A, g2^E * pk) == e(B, g2)` and if `B == g1 * HRand^s * (h1^m1 * ... * hL^mL)`. + +### 1.2 Non-Interactive Proof of Knowledge (PoK) protocol +In this subsection, we give an example of non-interactive proof of knowledge protocol which proves that the public key is generated as specified in the BBS+ signature scheme. That is, `π = PoK{x: w = g2^x && _g2 = _g1^x}` which can be translated as the prover proves knowledge of `x` such that `g2^x = w` and `_g2 = _g1^x`. And `w, g2, _g1, _g2` are assumed to be public. + +The protocol we give is a standard sigma protocol. It consists three steps, namely, **commit, challenge, response**. Sigma protocol is a interactive protocol and it can be modified to be a non-interactive zero knowledge proof by using the well-known **Fiat-Shamir heuristic**. And the proof π = {C, S}. + +1. commitment(prover): + ```go + r = rand(Zp) + + t1 = g2^r + + t2 = _g1^r + ``` +2. proof(prover): + ```go + P = t1 || t2 || g2 || _g1 || w || _g2 //join them together in binary format + + C = hash_to_int(P) //C is challenge + + S = (r + C * x) mod p //response to verifier + ``` +3. verify(verifier): + ```go + _t1 = g2^S * w^(-c) + + _t2 = _g1^S * _g2^(-c) + + _P = _t1 || _t2 || g2 || _g1 || w || _g2 + + _C = hash_to_int(_P) + + // use C to compare with _C, which was calculated just now + if C == _C { + return true + } else { + return false + } + ``` + +## 2. Setup of Issuer's key pair + +Given an array of attribute's names `AttributeNames`, the issuer's key pair is generated as follows: + +1. Sample a random element `x` from Zp, and compute `w = g2^x`. +2. Sample a random element `_g1` from G1. And compute `_g2 = _g1^x`. +3. Generate non-interactive proof of knowledge `π = PoK{x: w = g2^x && _g2 = _g1^x} = (C, S)` according + to [section 1.2](./anon_cred.md#12-non-interactive-proof-of-knowledge-pok-protocol) which we reproduce here. + + - `r` : sample a random element r from Zp + - `t1` : compute t1 = g2^r. + - `t2` : compute t2 = _g1^r. + - `C` : C = H(t1 || t2 || g2 || _g1 || w || _g2) + - `S` : S = (r + C * x) mod p + +4. Sample an array of elements from G1 for `AttributeNames`. For each attribute in `AttributeNames`, compute `HAttrs[i] = random(G1)` +5. Sample two random elements from G1: `HRand` and `HSk`. +6. Set issuer's public key `ipk = (w, _g1, _g2, π, HAttrs, AttributeNames, HRand, HSk)`, and private key `isk = x`. +7. Return **ipk** and **isk**. + +The following snippets in golang gives the reference data structures for issuer's key pair. + +```go +type IssuerSecretKey struct { + x BigNum +} +``` +```go +type IssuerPublicKey struct { + AttributeNames []string + HAttrs []G1Point // one G1-element for one attribute + HRand G1Point // a random G1 point + HSk G1Point // a random G1 point to encode user's secret key + + w G2Point // element from G2 + _g1 G1Point // point of G1 + _g2 G1Point // point of G1 + + //PoK{x: w = g2^x && _g2 = _g1^x} + C BigNum // challenge + S BigNum // response +} +``` + + +## 3. Issuance protocol +The issuance protocol is an interactive protocol which consists of the following steps: +1) The issuer sends a random **nonce** to the user. + +2) The user creates a **Credential Request** using the public key of the issuer, user secret, and the nonce as input. + + The request consists of a commitment to the user secret (can be seen as a public key) and a zero-knowledge proof + of knowledge of the user secret key. + + The user sends the credential request to the issuer. + +3) The issuer verifies the credential request by verifying the zero-knowledge proof + + If the request is valid, the issuer issues a credential to the user by signing the commitment to the secret key + together with the attribute values and sends the credential back to the user + +4) The user verifies the issuer's signature and stores the credential that consists of + the signature value, a randomness used to create the signature, the user secret, and the attribute values. + +In short, this can be summarized in the following diagram: + + Issuer ------------------------ Prover + + -- nonce(BigNum) --> + + <-- CredRequest --- + + --- Credential ---> + +- CredRequest contains a commitment `Nym` to user's secret key which is of the form `HSk^(sk) ` and a zk-PoK of Nym. + +- Credential contains the BBS+ signature on attributes and Nym. + +### 3.1 Generate Credential Request + + +User will generate the credential request with attribute values and `nonce` as input. This is done as follows: +1. Sample a random element `sk` from Zp as user's master secret. +2. Compute `Nym = HSk^(sk)` as a commitment to user's master secret. +3. Generate zero knowledge proof `π = PoK{sk: Nym = HSk^sk} = (C, S)` as illustrated in [section 1.2]() which we reproduce here. + - Sample a random element `r` from Zp. + - Compute `t1 = HSk^r`. + - Compute challenge `C = H(t1 || HSk || Nym || nonce)`. + - Compute response `S = (r + C * sk) mod p`. + +The following snippets in golang gives the reference data structures for credential request. +```go +type CredRequest struct { + Nym G1Point //commitment to user's master secret + IssuerNonce BigNum //nonce + Attrs []BigNum //user's attributes + + //PoK that Nym is constructed as in the issuance protocol + // i.e. PoK{(sk): HSk^sk = Nym } + C BigNum //challenge in Sigma-protocol + S BigNum //response in Sigma-protocol +} +``` + +### 3.2 Issue credential +After receiving credential request from user, issuer verify `π = (C, S)` and generates credential for user. +The credential is generated using issuer's private key `isk` as follows: +1. Sample two random elements `e, s` from Zp. +2. Compute `B = g1 · HRand^s · Nym · MulAll(HAttrs[i]^(Attrs[i]))` +3. Compute `A = B^(1/(e+x))`. +4. Return credential `(A, B, e, s, Attrs)` + +The following snippets in golang gives the reference data structures for credential. +```go +type Credential struct { + A G1Point + B G1Point + e BigNum + s BigNum + Attrs []BigNum +} +``` + + + + +## 4. Presentation protocol +In the presentation protocol, the prover tries to convince the verifier that he knows some secret input such that some predicate is true. A typical example of predicate is that +the prover is *in possession of an anonymous credential*, and he can **selectively disclose** some attributes while hiding the other attributes. + +Before we give the proving algorithm, we list the information that the prover has. + +- User's secret key `sk` and its commitment `Nym`. +- Attribute values `attrs = (a1,...,aL)` +- BBS+ signature `(A, B, e, s)` +- extra input + - `(D, I)`: attribute predicate, describe what attributes will be disclosed. If D[j]==1, I[j]=attrs[j]=aj, else I[j]=null + + +### 4.1. Proving algorithm +The selectively disclosure proof can be generated as follows: + +1. Randomize A: sample a random element `r1` from Zp*, and compute `A' = A^r1`. +2. Compute `_A = A'^(−e) · B^r1, r3 = 1/r1`. +3. Sample an element `r2` from Zp. +4. Compute `B' = B^r1 · HRand^(-r2)`, `s' = s - r2·r3`. +5. Generate zero knowledge proof `π = PoK{ (sk, {ai}_hidden, e, r2, r3, s') }` such that + - `_A/B' = A'^(-e) · HRand^r2 ` and + - `g1 · MulAll(hi^ai_reveal) = (B')^r3 · HRand^(-s') · HSk^(-sk) · MulAll(hi^(-ai_hidden))`, and hi is a shorthand for HAttrs[i]. + + This proof can be generated as follows. + - `r_ai` : for i belongs to _D(attributes not disclosed), means __D[i]==0__ + - `r_e` : random from Zp + - `r_r2` : random from Zp + - `r_r3` : random from Zp + - `r_s'` : random from Zp + - `r_sk` : random from Zp + - `E` : E = HSk^r_sk + - `t1` : t1 = A'^r_e · HRand^r_r2 + - `t2` : t2 = (B')^r_r3 · HRand^r_s' · E^(-1) · MulAll(hi^r_ai) + - `c'` : c' = H(A', _A, B', nym, t1, t2, g1, HRand, h1, ... , hL, w) + - `nonce` : nonce, with τ bit length, randomly generated again + - `c` : c = H(nonce, c', (D, I)) + - `s_sk` : s_sk = r_sk + c · sk + - `s_ai` : s_ai = r_ai - c · ai, for i belongs to _D(attributes not disclosed) + - `s_e` : s_e = r_e - c · e + - `s_r2` : s_r2 = r_r2 + c · r2 + - `s_r3` : s_r3 = r_r3 + c · r3 + - `s_s'` : s_s' = r_s' - c · s' + - `π` : {c, s_sk, {s_ai}, s_e, s_r2, s_r3, s_s', nonce}, i belong to _D + +Output is `(A', _A, d, nym, π)`, where π = {c, s_sk, {s_ai}, s_e, s_r2, s_r3, s_s', nonce} + +The following snippets in golang gives the reference data structures for zero-knowledge proof. + +```go +type Proof struct { + APrime G1Point // randomized credential signature values + ABar G1Point // randomized credential signature values + BPrime G1Point // randomized credential signature values + + /* challenge in sigma-protocol */ + ProofC BigNum + /* response in sigma-protocol */ + ProofSSk BigNum + ProofSE BigNum + ProofSR2 BigNum + ProofSR3 BigNum + ProofSSPrime BigNum + ProofSAttrs []BigNum + + Nonce BigNum // nonce used to avoid replay attack + Nym G1Point +} +``` + +### 4.2 Verification + +Verifier has the following information as input: + + - `(A', _A, B', nym, π)` : from signer + - `{c, s_sk, {s_ai}, s_e, s_r2, s_r3, s_s', nonce}` : parse π + +The verification algorithm proceeds as follows: + 1. Check if `A' != 1` in G1; if false, return `false`. + 2. check if `e(A', w) == e(_A, g2)`; if false, return `false`. _This is zk-PoK for __A__._ + 3. Parse __π__ : `{c, s_sk, {s_ai}, s_e, s_r2, s_r3, s_s', nonce} <- π`; if failed, return `false`. + 4. `~t1` : ~t1 = A'^s_e · HRand^s_r2 · (_A/B')^(-c) . _This is zk-PoK for __e__, __r2__._ + 5. `~t2` : (B')^s_r3 · HRand^s_s' · HSk^(-s_sk) · MulAll(hi^(-s_ai)) · (g1·MulAll(hi^ai))^(-c) + - the i above, first MulAll( ) belongs to _D, where D[i]==0(false) + - the i above, second MulAll( ) belongs to D, where D[i]==1(true) + - This is ZKPoK for __r3__, __s'__, __gsk__, __ai__ of _D. + 6. `c'` : c' = H(nonce, H(A', _A, B', nym, ~t1, ~t2, g1, HRand, h1, ... , hL, w), (D, I)) + 7. Check if `c == c'` : if false: return `false`. Otherwise return `true`. + + +## 5. References +[CL02]. J. Camenisch and A. Lysyanskaya. A Signature Scheme with Efficient Protocols. SCN 2002. + +[CL04]. J. Camenisch and A. Lysyanskaya. Signature Schemes and Anonymous Credentials +from Bilinear Maps. Crypto 2004. + +[BBS04]. D. Boneh, X. Boyen, and H. Shacham. Short Group Signatures. Crypto 2004. + +[BBS+]. Man Ho Au, Willy Susilo, and Yi Mu. Constant-Size Dynamic k-TAA. SCN 2006. + +[CDL16]. Camenisch, Jan, Manu Drijvers and Anja Lehmann. Attestation Using the Strong Diffie Hellman Assumption Revisited, ECCV 2016. \ No newline at end of file diff --git a/prod-doc/en/ontid/framework/claim-store/deployment.md b/prod-doc/en/ontid/framework/claim-store/deployment.md new file mode 100644 index 00000000..31f577d1 --- /dev/null +++ b/prod-doc/en/ontid/framework/claim-store/deployment.md @@ -0,0 +1,64 @@ +# Claim store - deployment + +## 1. Prerequisite + +// Docker + +## 2. Configuration + +Sample configuration file in json, + +```json +{ + "ontId": "did:ont:AFmseVrdL9f9oyCzZefL9tG6UbvhUMqNMV", + "domain": "sampleclaimstore.ont", + "enableONS": true, + "defaultPayer": "AFmseVrdL9f9oyCzZefL9tG6UbvhUMqNMV", + "storeContract": "8e88e1bdfa720b0b79fd3784de248f4d8890decd", + "plugins": [{ + "name": "chargeFeeSplit", + "id": "e1471264-b2d1-45fa-9eb5-1a8ad6ce2b6c", + "settings": {} + }] +} +``` + +| Field Name | Type | Description | +| ------------ | ------------ | ------------------------------------------------------------ | +| ontId | String | ONT ID of the host | +| domain | String | Registered domain in ONS | +| enableONS | boolean | Enable sub-domain for end user | +| defaultPayer | String | The payer of transaction gas fee from customer(s), if leave `blank`, the customer will pay the gas fee on their own | +| storeContract | String | On-chain contract hash of claim store | +| plugins | Object array | Support action(s) for this domain. For detail, see the table below. | + +Plugins object. + +| Field Name | Type | Description | +| ---------- | ------- | ------------------------------------------------------------ | +| name | String | Plugin name of the service in claim store | +| id | String | Unique ID of the plugin | +| settings | Object | Setting detail for each plugin | + +### 2.1 Enable ONS + + + +### 2.2 Set default payer + + + +### 2.3 Config plugin(s) + + + +### 2.4 Add customized plugin + + + +## 4. Start a new `claim store` + + + +## Appendix I. Plugin list + diff --git a/prod-doc/en/ontid/framework/claim-store/restful-api.md b/prod-doc/en/ontid/framework/claim-store/restful-api.md new file mode 100644 index 00000000..38f7e3eb --- /dev/null +++ b/prod-doc/en/ontid/framework/claim-store/restful-api.md @@ -0,0 +1,10 @@ +# Claim store - RESTful api + +## 1. Claim cache + +## 2. Claim delegation + +## 3. Claim request from web-apps + +## 4. Auth request notification to ONT ID users + diff --git a/prod-doc/en/ontid/framework/ons/README.md b/prod-doc/en/ontid/framework/ons/README.md new file mode 100644 index 00000000..0932fbbf --- /dev/null +++ b/prod-doc/en/ontid/framework/ons/README.md @@ -0,0 +1,28 @@ +# Ontology Name System + +Ontology Name System (ONS) is an Enhancement Proposal of Ontology `ONT ID` framework. +- [>>> URI schema and sample code](https://github.com/ontio/OEPs/pull/19) + +ONS provides a naming service to map resource with `ONT ID`, with data privacy protection. + +## ONS interface + +同标准DNS,对于每一级域名长度的限制是63个字符,域名总长度则不能超过253个字符。 + +[subdomain].<二级域名>.<一级域名>.<顶级域名> + +每个did最多可以绑定【100】个域名 + +| No | name | params | return | auth | comment | event | +| ---- | ----------------- | ------------------------------------------------------------ | ------------------ | ----------------------------------------------------------- | ----------------------- | --------------------------------------------- | +| 1 | registerDomain | fulldomain:全域名;register:注册者ontid,;idx: wallet idx; validTo:有效期 | None | 上级domain的owner,顶级域名为合约admin,最低为二级域名owner | 注册域名 | "registerDomain", "domain", "owner","validTo" | +| 2 | updateValidPeriod | fulldomain:全域名;idx: wallet idx;validTo:有效期 | None | 上级domain的owner,顶级域名为合约admin,最低为二级域名owner | 更新有效时间 | "updateValidPeriod","domain","newvalid" | +| 3 | deleteDomain | fulldomain:全域名;idx: wallet idx | None | domain owner,最低为二级域名owner | 删除域名 | "deleteDomain","domain" | +| 4 | bindValue | fulldomain:全域名;idx: wallet idx;ctype:类型;value: 绑定的值 | None | domain owner,最低为二级域名owner | 绑定值 | "bindValue","domain","ctype","value" | +| 5 | ownerOf | fulldomain:全域名 | owner ontid | none | 查询owner | | +| 6 | validTo | fulldomain:全域名 | expire time | none | 查询有效期限 | | +| 7 | valueOf | fulldomain:全域名 | bytearray | none | 查询绑定值 | | +| 8 | isDomainValid | fulldomain:全域名 | bytearray | none | 查询域名是否有效 | | +| 9 | transfer | fulldomain:全域名;idx:wallet idx;todid:转让到did | None | 该域名owner | 转让域名 | "transfer","domain","from","to" | +| 10 | getDomains | fulldomain | domains 已逗号分割 | None | 查询某个did下的所有域名 | | + diff --git a/prod-doc/en/ontid/framework/ont-auth/guide/README.md b/prod-doc/en/ontid/framework/ont-auth/guide/README.md new file mode 100644 index 00000000..7ba2468e --- /dev/null +++ b/prod-doc/en/ontid/framework/ont-auth/guide/README.md @@ -0,0 +1 @@ +# User Guide of ONT Auth \ No newline at end of file diff --git a/prod-doc/en/ontid/framework/ont-auth/transaction-spec.md b/prod-doc/en/ontid/framework/ont-auth/transaction-spec.md new file mode 100644 index 00000000..4f16c500 --- /dev/null +++ b/prod-doc/en/ontid/framework/ont-auth/transaction-spec.md @@ -0,0 +1,121 @@ +# ONT Auth transaction specification + +This specification works from mobile-app `ONT Auth` to `signing server`. + +Ref., https://dev-docs.ont.io/#/docs-en/dApp-Integration/02-DAppDocking-QRcode + +## 1. Transaction params + +A sample of transaction parameter. + +```json +{ + "params": { + "invokeConfig": { + "gasLimit": 40000, + "contractHash": "fb12993d6f13a2ec911f3bbfe534be90e4deeca4", + "functions": [{ + "args": [{ + "name": "fulldomain", + "value": "String:ning.on.ont" + }, { + "name": "registerdid", + "value": "String:%ontid" + }, { + "name": "idx", + "value": 1 + }, { + "name": "validto", + "value": -1 + }], + "operation": "registerDomain" + }], + "payer": "AcdBfqe7SG8xn4wfGrtUbbBDxw2x1e8UKm", + "gasPrice": 500 + }, + "ontidSign": true, + "callback": "http://192.168.3.121:7878/api/v1/contract/invoke" + } +} +``` + +### 1.1 invokeConfig + +| Field Name | Type | Description | +| ------------ | ------------ | ------------------------------------------------------------ | +| gasLimit | uint | Gas fee to charge at most | +| gasPrice | uint | Gas fee to charge per step | +| contractHash | String | The hash of contract | +| functions | Object array | Functions to call in this transaction | +| payer | Address | Payer of the transaction, to pay gas fee for the sender, leave blank for the sender to pay gas fee | + +#### 1.1.1 function param + +| Field Name | Type | Description | +| ---------- | ------------ | ------------------------------------------------------------ | +| args | Object array | Arguments used for the function call, each item stands for one arg
The arg object is in the form of "`name : value`" pair, value type can be compound object, the type shall be defined in the value field, in the form of "`type:data`". | +| operation | String | The function name to call | + +`Arg` field of function param supports complex data type. For detail support, please contact Ontology dev community. + +- Basic type: + + - boolean, e.g., `true`, `false` + - integer, e.g., -1, 100 + - other types use `String` type, in form of "type:data". Type includes: + - String, e.g., "String:hello" + - ByteArray, e.g., "ByteArray:array string" + - Long, e.g., "Long:100000000000" + - Address, e.g., "Address:AUr5QUfeBADq6BMY6Tp5yuMsUNGpsD7nLZ" + +- Array: e.g., + - ```json + [ + true, + 100, + "Long:100000000000", + "Address:AUr5QUfeBADq6BMY6Tp5yuMsUNGpsD7nLZ", + "ByteArray:aabb", + "String:hello", + [ + true, + 100 + ], + { + "key": 6 + } + ] + ``` + +- Map: e.g., + + - ```json + { + "key": "String:hello", + "key1": "ByteArray:aabb", + "key2": "Long:100000000000", + "key3": true, + "key4": 100, + "key5": [100], + "key6": { + "key": 6 + } + } + ``` + +Esp., value start with "%" stands for a placeholder of the transaction, the vale will be replaced by `ONT Auth`. + +| Placeholder Name | Description | +| ---------------- | ------------------------------------------------------------ | +| ontid | The ONT ID to be signed by ONT Auth | +| msg | The random message generated along with QA code to identify the scan request | +| expire | Expire date time of the response, specially used in Ontology claim system | +| ~~claim~~ | [**TBD**] ~~Matched claim object~~ | + +### 1.2 ontidSign + +In boolean type, indicate whether the action call shall be signed with user ONT ID. + +### 1.3 callback + +ONT Auth will access the "`callback`" function after the transaction is constructed, the `callback` function will then send the transaction to Ontology blockchain. \ No newline at end of file diff --git a/prod-doc/en/ontid/framework/signing-server/README.md b/prod-doc/en/ontid/framework/signing-server/README.md new file mode 100644 index 00000000..7cee6a41 --- /dev/null +++ b/prod-doc/en/ontid/framework/signing-server/README.md @@ -0,0 +1,8 @@ +# ONT ID signing server + +1. [Deploy a signing server](./deployment.md) + - Use [`Ontology general signing sever`](./saas-tenant.md) (SaaS) to register your own dApp +2. [Signing server RESTful api](./restful-api.md) +3. [Signing SDK - java](./sdk/java/javadoc/README.md) +4. Workaround for special web-app requirement - [centralized identity systems](./centralized-id.md) + diff --git a/prod-doc/en/ontid/framework/signing-server/centralized-id.md b/prod-doc/en/ontid/framework/signing-server/centralized-id.md new file mode 100644 index 00000000..9e3ef798 --- /dev/null +++ b/prod-doc/en/ontid/framework/signing-server/centralized-id.md @@ -0,0 +1,16 @@ +# ONT ID signing server - centralized identity + +Centralized identity system is a workaround for self-sovereign identity solution. + +Conceptually, `ONT ID` is delegated from end users to web-app server host. + +Terms and agreement shall be prepared in advance, for end users to accept the "delegate" action. + +Technically, delegated `ONT ID` contails three key features, + +1. to generate `ONT ID` with web-app `root key` to manage `owner key` of `ONT ID` DDO on behalf of end user +2. to sign on on-chain actions, e.g., registration, login, on behalf of end user and publish to Ontology mainnet +3. to enable end users to take over the ownership of `ONT ID` if they want + +![img-central-sign](../../res/img-central-sign.png) + diff --git a/prod-doc/en/ontid/framework/signing-server/deployment.md b/prod-doc/en/ontid/framework/signing-server/deployment.md new file mode 100644 index 00000000..ab425b40 --- /dev/null +++ b/prod-doc/en/ontid/framework/signing-server/deployment.md @@ -0,0 +1,69 @@ +# ONT ID signing server - deployment + +## 1. Prerequisite + +// Docker + +## 2. Configuration + +Sample configuration file in json, + +```json +{ + "domain": "on.ont", + "enableONS": true, + "defaultPayer": "AFmseVrdL9f9oyCzZefL9tG6UbvhUMqNMV", + "actions": [{ + "type": "register", + "onchainRec": false + }, + { + "type": "login", + "onchainRec": false + }, + { + "type": "cus_action1", + "onchainRec": true, + "payer": "AFmseVrdL9f9oyCzZefL9tG6UbvhUMqNMV", + "qrcodeUrl": "", + "callback": "" + } + ] +} +``` + +| Field Name | Type | Description | +| ---------- | ---- | ----------- | +| domain | String | Registered domain in ONS | +| enableONS | boolean | Enable sub-domain for end user | +| defaultPayer | String | The payer of transaction gas fee from customer(s), if leave `blank`, the customer will pay the gas fee on their own | +| actions | Object array | Support action(s) for this domain. For detail, see the table below. | + +Actions object. + +| Field Name | Type | Description | +| ---------- | ------- | ------------------------------------------------------------ | +| type | String | Action name of the service | +| onchainRec | boolean | Whether to record the action behavior on chain | +| payer | Address | The gas fee payer of the action calling.
If this field is `omit`, default payer will pay the gas fee;
if this field is set to `blank`, the customer(s) will pay the gas fee on their own. | + +### 2.1 Enable ONS + +若启用ONS,则用户需要注册与自己ontid绑定的子域名,并在登录时使用子域名登录 + +### 2.2 Set default payer + +设置default payer,需要在启动服务时,将payer对应的私钥在命令行输入,用于后续对交易的payer签名 + +### 2.3 Config action(s) + +配置指定签名action的payer及是否上链 + +### 2.4 Add customized action + +自定义需要signing server签名的action + +## 3. Create an Instance + +## 4. Start a New Server + diff --git a/prod-doc/en/ontid/framework/signing-server/restful-api.md b/prod-doc/en/ontid/framework/signing-server/restful-api.md new file mode 100644 index 00000000..61d8dbf9 --- /dev/null +++ b/prod-doc/en/ontid/framework/signing-server/restful-api.md @@ -0,0 +1,678 @@ +# ONT ID signing server - RESTful api + +1. [General Interface](#GIfc) +2. [Self-sovereign Identity](#SSID) +3. [[Optional] Ontology Name System](#ONS) + +--- + +ONT ID services are deployed to Ontology mainnet. Users can access ONT ID services via `RESTful api`. ONT ID SDK is a software development toolkit to encapsulate the capability to access on-chain apis. + +The `RESTful api` and `SDK` is able to cover the following scenarios: + +1. Self-sovereign user account management with data privacy protection + 1. To generate self-sovereign identifier (ONT ID) on the user's own behavior. + 2. To register user account with user's ONT ID. + 3. To login applications with user's ONT ID. + 4. To use resources under full control from user. + 5. To combine resource with Ontology on-chain name service. + 6. To benefit from Ontology blockchain infrastructure by its immutable and traceable data processing and management services. +2. User certification to serve your customer better + 1. To generate claims for your customer, as an Ontology Trust Anchor. + 2. To acquire claims from Ontology Trust Anchor. +3. To integrate the reputation of ONT ID users into application and provide reputation feedback. + +![img-signsvr-overall](../../res/img-signsvr-overall.png) + +The following document is focus on the RESTful apis of ONT ID framework. + +## General Interface + +All on-chain contract can be accessed by general interface. To enable self-sovereign identity system with application, an on-chain signing server shall be setup to sync ONT Auth application with application servers. + +The following diagram shows the general sequency to execute an ONT ID request with PC web-app and self-sovereign ONT Auth mobile app. + +![img-signsvr-general](../../res/img-signsvr-general.png) + +### 1. Construct transaction +``` +url:/api/v1/contract +method:POST +``` + +Request: +```json +{ + "argsList": [{ + "name": "", + "value": "" + }, { + "name": "", + "value": "" + }], + "contractHash": "", + "method": "" +} +``` +| Field Name | Type | Description | +|---|---|---| +|contractHash|String|Contract hash| +|method|String|Contract method| +|argsList|List|Contract parameters| + +Response: +```json +{ + "action": "makeTransaction", + "error": 0, + "desc": "SUCCESS", + "result": { + "callback": "http://192.168.3.121:7878/api/v1/contract/invoke", + "id": "e1471264-b2d1-45fa-9eb5-1a8ad6ce2b6c", + "tx": "00d1ed6aa95cf401000000000000409c000000000000f5f7b705b03ae46e48f89c2b99e79fa4391536fe6e0360ea00016f51c10331313151c114000000000000000000000000000000000000000214010b5816b180ffb41e3889b6f42aeaf31fd63209143fc9fa9491df7e93b94db2df99e6af2d67ad34b756c10973656e64546f6b656e67bae44577a468b5bfd00ebbaba7d91204204828470000" + }, + "version": "v1" +} +``` +| Field Name | Type | Description | +| --- | --- | --- | +| action | String | Action name | +| error | int | Error code | +| desc | String | If successful, SUCCESS is shown; if failed, error description is shown | +| result | Map | If successful, result is returned; if failed, "" is returned | +| callback | URL | callback server for mobile app to access Ontology blockchain after personal sign | +| id | String | Identifier to be recorded in the system, to sync with mobile app for ONT Auth | +| tx | String | The raw tx (transaction) in hex string | +| version | String | Version | + +### 2. Sign upon tx (transaction) and send tx to Ontology chain +``` +url:/api/v1/contract/invoke +method:POST +``` + +Request: +```json +{ + "action": "string", + "id": "string", + "params": { + "type": "ontid or address", + "user": "did:ont:AUEKhXNsoAT27HJwwqFGbpRy8QLHUMBMPz or AUEKhXNsoAT27HJwwqFGbpRy8QLHUMBMPz", + "tx": "01abd7ea9d79c857cd838cabbbaad3efb44a6fc4f5a5ef52ea8461d6c055b8a7cf324d1a58962988709705cefe40df", + "publickey": "0205c8fff4b1d21f4b2ec3b48cf88004e38402933d7e914b2a0eda0de15e73ba61", + "signature": "01abd7ea9d79c857cd838cabbbaad3efb44a6fc4f5a5ef52ea8461d6c055b8a7cf324d1a58962988709705cefe40df5b26e88af3ca387ec5036ec7f5e6640a1754" + }, + "version": "string" +} +``` + +| Field Name | Type | Description | +|---|---|---| +| action | String | Action name | +| id | String | Recorded ID | +| version | String | Version | +| params | String | Parameters | + +Response: +```json +{} +``` +| Field Name | Type | Description | +| --- | --- | --- | +| result | obj | If successful, empty object "{}" is returned; if failed, error message is returned, due to the contract error codes | + +The `params` field in request is an open field to invoke actions, signing server will judge whether to forward the transaction to Ontology chain(s). Two samples, + +#### 2.1 Transaction with signature + +``` +"params": { + "type": "ontid or address", + "user": "did:ont:AUEKhXNsoAT27HJwwqFGbpRy8QLHUMBMPz or AUEKhXNsoAT27HJwwqFGbpRy8QLHUMBMPz", + "tx": "01abd7ea9d79c857cd838cabbbaad3efb44a6fc4f5a5ef52ea8461d6c055b8a7cf324d1a58962988709705cefe40df", + "publickey": "0205c8fff4b1d21f4b2ec3b48cf88004e38402933d7e914b2a0eda0de15e73ba61", + "signature": "01abd7ea9d79c857cd838cabbbaad3efb44a6fc4f5a5ef52ea8461d6c055b8a7cf324d1a58962988709705cefe40df5b26e88af3ca387ec5036ec7f5e6640a1754" +} +``` + +| Field Name | Type | Description | +|---|---|---| +|tx|String|Transaction in hex string| +|publickey|String|Signed public key| +|signature|String|Signed data| + +#### 2.2 Transaction with signed tx string + +``` +"params": { + "signedTx": "00d1ed6aa95cf401000000000000409c000000000000f5f7b705b03ae46e48f89c2b99e79fa4391536fe6e0360ea00016f51c10331313151c114000000000000000000000000000000000000000214010b5816b180ffb41e3889b6f42aeaf31fd63209143fc9fa9491df7e93b94db2df99e6af2d67ad34b756c10973656e64546f6b656e67bae44577a468b5bfd00ebbaba7d91204204828470000" +} +``` +| Field Name | Type | Description | +|---|---|---| +| signedTx | String | Signed tx hash | + +### 3. Check tx status +``` +url:/api/v1/contract/result/{id} +method:Get +``` + +Request: +| Field Name | Type | Description | +|---|---|---| +|id |String| Recorded id provided by response of construction of transaction | + +Response: +```json +{ + "action": "result", + "error": 0, + "desc": "SUCCESS", + "result": { + "result": "1" + }, + "version": "v1" +} +``` +| Field Name | Type | Description | +| --- | --- | --- | +| action | String | Action name | +| error | int | Error code | +| desc | String | If successful, SUCCESS is shown; if failed, error description is shown | +| result | String | If successful, "1" is returned; if failed, "0" is returned; if the transaction has not been executed in Ontology blockchain, return `NULL` (retry later) | +| version | String | Version | + +## Self-sovereign Identity + +Any web-app with account system can easily be bound to `system account` with `ONT ID` from end user. The key of user action with ONT ID is to confirm the `ONT ID` belongs to the end user. + +![img-signsvr-id-action](../../res/img-signsvr-id-action.png) + +### Support actions + +The `ONT ID` verificaton can be used in `register`, `login` and any other on-chain transactions. + +| Action type | Action name of ontid/verify | +| --- | --- | +| register | register | +| login | login | + +New action type can be registered. For detail, please view the [deployment](./deployment.md) document of `signing server`. + +### 1. Generate a qrcode to verify the belonging of ONT ID + +``` +url:/api/v1/ontid/verify/{action}?id={id} +method:Get +``` + +| Field Name | Type | Description | +| --- | --- | --- | +| action | String | Action name, `register`, `login` or other names predefined for the domain | +| id | String | The id of qrcodeUrl, to get the transaction params(onChainRec=true) or specified message to sign(onChainRec=false). Required false | + +Response: + +```json +{ + "action": "register", + "error": 0, + "desc": "SUCCESS", + "result": { + "callback": "http://192.168.3.121:7878/api/v1/ontid/invoke", + "id": "a0308abd-d57e-41fe-9554-5fe6435db2fe", + "qrcodeUrl": "http://192.168.3.121:7878/api/v1/ontid/qrcode/a0308abd-d57e-41fe-9554-5fe6435db2fe", + "domain": "on.ont", + "msg": "7ca22b" + }, + "version": "v1" +} +``` +| Field Name | Type | Description | +| --- | --- | --- | +| action | String | Action name, `register`, `login` or other names predefined for the domain | +| error | int | Error code | +| desc | String | If successful, SUCCESS is shown; if failed, error description is shown | +| result | String | If successful, recorded info is returned; if failed, "" is returned | +| callback | String | Callback URL address | +| id | String | Reserved id for the close loop of the transaction, random per request, expired in 24 hours by default | +| qrcodeUrl | String | Get tx parameter address | +| domain | String | The domain of the web-app, registered in ONS. If the signing server is setup by the web-app on its own, this field can leave blank | +| msg | String | Random message to identify the request | +| version | String | Version | + +The json data in `result` field is used to generate a qrcode for Ontology authentication mobile app (a.k.a., ONT Auth) to scan. A `version` field shall also be involved in the json code for the qrcode. E.g., in the sample above, the code piece to generate qrcode is, + +```json +{ + "callback": "http://192.168.3.121:7878/api/v1/ontid/invoke", + "id": "a0308abd-d57e-41fe-9554-5fe6435db2fe", + "qrcodeUrl": "http://192.168.3.121:7878/api/v1/ontid/qrcode/a0308abd-d57e-41fe-9554-5fe6435db2fe", + "domain": "on.ont", + "msg": "7ca22b", + "version": "v1" +} +``` + +Mobile app (ONT Auth) will let end user sign on the transaction and send back to `signing server` for verification. + +Web-app can check for the action (e.g., registration or login) result, and create account and bind account with ONT ID or login the account with the bound ONT ID. + +### 2. Check request status + +Ref., [check tx status](#checkTxStatus), the `action` field of response is "**registerResult**", "**loginResult**". + +### 3. ONT Auth behavior + +1. ONT Auth will access the `qrcodeUrl` from the response of action (e.g., registration or login). The api will then returns the pattern of `ONT ID` / `web app` actions. +2. ONT Auth will then construct transaction with the action pattern and have the transaction signed with the `ONT ID`'s PK. +3. The signed transaction will be sent to `signing server`, and the server will check whether the PK is the owner of the `ONT ID`. +4. When matched, the registration status will be `SUCCESS`. + +#### 3.1 Get tx parameters + +Get transaction pattern of user action(s). The action with ONT ID is to bind `ONT ID` with web-app account or confirm the `ONT ID` is bound with web-app account, a transaction with `ONT ID PK` signed is to verify ONT ID belonging from ONT Auth. + +``` +url:/api/v1/ontid/qrcode/{id} +method:Get +``` + +Request +| Field Name | Type | Description | +|---|---|---| +|id |String|Id returned from "1. generate qrcode"| + +Response: + +```json +{ + "action": "signTransaction", + "id": "80edaf95-4706-41f1-a25b-57447e4e3094", + "params": { + "invokeConfig": { + "contractHash": "fb12993d6f13a2ec911f3bbfe534be90e4deeca4", + "functions": [{ + "args": [{ + "name": "domain", + "value": "String:on.ont" + }, { + "name": "ontid", + "value": "String:%ontid" + }, { + "name": "idx", + "value": 1 + }, { + "name": "validto", + "value": -1 + }, { + "name": "msg", + "value": "String:%msg" + }], + "operation": "verifySign" + }] + }, + "ontidSign": true, + "callback": "http://192.168.3.121:7878/api/v1/contract/invoke" + }, + "version": "v1" +} +``` +| Field Name | Type | Description | +| --- | --- | --- | +| action | String | Action name | +| id | String | Id returned from "1. generate qrcode" | +| params | Object | Transaction parameters, for detail, please view protocol in `ont-auth` and [`signing server`](../ont-auth/transaction-spec.md) | +| version | String | Version | + +#### 3.2 Construct transaction and send + +1. ONT Auth will [contruct a registration transaction](#constructTransaction) with the given pattern. +2. Sign the transaction and send. Ref., [transaction with signed tx string](#signedTx). + +## [Optional] Ontology Name System + +Ontology Name System is an on-chain system to bind resource from users with a combination of domain name and protocol, with resource/data privacy protection. + +The resource can be `ONT ID`, `wallet address`, `digital asset`. + +ONT ID RESTful api encapsulates ONS combination with web-app account. The account will be treated as a sub-domain of the web-app. + +![img-signsvr-ons-overall](../../res/img-signsvr-ons-overall.png) + +### User registration + +![img-signsvr-ons-register](../../res/img-signsvr-ons-register.png) + +#### 1. Register name in ONS (Ontology Name System) + +``` +url:/api/v1/ons/reg/{ons} +method:Get +``` + +Request: +| Field Name | Type | Description | +|---|---|---| +|ons |String|Domain name that needs to be registered| + +Response: + +```json +{ + "action": "registerDomain", + "error": 0, + "desc": "SUCCESS", + "result": { + "callback": "http://192.168.3.121:7878/api/v1/ons/invoke", + "id": "a0308abd-d57e-41fe-9554-5fe6435db2fe", + "qrcodeUrl": "http://192.168.3.121:7878/api/v1/ons/qrcode/a0308abd-d57e-41fe-9554-5fe6435db2fe", + "domain": "on.ont", + "msg": "7ca22b" + }, + "version": "v1" +} +``` +| Field Name | Type | Description | +| --- | --- | --- | +| action | String | Action name | +| error | int | Error code | +| desc | String | If successful, SUCCESS is shown; if failed, error description is shown | +| result | String | If successful, recorded info is returned; if failed, "" is returned | +| callback | String | Callback URL address | +| id | String | Reserved id for the close loop of the transaction, random per request, expired in 24 hours by default | +| qrcodeUrl | String | Get tx parameter address | +| domain | String | The domain of the web-app, registered in ONS. If the signing server is setup by the web-app on its own, this field can leave blank | +| msg | String | Random message to identify the request | +| version | String | Version | + +The json data in `result` field is used to generate a qrcode for Ontology authentication mobile app (a.k.a., ONT Auth) to scan. A `version` field shall also be involved in the json code for the qrcode. E.g., in the sample above, the code piece to generate qrcode is, + +```json +{ + "callback": "http://192.168.3.121:7878/api/v1/ons/invoke", + "id": "a0308abd-d57e-41fe-9554-5fe6435db2fe", + "qrcodeUrl": "http://192.168.3.121:7878/api/v1/ons/qrcode/a0308abd-d57e-41fe-9554-5fe6435db2fe", + "domain": "on.ont", + "msg": "7ca22b", + "version": "v1" +} +``` + +Mobile app (ONT Auth) will let end user sign on the transaction and send back to `signing server` for verification. + +#### 2. Check request status + +Ref., [check tx status](#checkTxStatus), the `action` field of response is "**registerResult**". + +#### 3. ONT Auth behavior + +1. ONT Auth will access the `qrcodeUrl` from the response of registration. The api will then returns the pattern of `ONT ID` / `web app` registration. +2. ONT Auth will then construct transaction with the registration pattern and have the transaction signed with the `ONT ID`'s PK. +3. The signed transaction will be sent to `signing server`, and the server will check whether the PK is the owner of the `ONT ID`. +4. When matched, the registration status will be `SUCCESS`, and the ONT ID is combined with a sub-domain under the web-app, in ONS. + +##### 3.1 Get tx parameters + +Get registration transaction pattern. The registration is to bind `ONT ID` with web-app account and register the resource with ONS on-chain. A transaction with `ONT ID PK` signed is to verify ONT ID belonging from ONT Auth, and the combination of ONT ID with ONS sub-domain will be saved on-chain. + +``` +url:/api/v1/ons/qrcode/{id} +method:Get +``` + +Request +| Field Name | Type | Description | +|---|---|---| +|id |String|Recorded ID| + +Response: + +```json +{ + "action": "signTransaction", + "id": "80edaf95-4706-41f1-a25b-57447e4e3094", + "params": { + "invokeConfig": { + "gasLimit": 40000, + "contractHash": "fb12993d6f13a2ec911f3bbfe534be90e4deeca4", + "functions": [{ + "args": [{ + "name": "fulldomain", + "value": "String:ning.on.ont" + }, { + "name": "registerdid", + "value": "String:%ontid" + }, { + "name": "idx", + "value": 1 + }, { + "name": "validto", + "value": -1 + }], + "operation": "registerDomain" + }], + "payer": "AcdBfqe7SG8xn4wfGrtUbbBDxw2x1e8UKm", + "gasPrice": 500 + }, + "ontidSign": true, + "callback": "http://192.168.3.121:7878/api/v1/contract/invoke" + }, + "version": "v1" +} +``` + +| Field Name | Type | Description | +| --- | --- | --- | +| action | String | Action name | +| id | String | Recorded ID | +| params | Object | Transaction parameters, for detail, please view protocol in `ont-auth` and [`signing server`](../ont-auth/transaction-spec.md) | +| version | String | Version | + +*ONT ID and domain is recorded on-chain, so a payer shall be set to pay gas fee. + +##### 3.2 Send registration transaction + +Sign the transaction and send. Ref., [transaction with signed tx string](#signedTx). + +### User login + +![img-signsvr-ons-login](../../res/img-signsvr-ons-login.png) + +#### 1. New login transaction + +``` +url:/api/v1/ons/login +method:Get +``` + +Response: + +```json +{ + "action": "getMessage", + "error": 0, + "desc": "SUCCESS", + "result": { + "callback": "http://192.168.3.121:7878/api/v1/login/callback", + "id": "e1471264-b2d1-45fa-9eb5-1a8ad6ce2b6c", + "domain": "on.ont", + "msg": "7ca22b" + }, + "version": "v1" +} +``` +| Field Name | Type | Description | +| --- | --- | --- | +| action | String | Action name | +| error | int | Error code | +| desc | String | If successful, "SUCCESS" is shown; if failed, error description is shown | +| result | String | If successfully, recorded info is returned; if failed, "" is returned | +| callback | String | Callback URL address | +| id | String | Reserved id for the close loop of the transaction, random per request, expired in 24 hours by default | +| domain | String | The domain of the web-app, registered in ONS. If the signing server is setup by the web-app on its own, this field can leave blank | +| msg | String | Random message to identify the request | +| version | String | Version | + +The json data in `result` field is used to generate a qrcode for Ontology authentication mobile app (a.k.a., ONT Auth) to scan. A `version` field shall also be involved in the json code for the qrcode. E.g., in the sample above, the code piece to generate qrcode is, + +```json +{ + "callback": "http://192.168.3.121:7878/api/v1/login/callback", + "id": "e1471264-b2d1-45fa-9eb5-1a8ad6ce2b6c", + "domain": "on.ont", + "msg": "7ca22b" + "version": "v1" +} +``` + +Mobile app (ONT Auth) will let end user sign on the transaction and send back to `signing server` for verification. + +#### 2. Check request status + +``` +url:/api/v1/ons/login/result/{id} +method:Get +``` + +Request: +| Field Name | Type | Description | +|---|---|---| +|id |String|Id returned from "1. new login" | + +Response + +```json +{ + "action": "loginResult", + "error": 0, + "desc": "SUCCESS", + "result": { + "result": "1", + "ons": "test.ont.io", + "ontid": "did:ont:AGWYQHd4bzyhrbpeYCMsxXYQcJo95VtR5q" + }, + "version": "v1" +} +``` +| Field Name | Type | Description | +| --- | --- | --- | +| action | String | Action name | +| error | int | Error code | +| desc | String | If successful, "SUCCESS" is shown; if failed, error description is shown | +| result | String | If successful, "1" is returned; if failed, then "0" is returned; if the transaction has not been executed in Ontology blockchain, return `NULL` (retry later) | +| ons | String | User domain name | +| ontid | String | User ONT ID | +| version | String | Version | + +#### 3. ONT Auth behavior + +ONT Auth will pick the sub-domain/account of the web-app from end-user and verify the ownership of `ONT ID PK`. + +##### 3.1 Get ONS list according to ONT ID and parent domain name + +Multiple accounts combined with one ONT ID. + +To turn on data privacy protection, a MPC with domain owner (ONT ID web-app host) and ONT ID owner shall sign on the same transaction. *(The document is in progress. Coming soon...)* + +``` +url:/api/v1/ons/list?domain=on.ont&ontid=did:ont:AGWYQHd4bzyhrbpeYCMsxXYQcJo95VtR5q +method:Get +``` + +Response: + +| Field Name | Type | Description | +|---|---|---| +| ontid | String | User ONT ID | +| domain | String | Website domain name | + +Response: + +```json +{ + "action": "getOnsList", + "error": 0, + "desc": "SUCCESS", + "result": [ + "test.ont.io", + "2222.ont.io", + "1111.ont.io" + ], + "version": "v1" +} +``` +| Field Name | Type | Description | +| --- | --- | --- | +| action | String | Action name | +| error | int | Error code | +| desc | String | If successful, "SUCCESS" is shown; if failed, error description is shown | +| result | String | If successful, domain name list is returned,; if failed, "" is returned | +| version | String | Version | + +##### 3.2 Callback verification + +``` +url:/api/v1/ons/login/callback +method:Post +``` + +Request: +```json +{ + "action": "login", + "version": "v1", + "id": "10ba038e-48da-487b-96e8-8d3b99b6d18a", + "params": { + "type": "ontid", + "user": "did:ont:AGWYQHd4bzyhrbpeYCMsxXYQcJo95VtR5q", + "domain": "test.ont.io", + "msg": "7ca22b", + "publickey": "0205c8fff4b1d21f4b2ec3b48cf88004e38402933d7e914b2a0eda0de15e73ba61", + "signature": "01abd7ea9d79c857cd838cabbbaad3efb44a6fc4f5a5ef52ea8461d6c055b8a7cf324d1a58962988709705cefe40df5b26e88af3ca387ec5036ec7f5e6640a1754" + } +} +``` +| Field Name | Type | Description | +|---|---|---| +| action | String | Action name | +| version | String | Version | +| id | String | Recorded ID | +| params | Object | Callback verification parameters | +| type | String | Type | +| user | String | User ONT ID | +| domain | String | User domain name | +| msg | String | Signature verification message, pre-defined in `1. new login` | +| publickey | String | Public key | +| signature | String | Signed data | + +Response: + +```json +{ + "result": true, + "action": "login", + "id": "10ba038e-48da-487b-96e8-8d3b99b6d18a", + "error": 0, + "desc": "SUCCESS" +} +``` +| Field Name | Type | Description | +| --- | --- | --- | +| action | String | Action name | +| error | int | Error code | +| desc | String | If successful, "SUCCESS" is shown; if failed, error description is shown | +| result | String | If successful, true is returned; if failed, then "" is returned | +| version | String | Version | + +## Register new action + +### 1. Register new transaction + +Sign by host of web-app. + +### 2. Register new transaction template + +Sign by host of web-app. \ No newline at end of file diff --git a/prod-doc/en/ontid/framework/signing-server/saas-tenant.md b/prod-doc/en/ontid/framework/signing-server/saas-tenant.md new file mode 100644 index 00000000..dc0aafc5 --- /dev/null +++ b/prod-doc/en/ontid/framework/signing-server/saas-tenant.md @@ -0,0 +1,15 @@ +# ONT ID signing server - tenant + +This document describes an easy way to use self-sovereign signing services: become a tenant of Ontology public signing server. + +## 1. Prerequisite + +*[TBD]* + +## 2. Configuration + +*[TBD]* + +## Appendix I. the pricing model + +*[TBD]* \ No newline at end of file diff --git a/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/README.md b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/README.md new file mode 100644 index 00000000..cd949dce --- /dev/null +++ b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/README.md @@ -0,0 +1,5 @@ +Javadoc is generated here. + +[>>> View detail](./index.html) + +For usecase, please view [scenarios](../../../../business/scenarios/README.md) \ No newline at end of file diff --git a/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/allclasses-frame.html b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/allclasses-frame.html new file mode 100644 index 00000000..d05fb9aa --- /dev/null +++ b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/allclasses-frame.html @@ -0,0 +1,24 @@ + + + + + + +All Classes + + + + + +

All Classes

+
+ +
+ + diff --git a/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/allclasses-noframe.html b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/allclasses-noframe.html new file mode 100644 index 00000000..68d4b08d --- /dev/null +++ b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/allclasses-noframe.html @@ -0,0 +1,24 @@ + + + + + + +All Classes + + + + + +

All Classes

+
+ +
+ + diff --git a/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/com/ontology/dto/ContractDto.html b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/com/ontology/dto/ContractDto.html new file mode 100644 index 00000000..6dfeda5b --- /dev/null +++ b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/com/ontology/dto/ContractDto.html @@ -0,0 +1,335 @@ + + + + + + +ContractDto + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + + +
+
com.ontology.dto
+

Class ContractDto

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/com/ontology/dto/package-frame.html b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/com/ontology/dto/package-frame.html new file mode 100644 index 00000000..77ce4a31 --- /dev/null +++ b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/com/ontology/dto/package-frame.html @@ -0,0 +1,21 @@ + + + + + + +com.ontology.dto + + + + + +

com.ontology.dto

+
+

Classes

+ +
+ + diff --git a/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/com/ontology/dto/package-summary.html b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/com/ontology/dto/package-summary.html new file mode 100644 index 00000000..bc50a492 --- /dev/null +++ b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/com/ontology/dto/package-summary.html @@ -0,0 +1,141 @@ + + + + + + +com.ontology.dto + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
+

Package com.ontology.dto

+
+
+ +
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/com/ontology/dto/package-tree.html b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/com/ontology/dto/package-tree.html new file mode 100644 index 00000000..a58a9dfe --- /dev/null +++ b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/com/ontology/dto/package-tree.html @@ -0,0 +1,136 @@ + + + + + + +com.ontology.dto Class Hierarchy + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
+

Hierarchy For Package com.ontology.dto

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/com/ontology/exception/SigningSdkException.html b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/com/ontology/exception/SigningSdkException.html new file mode 100644 index 00000000..b1d08eca --- /dev/null +++ b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/com/ontology/exception/SigningSdkException.html @@ -0,0 +1,365 @@ + + + + + + +SigningSdkException + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + + +
+
com.ontology.exception
+

Class SigningSdkException

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/com/ontology/exception/package-frame.html b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/com/ontology/exception/package-frame.html new file mode 100644 index 00000000..1572cf34 --- /dev/null +++ b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/com/ontology/exception/package-frame.html @@ -0,0 +1,21 @@ + + + + + + +com.ontology.exception + + + + + +

com.ontology.exception

+
+

Exceptions

+ +
+ + diff --git a/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/com/ontology/exception/package-summary.html b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/com/ontology/exception/package-summary.html new file mode 100644 index 00000000..61003196 --- /dev/null +++ b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/com/ontology/exception/package-summary.html @@ -0,0 +1,141 @@ + + + + + + +com.ontology.exception + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
+

Package com.ontology.exception

+
+
+ +
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/com/ontology/exception/package-tree.html b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/com/ontology/exception/package-tree.html new file mode 100644 index 00000000..c3639e9b --- /dev/null +++ b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/com/ontology/exception/package-tree.html @@ -0,0 +1,148 @@ + + + + + + +com.ontology.exception Class Hierarchy + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
+

Hierarchy For Package com.ontology.exception

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/com/ontology/sdk/SigningSdk.html b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/com/ontology/sdk/SigningSdk.html new file mode 100644 index 00000000..a69c22c5 --- /dev/null +++ b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/com/ontology/sdk/SigningSdk.html @@ -0,0 +1,327 @@ + + + + + + +SigningSdk + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + + +
+
com.ontology.sdk
+

Class SigningSdk

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/com/ontology/sdk/package-frame.html b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/com/ontology/sdk/package-frame.html new file mode 100644 index 00000000..6eee425a --- /dev/null +++ b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/com/ontology/sdk/package-frame.html @@ -0,0 +1,21 @@ + + + + + + +com.ontology.sdk + + + + + +

com.ontology.sdk

+
+

Classes

+ +
+ + diff --git a/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/com/ontology/sdk/package-summary.html b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/com/ontology/sdk/package-summary.html new file mode 100644 index 00000000..88b0ac7f --- /dev/null +++ b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/com/ontology/sdk/package-summary.html @@ -0,0 +1,141 @@ + + + + + + +com.ontology.sdk + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
+

Package com.ontology.sdk

+
+
+ +
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/com/ontology/sdk/package-tree.html b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/com/ontology/sdk/package-tree.html new file mode 100644 index 00000000..3857d8e3 --- /dev/null +++ b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/com/ontology/sdk/package-tree.html @@ -0,0 +1,136 @@ + + + + + + +com.ontology.sdk Class Hierarchy + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
+

Hierarchy For Package com.ontology.sdk

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/com/ontology/utils/ErrorInfo.html b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/com/ontology/utils/ErrorInfo.html new file mode 100644 index 00000000..9da6340b --- /dev/null +++ b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/com/ontology/utils/ErrorInfo.html @@ -0,0 +1,820 @@ + + + + + + +ErrorInfo + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + + +
+
com.ontology.utils
+

Enum ErrorInfo

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/com/ontology/utils/HttpClientUtils.html b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/com/ontology/utils/HttpClientUtils.html new file mode 100644 index 00000000..dfa37b16 --- /dev/null +++ b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/com/ontology/utils/HttpClientUtils.html @@ -0,0 +1,319 @@ + + + + + + +HttpClientUtils + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + + +
+
com.ontology.utils
+

Class HttpClientUtils

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/com/ontology/utils/package-frame.html b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/com/ontology/utils/package-frame.html new file mode 100644 index 00000000..7a1f5b2e --- /dev/null +++ b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/com/ontology/utils/package-frame.html @@ -0,0 +1,25 @@ + + + + + + +com.ontology.utils + + + + + +

com.ontology.utils

+
+

Classes

+ +

Enums

+ +
+ + diff --git a/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/com/ontology/utils/package-summary.html b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/com/ontology/utils/package-summary.html new file mode 100644 index 00000000..704f4ff6 --- /dev/null +++ b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/com/ontology/utils/package-summary.html @@ -0,0 +1,156 @@ + + + + + + +com.ontology.utils + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
+

Package com.ontology.utils

+
+
+ +
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/com/ontology/utils/package-tree.html b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/com/ontology/utils/package-tree.html new file mode 100644 index 00000000..90fcd377 --- /dev/null +++ b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/com/ontology/utils/package-tree.html @@ -0,0 +1,148 @@ + + + + + + +com.ontology.utils Class Hierarchy + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
+

Hierarchy For Package com.ontology.utils

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +

Enum Hierarchy

+ +
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/constant-values.html b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/constant-values.html new file mode 100644 index 00000000..cce3f095 --- /dev/null +++ b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/constant-values.html @@ -0,0 +1,123 @@ + + + + + + +Constant Field Values + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
+

Constant Field Values

+

Contents

+
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/deprecated-list.html b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/deprecated-list.html new file mode 100644 index 00000000..2b0ddfa6 --- /dev/null +++ b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/deprecated-list.html @@ -0,0 +1,123 @@ + + + + + + +Deprecated List + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
+

Deprecated API

+

Contents

+
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/help-doc.html b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/help-doc.html new file mode 100644 index 00000000..147735a7 --- /dev/null +++ b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/help-doc.html @@ -0,0 +1,224 @@ + + + + + + +API Help + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
+

How This API Document Is Organized

+
This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.
+
+
+ +This help file applies to API documentation generated using the standard doclet.
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/index-files/index-1.html b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/index-files/index-1.html new file mode 100644 index 00000000..4c0ed673 --- /dev/null +++ b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/index-files/index-1.html @@ -0,0 +1,144 @@ + + + + + + +C-Index + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
C D E G H S T V  + + +

C

+
+
code() - Method in enum com.ontology.utils.ErrorInfo
+
 
+
com.ontology.dto - package com.ontology.dto
+
 
+
com.ontology.exception - package com.ontology.exception
+
 
+
com.ontology.sdk - package com.ontology.sdk
+
 
+
com.ontology.utils - package com.ontology.utils
+
 
+
constructTransaction(List, String, String) - Method in class com.ontology.sdk.SigningSdk
+
 
+
ContractDto - Class in com.ontology.dto
+
 
+
ContractDto() - Constructor for class com.ontology.dto.ContractDto
+
 
+
contractResult(String) - Method in class com.ontology.sdk.SigningSdk
+
 
+
+C D E G H S T V 
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/index-files/index-2.html b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/index-files/index-2.html new file mode 100644 index 00000000..95975f2b --- /dev/null +++ b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/index-files/index-2.html @@ -0,0 +1,130 @@ + + + + + + +D-Index + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
C D E G H S T V  + + +

D

+
+
descCN() - Method in enum com.ontology.utils.ErrorInfo
+
 
+
descEN() - Method in enum com.ontology.utils.ErrorInfo
+
 
+
+C D E G H S T V 
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/index-files/index-3.html b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/index-files/index-3.html new file mode 100644 index 00000000..cb1b00cf --- /dev/null +++ b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/index-files/index-3.html @@ -0,0 +1,128 @@ + + + + + + +E-Index + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
C D E G H S T V  + + +

E

+
+
ErrorInfo - Enum in com.ontology.utils
+
 
+
+C D E G H S T V 
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/index-files/index-4.html b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/index-files/index-4.html new file mode 100644 index 00000000..4e0612de --- /dev/null +++ b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/index-files/index-4.html @@ -0,0 +1,140 @@ + + + + + + +G-Index + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
C D E G H S T V  + + +

G

+
+
getArgsList() - Method in class com.ontology.dto.ContractDto
+
 
+
getContractHash() - Method in class com.ontology.dto.ContractDto
+
 
+
getErrCode() - Method in exception com.ontology.exception.SigningSdkException
+
 
+
getErrDesCN() - Method in exception com.ontology.exception.SigningSdkException
+
 
+
getErrDesEN() - Method in exception com.ontology.exception.SigningSdkException
+
 
+
getInstance(String) - Static method in class com.ontology.sdk.SigningSdk
+
 
+
getMethod() - Method in class com.ontology.dto.ContractDto
+
 
+
+C D E G H S T V 
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/index-files/index-5.html b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/index-files/index-5.html new file mode 100644 index 00000000..838e96c8 --- /dev/null +++ b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/index-files/index-5.html @@ -0,0 +1,138 @@ + + + + + + +H-Index + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
C D E G H S T V  + + +

H

+
+
httpClientGet(String, Map<String, Object>, Map<String, Object>) - Method in class com.ontology.utils.HttpClientUtils
+
+
httpclient get请求
+
+
httpClientPost(String, String, Map<String, Object>) - Method in class com.ontology.utils.HttpClientUtils
+
+
httpclient post请求
+
+
HttpClientUtils - Class in com.ontology.utils
+
 
+
HttpClientUtils() - Constructor for class com.ontology.utils.HttpClientUtils
+
 
+
+C D E G H S T V 
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/index-files/index-6.html b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/index-files/index-6.html new file mode 100644 index 00000000..0c7801ff --- /dev/null +++ b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/index-files/index-6.html @@ -0,0 +1,142 @@ + + + + + + +S-Index + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
C D E G H S T V  + + +

S

+
+
setArgsList(List) - Method in class com.ontology.dto.ContractDto
+
 
+
setContractHash(String) - Method in class com.ontology.dto.ContractDto
+
 
+
setMethod(String) - Method in class com.ontology.dto.ContractDto
+
 
+
setRestfulUrl(String) - Method in class com.ontology.sdk.SigningSdk
+
 
+
SigningSdk - Class in com.ontology.sdk
+
 
+
SigningSdkException - Exception in com.ontology.exception
+
 
+
SigningSdkException(long, String, String, String) - Constructor for exception com.ontology.exception.SigningSdkException
+
 
+
SigningSdkException(long, String, String) - Constructor for exception com.ontology.exception.SigningSdkException
+
 
+
+C D E G H S T V 
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/index-files/index-7.html b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/index-files/index-7.html new file mode 100644 index 00000000..9dc2f289 --- /dev/null +++ b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/index-files/index-7.html @@ -0,0 +1,128 @@ + + + + + + +T-Index + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
C D E G H S T V  + + +

T

+
+
toString() - Method in exception com.ontology.exception.SigningSdkException
+
 
+
+C D E G H S T V 
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/index-files/index-8.html b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/index-files/index-8.html new file mode 100644 index 00000000..87c56e92 --- /dev/null +++ b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/index-files/index-8.html @@ -0,0 +1,139 @@ + + + + + + +V-Index + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
C D E G H S T V  + + +

V

+
+
valueOf(String) - Static method in enum com.ontology.utils.ErrorInfo
+
+
Returns the enum constant of this type with the specified name.
+
+
values() - Static method in enum com.ontology.utils.ErrorInfo
+
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
verify(String, String) - Method in class com.ontology.sdk.SigningSdk
+
 
+
VerifyResult(String) - Method in class com.ontology.sdk.SigningSdk
+
 
+
+C D E G H S T V 
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/index.html b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/index.html new file mode 100644 index 00000000..71914d0d --- /dev/null +++ b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/index.html @@ -0,0 +1,76 @@ + + + + + + +Generated Documentation (Untitled) + + + + + + + + + +<noscript> +<div>JavaScript is disabled on your browser.</div> +</noscript> +<h2>Frame Alert</h2> +<p>This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. Link to <a href="overview-summary.html">Non-frame version</a>.</p> + + + diff --git a/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/overview-frame.html b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/overview-frame.html new file mode 100644 index 00000000..278ad6f6 --- /dev/null +++ b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/overview-frame.html @@ -0,0 +1,25 @@ + + + + + + +Overview List + + + + + +
All Classes
+
+

Packages

+ +
+

 

+ + diff --git a/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/overview-summary.html b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/overview-summary.html new file mode 100644 index 00000000..32f43e8b --- /dev/null +++ b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/overview-summary.html @@ -0,0 +1,146 @@ + + + + + + +Overview + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
Packages 
PackageDescription
com.ontology.dto 
com.ontology.exception 
com.ontology.sdk 
com.ontology.utils 
+
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/overview-tree.html b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/overview-tree.html new file mode 100644 index 00000000..594a13f5 --- /dev/null +++ b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/overview-tree.html @@ -0,0 +1,166 @@ + + + + + + +Class Hierarchy + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
+

Hierarchy For All Packages

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +

Enum Hierarchy

+ +
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/package-list b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/package-list new file mode 100644 index 00000000..3cc93746 --- /dev/null +++ b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/package-list @@ -0,0 +1,4 @@ +com.ontology.dto +com.ontology.exception +com.ontology.sdk +com.ontology.utils diff --git a/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/script.js b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/script.js new file mode 100644 index 00000000..b3463569 --- /dev/null +++ b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/script.js @@ -0,0 +1,30 @@ +function show(type) +{ + count = 0; + for (var key in methods) { + var row = document.getElementById(key); + if ((methods[key] & type) != 0) { + row.style.display = ''; + row.className = (count++ % 2) ? rowColor : altColor; + } + else + row.style.display = 'none'; + } + updateTabs(type); +} + +function updateTabs(type) +{ + for (var value in tabs) { + var sNode = document.getElementById(tabs[value][0]); + var spanNode = sNode.firstChild; + if (value == type) { + sNode.className = activeTableTab; + spanNode.innerHTML = tabs[value][1]; + } + else { + sNode.className = tableTab; + spanNode.innerHTML = "" + tabs[value][1] + ""; + } + } +} diff --git a/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/serialized-form.html b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/serialized-form.html new file mode 100644 index 00000000..ad0f98ec --- /dev/null +++ b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/serialized-form.html @@ -0,0 +1,155 @@ + + + + + + +Serialized Form + + + + + + + + +
+ + +
Skip navigation links
+ + + + +
+ + +
+

Serialized Form

+
+
+ +
+ +
+ + +
Skip navigation links
+ + + + +
+ + + + diff --git a/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/stylesheet.css b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/stylesheet.css new file mode 100644 index 00000000..98055b22 --- /dev/null +++ b/prod-doc/en/ontid/framework/signing-server/sdk/java/javadoc/javaDoc/stylesheet.css @@ -0,0 +1,574 @@ +/* Javadoc style sheet */ +/* +Overall document style +*/ + +@import url('resources/fonts/dejavu.css'); + +body { + background-color:#ffffff; + color:#353833; + font-family:'DejaVu Sans', Arial, Helvetica, sans-serif; + font-size:14px; + margin:0; +} +a:link, a:visited { + text-decoration:none; + color:#4A6782; +} +a:hover, a:focus { + text-decoration:none; + color:#bb7a2a; +} +a:active { + text-decoration:none; + color:#4A6782; +} +a[name] { + color:#353833; +} +a[name]:hover { + text-decoration:none; + color:#353833; +} +pre { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; +} +h1 { + font-size:20px; +} +h2 { + font-size:18px; +} +h3 { + font-size:16px; + font-style:italic; +} +h4 { + font-size:13px; +} +h5 { + font-size:12px; +} +h6 { + font-size:11px; +} +ul { + list-style-type:disc; +} +code, tt { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + padding-top:4px; + margin-top:8px; + line-height:1.4em; +} +dt code { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + padding-top:4px; +} +table tr td dt code { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + vertical-align:top; + padding-top:4px; +} +sup { + font-size:8px; +} +/* +Document title and Copyright styles +*/ +.clear { + clear:both; + height:0px; + overflow:hidden; +} +.aboutLanguage { + float:right; + padding:0px 21px; + font-size:11px; + z-index:200; + margin-top:-9px; +} +.legalCopy { + margin-left:.5em; +} +.bar a, .bar a:link, .bar a:visited, .bar a:active { + color:#FFFFFF; + text-decoration:none; +} +.bar a:hover, .bar a:focus { + color:#bb7a2a; +} +.tab { + background-color:#0066FF; + color:#ffffff; + padding:8px; + width:5em; + font-weight:bold; +} +/* +Navigation bar styles +*/ +.bar { + background-color:#4D7A97; + color:#FFFFFF; + padding:.8em .5em .4em .8em; + height:auto;/*height:1.8em;*/ + font-size:11px; + margin:0; +} +.topNav { + background-color:#4D7A97; + color:#FFFFFF; + float:left; + padding:0; + width:100%; + clear:right; + height:2.8em; + padding-top:10px; + overflow:hidden; + font-size:12px; +} +.bottomNav { + margin-top:10px; + background-color:#4D7A97; + color:#FFFFFF; + float:left; + padding:0; + width:100%; + clear:right; + height:2.8em; + padding-top:10px; + overflow:hidden; + font-size:12px; +} +.subNav { + background-color:#dee3e9; + float:left; + width:100%; + overflow:hidden; + font-size:12px; +} +.subNav div { + clear:left; + float:left; + padding:0 0 5px 6px; + text-transform:uppercase; +} +ul.navList, ul.subNavList { + float:left; + margin:0 25px 0 0; + padding:0; +} +ul.navList li{ + list-style:none; + float:left; + padding: 5px 6px; + text-transform:uppercase; +} +ul.subNavList li{ + list-style:none; + float:left; +} +.topNav a:link, .topNav a:active, .topNav a:visited, .bottomNav a:link, .bottomNav a:active, .bottomNav a:visited { + color:#FFFFFF; + text-decoration:none; + text-transform:uppercase; +} +.topNav a:hover, .bottomNav a:hover { + text-decoration:none; + color:#bb7a2a; + text-transform:uppercase; +} +.navBarCell1Rev { + background-color:#F8981D; + color:#253441; + margin: auto 5px; +} +.skipNav { + position:absolute; + top:auto; + left:-9999px; + overflow:hidden; +} +/* +Page header and footer styles +*/ +.header, .footer { + clear:both; + margin:0 20px; + padding:5px 0 0 0; +} +.indexHeader { + margin:10px; + position:relative; +} +.indexHeader span{ + margin-right:15px; +} +.indexHeader h1 { + font-size:13px; +} +.title { + color:#2c4557; + margin:10px 0; +} +.subTitle { + margin:5px 0 0 0; +} +.header ul { + margin:0 0 15px 0; + padding:0; +} +.footer ul { + margin:20px 0 5px 0; +} +.header ul li, .footer ul li { + list-style:none; + font-size:13px; +} +/* +Heading styles +*/ +div.details ul.blockList ul.blockList ul.blockList li.blockList h4, div.details ul.blockList ul.blockList ul.blockListLast li.blockList h4 { + background-color:#dee3e9; + border:1px solid #d0d9e0; + margin:0 0 6px -8px; + padding:7px 5px; +} +ul.blockList ul.blockList ul.blockList li.blockList h3 { + background-color:#dee3e9; + border:1px solid #d0d9e0; + margin:0 0 6px -8px; + padding:7px 5px; +} +ul.blockList ul.blockList li.blockList h3 { + padding:0; + margin:15px 0; +} +ul.blockList li.blockList h2 { + padding:0px 0 20px 0; +} +/* +Page layout container styles +*/ +.contentContainer, .sourceContainer, .classUseContainer, .serializedFormContainer, .constantValuesContainer { + clear:both; + padding:10px 20px; + position:relative; +} +.indexContainer { + margin:10px; + position:relative; + font-size:12px; +} +.indexContainer h2 { + font-size:13px; + padding:0 0 3px 0; +} +.indexContainer ul { + margin:0; + padding:0; +} +.indexContainer ul li { + list-style:none; + padding-top:2px; +} +.contentContainer .description dl dt, .contentContainer .details dl dt, .serializedFormContainer dl dt { + font-size:12px; + font-weight:bold; + margin:10px 0 0 0; + color:#4E4E4E; +} +.contentContainer .description dl dd, .contentContainer .details dl dd, .serializedFormContainer dl dd { + margin:5px 0 10px 0px; + font-size:14px; + font-family:'DejaVu Sans Mono',monospace; +} +.serializedFormContainer dl.nameValue dt { + margin-left:1px; + font-size:1.1em; + display:inline; + font-weight:bold; +} +.serializedFormContainer dl.nameValue dd { + margin:0 0 0 1px; + font-size:1.1em; + display:inline; +} +/* +List styles +*/ +ul.horizontal li { + display:inline; + font-size:0.9em; +} +ul.inheritance { + margin:0; + padding:0; +} +ul.inheritance li { + display:inline; + list-style:none; +} +ul.inheritance li ul.inheritance { + margin-left:15px; + padding-left:15px; + padding-top:1px; +} +ul.blockList, ul.blockListLast { + margin:10px 0 10px 0; + padding:0; +} +ul.blockList li.blockList, ul.blockListLast li.blockList { + list-style:none; + margin-bottom:15px; + line-height:1.4; +} +ul.blockList ul.blockList li.blockList, ul.blockList ul.blockListLast li.blockList { + padding:0px 20px 5px 10px; + border:1px solid #ededed; + background-color:#f8f8f8; +} +ul.blockList ul.blockList ul.blockList li.blockList, ul.blockList ul.blockList ul.blockListLast li.blockList { + padding:0 0 5px 8px; + background-color:#ffffff; + border:none; +} +ul.blockList ul.blockList ul.blockList ul.blockList li.blockList { + margin-left:0; + padding-left:0; + padding-bottom:15px; + border:none; +} +ul.blockList ul.blockList ul.blockList ul.blockList li.blockListLast { + list-style:none; + border-bottom:none; + padding-bottom:0; +} +table tr td dl, table tr td dl dt, table tr td dl dd { + margin-top:0; + margin-bottom:1px; +} +/* +Table styles +*/ +.overviewSummary, .memberSummary, .typeSummary, .useSummary, .constantsSummary, .deprecatedSummary { + width:100%; + border-left:1px solid #EEE; + border-right:1px solid #EEE; + border-bottom:1px solid #EEE; +} +.overviewSummary, .memberSummary { + padding:0px; +} +.overviewSummary caption, .memberSummary caption, .typeSummary caption, +.useSummary caption, .constantsSummary caption, .deprecatedSummary caption { + position:relative; + text-align:left; + background-repeat:no-repeat; + color:#253441; + font-weight:bold; + clear:none; + overflow:hidden; + padding:0px; + padding-top:10px; + padding-left:1px; + margin:0px; + white-space:pre; +} +.overviewSummary caption a:link, .memberSummary caption a:link, .typeSummary caption a:link, +.useSummary caption a:link, .constantsSummary caption a:link, .deprecatedSummary caption a:link, +.overviewSummary caption a:hover, .memberSummary caption a:hover, .typeSummary caption a:hover, +.useSummary caption a:hover, .constantsSummary caption a:hover, .deprecatedSummary caption a:hover, +.overviewSummary caption a:active, .memberSummary caption a:active, .typeSummary caption a:active, +.useSummary caption a:active, .constantsSummary caption a:active, .deprecatedSummary caption a:active, +.overviewSummary caption a:visited, .memberSummary caption a:visited, .typeSummary caption a:visited, +.useSummary caption a:visited, .constantsSummary caption a:visited, .deprecatedSummary caption a:visited { + color:#FFFFFF; +} +.overviewSummary caption span, .memberSummary caption span, .typeSummary caption span, +.useSummary caption span, .constantsSummary caption span, .deprecatedSummary caption span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + padding-bottom:7px; + display:inline-block; + float:left; + background-color:#F8981D; + border: none; + height:16px; +} +.memberSummary caption span.activeTableTab span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + margin-right:3px; + display:inline-block; + float:left; + background-color:#F8981D; + height:16px; +} +.memberSummary caption span.tableTab span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + margin-right:3px; + display:inline-block; + float:left; + background-color:#4D7A97; + height:16px; +} +.memberSummary caption span.tableTab, .memberSummary caption span.activeTableTab { + padding-top:0px; + padding-left:0px; + padding-right:0px; + background-image:none; + float:none; + display:inline; +} +.overviewSummary .tabEnd, .memberSummary .tabEnd, .typeSummary .tabEnd, +.useSummary .tabEnd, .constantsSummary .tabEnd, .deprecatedSummary .tabEnd { + display:none; + width:5px; + position:relative; + float:left; + background-color:#F8981D; +} +.memberSummary .activeTableTab .tabEnd { + display:none; + width:5px; + margin-right:3px; + position:relative; + float:left; + background-color:#F8981D; +} +.memberSummary .tableTab .tabEnd { + display:none; + width:5px; + margin-right:3px; + position:relative; + background-color:#4D7A97; + float:left; + +} +.overviewSummary td, .memberSummary td, .typeSummary td, +.useSummary td, .constantsSummary td, .deprecatedSummary td { + text-align:left; + padding:0px 0px 12px 10px; +} +th.colOne, th.colFirst, th.colLast, .useSummary th, .constantsSummary th, +td.colOne, td.colFirst, td.colLast, .useSummary td, .constantsSummary td{ + vertical-align:top; + padding-right:0px; + padding-top:8px; + padding-bottom:3px; +} +th.colFirst, th.colLast, th.colOne, .constantsSummary th { + background:#dee3e9; + text-align:left; + padding:8px 3px 3px 7px; +} +td.colFirst, th.colFirst { + white-space:nowrap; + font-size:13px; +} +td.colLast, th.colLast { + font-size:13px; +} +td.colOne, th.colOne { + font-size:13px; +} +.overviewSummary td.colFirst, .overviewSummary th.colFirst, +.useSummary td.colFirst, .useSummary th.colFirst, +.overviewSummary td.colOne, .overviewSummary th.colOne, +.memberSummary td.colFirst, .memberSummary th.colFirst, +.memberSummary td.colOne, .memberSummary th.colOne, +.typeSummary td.colFirst{ + width:25%; + vertical-align:top; +} +td.colOne a:link, td.colOne a:active, td.colOne a:visited, td.colOne a:hover, td.colFirst a:link, td.colFirst a:active, td.colFirst a:visited, td.colFirst a:hover, td.colLast a:link, td.colLast a:active, td.colLast a:visited, td.colLast a:hover, .constantValuesContainer td a:link, .constantValuesContainer td a:active, .constantValuesContainer td a:visited, .constantValuesContainer td a:hover { + font-weight:bold; +} +.tableSubHeadingColor { + background-color:#EEEEFF; +} +.altColor { + background-color:#FFFFFF; +} +.rowColor { + background-color:#EEEEEF; +} +/* +Content styles +*/ +.description pre { + margin-top:0; +} +.deprecatedContent { + margin:0; + padding:10px 0; +} +.docSummary { + padding:0; +} + +ul.blockList ul.blockList ul.blockList li.blockList h3 { + font-style:normal; +} + +div.block { + font-size:14px; + font-family:'DejaVu Serif', Georgia, "Times New Roman", Times, serif; +} + +td.colLast div { + padding-top:0px; +} + + +td.colLast a { + padding-bottom:3px; +} +/* +Formatting effect styles +*/ +.sourceLineNo { + color:green; + padding:0 30px 0 0; +} +h1.hidden { + visibility:hidden; + overflow:hidden; + font-size:10px; +} +.block { + display:block; + margin:3px 10px 2px 0px; + color:#474747; +} +.deprecatedLabel, .descfrmTypeLabel, .memberNameLabel, .memberNameLink, +.overrideSpecifyLabel, .packageHierarchyLabel, .paramLabel, .returnLabel, +.seeLabel, .simpleTagLabel, .throwsLabel, .typeNameLabel, .typeNameLink { + font-weight:bold; +} +.deprecationComment, .emphasizedPhrase, .interfaceName { + font-style:italic; +} + +div.block div.block span.deprecationComment, div.block div.block span.emphasizedPhrase, +div.block div.block span.interfaceName { + font-style:normal; +} + +div.contentContainer ul.blockList li.blockList h2{ + padding-bottom:0px; +} diff --git a/prod-doc/en/ontid/framework/spec/archived/ontid-0.7.0.md b/prod-doc/en/ontid/framework/spec/archived/ontid-0.7.0.md new file mode 100644 index 00000000..41b28940 --- /dev/null +++ b/prod-doc/en/ontid/framework/spec/archived/ontid-0.7.0.md @@ -0,0 +1,219 @@ +

Ontology Distributed Identification Protocol

+

Version 0.7.0

+“Entity” refers to individuals, legal entities (organizations, enterprises, institutions, etc.), objects (mobile phones, automobiles, IoT devices, etc.), and contents (articles, copyrights, etc.) in the real world, and “identity” refers to the entity's identity within the network. Ontology uses Ontology Identifier (ONT ID) to identify and manage the entities' identities. On Ontology Blockchain, one entity can correspond to multiple individual identities, and there is no relation between multiple identities. + +The ONT ID is a decentralized identification protocol and it has the features of decentralization, self-management, privacy protection, security and ease of use. Each ONT ID corresponds to an ONT ID Description Object (DDO). + +> The ONT ID protocol has been completely implemented by the smart contract of Ontology Blockchain. As a protocol layer, it follows a decoupled design, so it is not limited to Ontology Blockchain, but can also be implemented on other blockchains. + +## Identification Protocol Specification + +### 1.1 ONT ID generation + +The ONT ID is a URI that is generated by each entity itself. The generation algorithm needs to guarantee that the collision probability is extremely low. Beside, when someone register an ONT ID on Ontology, the consensus node can check whether the ID is already registered. + +ONT ID generation algorithm: + +To prevent the user from entering the ONT ID by mistake, we define a valid ONT ID that must contain 4 bytes of verification data. We are going to describe in detail how to generate a valid ONT ID. +```json + 1. Generate a 32-byte temporary random nonce, and calculate h = Hash160 (nonce), data = || h; + 2. Calculate a 4-byte verification data, that is, checksum = SHA256(SHA256(data))[0:3]; + 3. Make idString = data || checksum; + 4. Cascade "did:ont:" with data, that is, ontId = "did:ont:" || idString; + 5. Output ONT ID. +``` + +Above you see, `` is a network identifier, and `` is a 1 byte version label. In ONT, ` = 41, = "ont"`. That is to say , the first 8 bytes of identity in Ontology are "did:ont:", plus a 25 byte long idString, which constitutes a complete ONT ID. + +### 1.2 Self-management +Ontology applies digital signature technology to guarantee entities have rights to manage their own identities. The ONT ID is bound to the entity's public key when it registers, thereby indicating its ownership. The use of the ONT ID and the modification of its attributes require the owner's digital signature. The entity can independently determine the scope of use of its ONT ID and set the public key bounded by ONT ID and manage the attributes of the ONT ID. + +### 1.3 Multiple key binding +Ontology supports a variety of domestic and international standardized digital signature algorithms such as RSA, ECDSA, and SM2. The algorithm applied to the key that is bounded by ONT ID should be specified. At the same time, an ONT ID can bound multiple different keys to meet the usage requirements of entities in different application scenarios. + +### 1.4 Recovery of identity loss +The owner of the ONT ID can assign someone else to execute his management rights, such as modifying the attributes of the ONT ID and replacing the key when the key is lost. The assigned person can implement a variety of access control logic such as “AND”, “OR”, and “(m, n)-thresholds”. Refer to [Appendix A](#a-recovery-account-address) for more details. + +### 1.5 Identity description object DDO specification + +The identity description object DDO corresponding to the ONT ID is stored in the Ontology Blockchain. It is written to the blockchain by the controller of the DDO and is open to all users for reading. + +The DDO specification contains the following information: +- `PublicKeys`:The information of the public key used for identity authentication, including public key id, public key type, and public key data; +- `Attributes`:All attributes make up a JSON object; +- `Recovery`:The assigned restorer can help reset the user's public key list. + +For example, +```json +{ + "OntId": "did:ont:TVuF6FH1PskzWJAFhWAFg17NSitMDEBNoa", + "Owners": [{ + "PubKeyId": "did:ont:TVuF6FH1PskzWJAFhWAFg17NSitMDEBNoa#keys-1", + "Type": "ECDSA", + "Curve": "nistp256", + "Value":"022f71daef10803ece19f96b2cdb348d22bf7871c178b41f35a4f3772a8359b7d2" + }, { + "PublicKeyId": "did:ont:TVuF6FH1PskzWJAFhWAFg17NSitMDEBNoa#keys-2", + "Type": "RSA", + "Length": 2048, + "Value": "3082010a...." + } + ], + "Attributes": { + "OfficialCredential": { + "Service": "PKI", + "CN": "ont.io", + "CertFingerprint": "1028e8f7043f12c0c2069bd7c7b3b26213964566" + } + }, + "Recovery": "TA63T1gxXPXWsBqHtBKcV4NhFBhw3rtkAF" +} +``` + +## Smart Contract Implementation Specification + +“IdContract” is a smart contract implementation of the ONT ID protocol on the Ontology Blockchain platform. With the ONT IdContract, users can manage their own public key lists, modify their personal profiles, and add account restorers. + +### 2.1 How to call +The external interface of the IdContract has only one main function. Its parameters include the name of the sub-function (called operation code - `op`) and the parameter lists – `params`, which is passed to the sub-function.。 +```json +public static Object Main(string op, object[] params); +``` +The return value of most of sub-functions is a boolean type, which represents the success or failure of the execution operation. After correct execution, an event message will be pushed to notify the caller. For the specific message type, please refer to the “**API description**” subsection. + +#### The call of Ontology smart contract +By sending a transaction with a type of *InvocationTransaction*, transaction payload will include contract address and parameters. For more detailed information, please refer to [Contract Call](https://ontio.github.io/documentation/smart_contract_tutorial_overview_en.html). + +### 2.2 IdContract Interface Definition +#### a. Identity registration +When the users registers their identities, they must submit a public key, and **this operation must be initiated by this public key**. + +```json +bool RegIdWIthPublicKey(byte[] ontId, byte[] publicKey); +``` + Parameters: + - ontId: User ID, byte[] type; + - publicKey: Public key, byte[] type. + + +#### b. Add a control key + +The user adds a new public key to his public key list. +```json +bool AddKey(byte[] ontId, byte[] newPublicKey, byte[] sender); +``` +Parameters: +- ontId:User’s ont Id; +- newPublicKey:The new public key to be added; +- sender:The initiator of the transaction, the account's existing public key, or the restorer. + +#### c. Delete a control key +Remove a public key from the user's public key list. +```json +bool RemoveKey(byte[] ontId, byte[] oldPublicKey, byte[] sender); +``` +Parameters: +- ontId:User’s Ont ID; +- oldPublicKey:The old public key that needs to be deleted; +- sender:The initiator of the transaction, the account's existing public key, or the restorer. + +#### d. Key recovery mechanism + +Add and modify the account restorer. +```json +bool AddRecovery(byte[] ontId, byte[] recovery, byte[] publicKey); +``` + +In the function `AddRecovery`, `recovery` can be added if and only if the `publicKey` is the account's existing public key, and the restorer has not been set. + +Parameters: +- ontId:User’s Ont ID; +- recovery:Recovery address; +- publicKey:User’s public key + +```json +bool ChangeRecovery(byte[] ontId, byte[] newRecovery, byte[] oldRecovery); +``` +This contract call must be initiated by oldRecovery. +Parameters: +- ontId:User’s Ont ID; +- newRecovery:New restorer +- oldRecovery:Existing restorer + +#### e. Attribute management +The addition, deletion, and modification of the user’s attributes must be authorized by the user. An attribute consists of three parts, namely, the attribute's name, the type of the attribute's value, and the value itself. In current version of this spec, the type of attribute's value must either be described using [protocol buffers](https://developers.google.com/protocol-buffers/) or binary. For the first case, `type` must be a serialized `.proto` file. For the second case `type` must be `"binary"`. + +```json +bool AddAttribute(byte[] ontId, byte[] path, byte[] type, byte[] value, byte[] publicKey); + +``` +- ontId: User’s Ont ID; path: The path of attribute name; +- type: Attribute type; value: Attribute value; +- publicKey: The user's public key. + +Must be called by a valid public key, and the `publicKey` is in the user's public key list. If the attribute does not exist, the attribute will be inserted. Otherwise the original attribute will be updated. + +```json +bool AddAttributeArray(byte[] ontId, byte[] tuples, byte[] publicKey); +``` + +#### f. Query identity information +```json +byte[] GetDDO(byte[] ontId); +``` +Return all the user's information, which is a serialization of a JSON object. + +```json +byte[] GetPublicKeys(byte[] ontId); +``` +Return all the user's public keys. + +#### g. Event push + +IdContract contains three kinds of event messages: +- `Register`: Push the messages related to identity registration. + + | Field | Type | Description | + | :--- | :--- | :--- | + |op| string | message type | + | ontId | byte[] | registered Ont Id | + +- `PublicKey`: Push the messages related to public key operations. + + | Field | Type | Description | + | :--- | :--- | :--- | + |op| string | message type:"add" or "remove" | + | ontId | byte[] | user's Ont Id | + | publicKey | byte[] | public key data | + +- `Attribute`: Push the messages related to attribute operations. + + | Field | Type | Description | + | :--- | :--- | :--- | + |op| string | message type:"add"、"update"、"remove" | + | ontId | byte[] | user's Ont Id | + | attrName | byte[] | attribute name | + + + +## Appendix + +### A. Recovery account address + +The recovery account can implement a variety of access control logic, such as (m,n)-threshold control. A (m,n) threshold control account is managed by n public keys altogether. To use it, you have to gather at least m valid signatures. + +- `(m, n) threshold` control account + + ``` + 0x02 || RIPEMD160(SHA256(n || m || publicKey_1 || ... || publicKey_n)) + ``` + +- `AND` control account + + This is equivalent to (n, n) threshold control account. + +- `OR` control account + + This is equivalent to (1, n) threshold control account. + + diff --git a/prod-doc/en/ontid/framework/spec/archived/ontid-update-1.3.5.md b/prod-doc/en/ontid/framework/spec/archived/ontid-update-1.3.5.md new file mode 100644 index 00000000..636c77f9 --- /dev/null +++ b/prod-doc/en/ontid/framework/spec/archived/ontid-update-1.3.5.md @@ -0,0 +1,252 @@ +## Abstract + +The previous ONT ID design is simple and cannot satisfy some complex requirements.This proposal describes three improvements for ONT ID: controller, recovery and revoking. + + +## Specification + +### Controller + +An ONT ID can be controlled by other ONT ID(s), in the controller mode. Distinguished from the original self-sovereign mode, the controlled ONT ID can be used without binding keys. Meanwhile, the entity does not need to sign the transaction. The controller must provide valid signature instead. The controller can be either an ONT ID or a group of ONT IDs. All the IDs must be in the self-sovereign mode. In the case of group, the threshold control is supported. Following is an example of a (m, n)-threshold group: + +```json +{ + "threshold": m, + "members": [ID1, ID2, ... , IDn] +} +``` + +Furthermore, the group can be recursively defined, i.e. a group member can be another sub-group: + +```json +{ + "threshold": m1, + "members": [ + ID1, + { + "threshold": m2, + "members": [ID2, ...] + }, + ... + ] +} +``` + +The controller can modify the controlled ID's attributes, as well as bind keys for the ID to convert it to the self-sovereign mode. On the contrary, a self-sovereign ID can not be converted to the controller mode. + +### Recovery + +Recovery is used for recovering or resetting the keys for ONT ID, in the case of key missing. This proposal suggests using the group control logic described in the above section to acheive better flexibility. + +Recovery can only modify keys or update the Recovery setting for the ONT ID. Valid signature(s) must be provided in the transaction when operating. + +### Revoking + +In the previous design, ONT ID can not be deleted or revoked explicitly. When an ONT ID is not needed any more, the owner can just delete it and the related keys from his client, while the state remains on chain. + +This proposal adds revoking mechanism to ONT ID. An ONT ID can be revoked by its owner or controller when it is not needed. Revoked ONT ID will be marked as "revoked", and its data, such as keys and attributes, will be deleted. + + + +### Data structure + +* Group: + +A group consists of multiple members with threshold control. A member can be a registered ONT ID or another sub-group. + +``` +Group { + threshold //an integer + members //array of members +} +``` + + +* Signer: + +Signer defines the signer's ONT ID and the index of corresponding public key for checking witness. + +``` +Signer { + id //signer's ONT ID + index //index of the public key +} +``` + + +### Methods + + +#### regIDWithController + +Register a controller mode ONT ID. This method should be called by the controller. + +Arguments: + +| | type | description| +| --- | ------------ | --------------- | +| 0 | byte array | ONT ID to be registered| +| 1 | byte array | the controller| +| 2 | int or byte array | index of public key or serialized Signer array| + +Argument 1 is the controller, whose signature must be contained in the transaction. The controller can be either an ONT ID or a serialized Group structure. The first 8 bytes can be used for discrimination. While argument 2 is correspondingly either a integer indecates the index of public key, or a byte array which is the serialization of a `Signer` array. + +Event:("Register", ONT ID) + +#### revokekID + +Revoke a self-sovereign ONT ID. This method should be called by the ID's owner. + +Arguments: + +| | type | description| +| -- | ------------ | --------------- | +| 0 | byte array | ONT ID| +|1 | int | index of the owner's public key| + +Argument 1 specifies the public key for checking witness + +Event:("Revoke", ONT ID) + + +#### revokeIDByController + +Controller revoke the controlled ONT ID. This method should be called by the controller. + +Arguments: + +| | type | description| +|---|------------|---------------| +| 0 | byte array | ONT ID | +| 1 | int or byte array | index of public key or serialized Signer array| + +Event:("Revoke", ONT ID) + +#### removeController + +Remove the controller to convert the ONT ID to self-sovereign mode. This method can only be called by the owner, i.e. the ONT ID must have bound a key. + +Arguments: + +| | type | description| +|---|------------|---------------| +| 0 | byte array | ONT ID| +| 1 | int | index of the owner's public key| + +The owner's signature must be included in the transaction, while the argument 1 specifies the public key for checking witness. + +Event:("RemoveController", ONT ID) + + +#### addKeyByController + +Controller bind a public key to the controlled ONT ID. + +Arguments: + +| | type | description| +|---|------------|---------------| +| 0 | byte array | ONT ID| +| 1 | byte array | public key to be added| +| 2 | int or byte array | index of public key or serialized Signer array| + + +Event: ("PublicKey", "add by controller", ONT ID, new public key, index of the new public key) + + +#### addAttributesByController + +Controller add attributes to the controlled ONT ID + +Arguments: + +| | type | description| +|---|------------|---------------| +| 0 | byte array | ONT ID| +| 1 | attribute array | array of attributes to be added| +| 2 | int or byte array | index of public key or serialized Signer array| + + +Event:("Attribute", "add by controller", ONT ID, key list of added attributes) + + +#### removeAttributeByController + +Controller removes a specific attribute of the controlled ONT ID. + +Arguments: + +| | type | description| +|---|------------|---------------| +| 0 | byte array | ONT ID| +| 1 | byte array | key of attribute to be removed| +| 2 | int or byte array | index of public key or serialized Signer array| + +Event:("Attribute", "remove by controller", ONT ID, key of removed attribute) + +#### VerifyController + +Verify whether the transaction is signed by controller. + +Argumetns: + +| | type | description| +|---|------------|---------------| +| 0 | byte array | ONT ID| +| 1 | int or byte array | index of public key or serialized Signer array| + +Return:True/False + +#### addRecovery + +Set the recovery, which is defined by a Group structure. This method should be called by the owner. + +Arguments: + +| | type | description| +|---|------------|---------------| +| 0 | byte array | ONT ID| +| 1 | byte array | serialized the recovery group| +| 2 | int | index of the owner's public key| + +Event:("Recovery", "add", ONT ID, recovery in JSON format) + +#### changeRecovery + +Change the recovery to a new group. This method should be called by the original recovery group. + +Arguments: + +| | type | description| +|---|------------|---------------| +| 0 | byte array | ONT ID| +| 1 | byte array | serialized new recovery group| +| 2 | byte array | serialized Signer array| + +#### addKeyByRecovery + +Recovery group bind a public key to the ONT ID. + +Arguments: + +| | type | description| +|---|------------|---------------| +| 0 | byte array | ONT ID| +| 1 | byte array | new public key| +| 2 | byte array | serialized Signer array| + +Event:("PublicKey", "add by recovery", ONT ID, new public key, index of new public key) + +#### removeKeyByRecovery + +Recovery group remove a bound public key. + +Arguments: + +| | type | description| +|---|------------|---------------| +| 0 | byte array | ONT ID| +| 1 | int | index of the public key to be removed| +| 2 | byte array | serialized Signer array| + +Event:("PublicKey", "remove by recovery", ONT ID, removed public key, index of removed public key) \ No newline at end of file diff --git a/prod-doc/en/ontid/framework/spec/claim.md b/prod-doc/en/ontid/framework/spec/claim.md new file mode 100644 index 00000000..e0bba904 --- /dev/null +++ b/prod-doc/en/ontid/framework/spec/claim.md @@ -0,0 +1,380 @@ +# Verifiable Claim Protocol + +Version 0.7.1 + +The entire workflow of the verifiable claim is shown in the figure below. It contains three major parts: + +- Request claim; +- Issue claim; +- Verify claim. + +![img-claim-system](../../res/img-claim-system.png) + +## 1. Issue +The issuance process of a verifiable claim involves two roles, the issuer and the recipient. + +In general, a verifiable claim should include the contents of the claim, digital signatures, and blockchain attest records. More specifically, + +- Claim ID: Uniquely identifies the claim; + +- Claim content: Specific information such as a degree certificate; + +- Claim metadata + - Created time: The time the claim was created; + - Issuer: Ont ID of the issuer; + - Recipient:Ont ID of the recipient; + - Expiration time: The time when the claim expires automatically; + - Revocation mechanism: Use the *revocation list* or record the revocation information directly in *attest contract*; + +- Blockchain proof + +- Signature + - The Public key ID of a issuer + - Signature value + +See [**Appendix A**](#a-verifiable-claim-template) section for an example of verifiable claim that shows an empolyee's salary certificate issued by a company. + +### 1.1 Verifiable claim issuance process + +To summarize briefly, there are three major steps in issuing a claim: + +1. The recipient initiates an application and provides data, and the issuer constructs a verifiable claim; +2. The issuer keeps the attest in the attest contract, that is, set the status of the verifiable claim as *attested*; +3. Transmit the verifiable claim to the Recipient in a secure method, that is, the verifiable claim is encrypted by the recipient's public key. + +The above steps correspond to steps 1 - 4 in the workflow of the verifiable claim. + +### 1.2 The format of a verifiable claim + +We will use an extension of the [JSON Web Token](https://tools.ietf.org/html/rfc7519) format to represent a verifiable claim which is transferred between issuer and recipient. + +Basic structure of the token consists of three parts: Header, Payload and Signature. The standard JWT attributes are reused as much as possible and in special cases custom attributes are defined. + +We augment the JWT format by appending the blockchain proof in the end, a typical verifiable claim is organized as +` header . payload . signature . blockchain_proof`. +> Note: blockchain_proof is optional. In some cases, Claim not include blockchain_proof. + +#### Header +The header part defines the type of the format, the signature scheme employed and id of the public key used to verify the signature. +```json +{ + "alg": "ES256", + "typ": "JWT-X", + "kid": "did:ont:TRAtosUZHNSiLhzBdHacyxMX4Bg3cjWy3r#keys-1" +} +``` +- **alg** attribute specifies the signature scheme to use. A list of supported values can be found [here](##_Supported_signature_schemes). +- **typ** attribute can take one of the two values + - JWT: This corresponds to the case that blockchain proof is not contained in the claim. + - JWT-X: This corresponds to the case that blockchain proof is a part of the claim. +- **kid** attribute refers to the public key used for signature verification. It has the form `#keys-` as defined in ONT ID specification. + +#### Payload + +The claim id, claim content and claim metadata are encoded as a JSON object that is used as the payload part. And will use some of registered claim names specified in the JWT spec, namely `jti`, `iss`, `sub`, `iat`, `exp`. +``` +{ + "ver": "0.7.0", + "iss": "did:ont:TRAtosUZHNSiLhzBdHacyxMX4Bg3cjWy3r", + "sub": "did:ont:SI59Js0zpNSiPOzBdB5cyxu80BO3cjGT70", + "iat": 1525465044, + "exp": 1530735444, + "jti":"4d9546fdf2eb94a364208fa65a9996b03ba0ca4ab2f56d106dac92e891b6f7fc", + "@context":"https://example.com/template/v1", + "clm":{ + "Name": "Bob Dylan", + "Age": "22" + }, + "clm-rev":{ + "typ": "AttestContract", + "addr": "8055b362904715fd84536e754868f4c8d27ca3f6" + } +} +``` + +- **ver** attribute specifies the version of the claim spec it follows. +- **iss** attribute refers to the ONT ID of the issuer. +- **sub** attribute refers to the ONT ID of the recipient. +- **iat** attribute marks the time the claim was created and has the format of unix timestamp. +- **exp** attribute marks the expiration time of the claim and has the format of unix timestamp. +- **jti** attribute specifies the unique identifier of the verifiable claim. +- **@context** attribute specifies the uri of claim content definition document which defines the meaning of each field and the type of the value; +- **clm** attribute is an object which contains the claim content. +- **clm-rev** attribute is an object which defines the revocation mechanism the claim use. A list of supported mechanism is listed in the [Appendix C](#C-Revocation). + + +To issue a claim, first construct the JSON object that represents the claim id, content and metadata, then use the standard JSON serialization method to serialize it. Finally, use one of the issuer's private keys to sign the binary data of the header and payload. For example, after serialization, the above payload will look like +``` +{"ver":"0.7.0","iss":"did:ont:TRAtosUZHNSiLhzBdHacyxMX4Bg3cjWy3r","sub":"did:ont:SI59Js0zpNSiPOzBdB5cyxu80BO3cjGT70","iat":1525465044,"exp":1530735444,"jti":"4d9546fdf2eb94a364208fa65a9996b03ba0ca4ab2f56d106dac92e891b6f7fc","@context":"https://example.com/template/v1","clm":{"Name":"Bob Dylan","Age":"22"},"clm-rev":{"Type":"Contract","Addr":"8055b362904715fd84536e754868f4c8d27ca3f6"}} +``` + +#### Signature + +After constructing Header and Payload of the request, Signature part is computed according to JWS standard. Full description can be found in [RFC 7515 Section 5.1](https://tools.ietf.org/html/rfc7515#section-5.1). The simplified version is as follows: + +* Compute the signing input as serialization of Header and Payload according to JWS specification. +``` +sig := sign(Base64URL(header) || . || Base64URL(payload)) +``` + +* Compute the JWS Signature in the manner defined for the particular signature scheme being used over the signing input. + +* Encode the signature +``` +signature := Base64URL(sig). +``` + + +#### Blockchain proof + +```json +{ + "Type":"MerkleProof", + "TxnHash":"c89e76ee58ae6ad99cfab829d3bf5bd7e5b9af3e5b38713c9d76ef2dcba2c8e0", + "ContractAddr": "8055b362904715fd84536e754868f4c8d27ca3f6", + "BlockHeight":10, + "MerkleRoot":"bfc2ac895685fbb01e22c61462f15f2a6e3544835731a43ae0cba82255a9f904", + "Nodes":[{ + "Direction":"Right", + "TargetHash":"2fa49b6440104c2de900699d31506845d244cc0c8c36a2fffb019ee7c0c6e2f6" + }, { + "Direction":"Left", + "TargetHash":"fc4990f9758a310e054d166da842dab1ecd15ad9f8f0122ec71946f20ae964a4" + }] +} +``` +- **Type** attribute is always "MerkleProof". +- **TxnHash** attribute refers to the hash of the transaction that attests the claim id in the attest contract. +- **ContractAddr** attribute refers to the address of the attest contract. +- **BlockHeight** attribute refers to the height of block which contains the attest transaction. +- **MerkleRoot** attribute refers to the root of Merkle tree when the tree size equals to BlockHeight. +- **Nodes** attribute refers to the inclusion proof of block in the Merkle tree. + +Encode the MerkleProof as below: +``` +BASE64URL(MerkleProof) +``` + +Now a complete verifiable claim is created: +``` +BASE64URL(Header) || '.' || BASE64URL(Payload) || '.' || BASE64URL(Signature) '.' || BASE64URL(MerkleProof) +``` + +### 1.3 Attest contract + +The attest contract of verifiable claim provides the attest service and the record availability information, that is, whether it has been revoked. + +The interfaces provided are mainly + +- Commit attest + + ``` + bool Commit(byte[] claimId, byte[] committerOntId, byte[] ownerOntId); + ``` + + In the attest contract, the unique identifier of a claim is the claim ID. It is the first parameter; The committerOntId is the ONT identity of the attester.The ownerOntId is the ONT identity of the owner. + + This function will return `true` if and only if the claim is not attested, and the function is called by the committer; Otherwise, it will return `false`. + + After the attestation is done, the status of the claim will be *attested*. + +- Revoke claim + ``` + bool Revoke(byte[] claimId, byte[] revokerOntId); + ``` + This function will return true if and only if the claim is *attested*, and the revokerOntId is equal to the attester's ONT identity; Otherwise, it will return false. + +- Attest inquiry interface + ``` + byte[] GetStatus(byte[] claimId); + ``` + Returns the status of the claim that contains two parts of information: + - Status: "Not attested", "Attested", "Attest has been revoked"; + - ONT ID of the attester. + +## 2. Verification + +To summarize briefly, there are three major steps in verifying a claim, corresponding to the steps 5 - 6 in the workflow. + +- Check whether it is in the blockchain; +- Verify the signature and verify whether it has expired; +- Check whether it has been revoked (optional). + + +### 2.1 Blockchain existence verification + +To summarize briefly,we need to verify whether a verifiable claim is in the blockchain. In the case that the entire blockchain is not synchronized, we can use the Merkle proof to verify the transaction. + +Merkle proof is an array, and each array item contains two elements (direction, hash): +- `direction`: represents which branch of the Merkle tree the array item is in. There are two possible values: left, right; +- `hash`: represents the hash value of the data item. + +The algorithm that verifies the Merkle proof (described below) + +1. Check if transaction is included in block indexed by `proof.BlockHeight`. If not, return `false`. +2. p <- GetBlockHash(`proof.BlockHeight`). +3. For each element in `proof.Nodes`, update p as + - if e.Direction == "Left", p <- H(e.TargetHash, p); + - else, p <- H(p, e.TargetHash). +4. Return `true` if p equals to `proof.MerkleRoot`. Otherwise, return false. + +In addition, it is also necessary to verify the status of the claim attest, that is, to call the inquiry interface `GetStatus()` of the attest contract with the address `proof.ContractAddr`. If the status is "not attested," an error would be returned. + + +### 2.2 Signature verification and expiration time + +When verifying the signature, you need to use the public key ID to get the public key value and the current status of the public key, and then call the corresponding verification algorithm to verify. + +The format of public key ID is ```#keys-```,which calls the interface of ONT ID smart contract that inquiry the status of the public key `GetPublicKeyStatus(byte[] ontId, byte[] pkId)`, it returns + +- publicKey: Public key value (hexstring); +- status: There are two possible values: `InUse`, `Revoked`. + +There are three results of signature verification: + - The signature is invalid; + - The signature is valid and the public key is in the status of Revoked; + - Signature is valid. + + +Verification of the expiration time: Verify whether the timeout period has expired. + + +### 2.3 Revoke verification + +Currently, there are two revocation modes, revocation list and revocation inquiry interface. + +Using the revocation inquiry interface as an example, if the revocation information is placed in the attest contract, when calling the inquiry interface `GetStatus` of attest contract, revocation verification will return "success" if and only if the returned status field is "attested". It will return "fail" if the status field is "attest has been revoked." + +The revocation list mainly includes the unique identifier of the revoked verifiable claim and the revocation time. + +## Supported signature schemes + +* ES224 - ECDSA with SHA224, +* ES256 - ECDSA with SHA256, +* ES384 - ECDSA with SHA384, +* ES512 - ECDSA with SHA512, +* ES3-224 - ECDSA with SHA3 224 +* ES3-256 - ECDSA with SHA3 256 +* ES3-384 - ECDSA with SHA3 384 +* ES3-512 - ECDSA with SHA3 512 +* ER160 - ECDSA with RIPEMD160 +* SM - SM2 with SM3 +* EDS512 - EDDSA with SHA256 + +## Appendix +### A. Verifiable claim template + +#### Header +```json +{ + "alg": "ONT-ES256", + "typ": "JWT-X", + "kid": "did:ont:TRAtosUZHNSiLhzBdHacyxMX4Bg3cjWy3r#keys-1" +} +``` +#### Payload +```json +{ + "ver": "0.7.0", + "iss": "did:ont:TRAtosUZHNSiLhzBdHacyxMX4Bg3cjWy3r", + "sub": "did:ont:SI59Js0zpNSiPOzBdB5cyxu80BO3cjGT70", + "iat": 1525465044, + "exp": 1530735444, + "jti":"4d9546fdf2eb94a364208fa65a9996b03ba0ca4ab2f56d106dac92e891b6f7fc", + "@context":"https://example.com/template/v1", + "clm":{ + "IdNumber": "510806199002122991", + "Name": "Bob Dylan", + "JobTitle": "SoftwareEngineer", + "MonthlySalary": 3000.00, + "HireDate": "2017-03-20" + }, + "clm-rev":{ + "typ": "AttestContract", + "addr": "8055b362904715fd84536e754868f4c8d27ca3f6" + } +} +``` +#### Signature + +``` +// TODO +``` + +#### Blockchain proof +``` +{ + "Type":"MerkleProof", + "TxnHash":"c89e76ee58ae6ad99cfab829d3bf5bd7e5b9af3e5b38713c9d76ef2dcba2c8e0", + "ContractAddr": "8055b362904715fd84536e754868f4c8d27ca3f6", + "BlockHeight":10, + "MerkleRoot":"bfc2ac895685fbb01e22c61462f15f2a6e3544835731a43ae0cba82255a9f904", + "Nodes":[{ + "Direction":"Right", + "TargetHash":"2fa49b6440104c2de900699d31506845d244cc0c8c36a2fffb019ee7c0c6e2f6" + }, { + "Direction":"Left", + "TargetHash":"fc4990f9758a310e054d166da842dab1ecd15ad9f8f0122ec71946f20ae964a4" + }] + } +} +``` + + +### B. Content format definition template +A major part of a verifiable claim is the content of the claim, and the definition of the claim content format is in another JSON file, which defines the meaning of each attribute and the type of the corresponding attribute value. + +The format definition of Content in Appendix A is given below. +```json +{ + "Type": "claim:employment_authentication", + "IdNumber": { + "Doc": "Unique number of certificate", + "ValType": "String" + }, + "Name": { + "Doc": "The full name of certificate owner", + "ValType": "String" + }, + "JobTitle": { + "Doc": "The job title of certificate owner", + "ValType": "String" + }, + "MonthlySalary": { + "Doc": "The monthly salary of certificate owner", + "ValType": "double" + }, + "HireDate": { + "Doc": "Hiring date", + "ValType": "Time" + } +} +``` + +### C. Revocation +Two revocation mechanisms can be used. +- Revocation list + The list contains the claims revoked by issuer which specifies the id of revoked claim, the time of revocation. To use this mechanism, the claim must contain the url of the list, and the type must be `RevocationList`. + + ```json + "clm-rev": { + "type": "RevocationList", + "url": "https://example.com/rev/1234" + } + ``` +``` + +- Revocation with attest contract + The revocation information is recorded in the attest contract via the `Revoke` function. To find out if a claim has been revoked, the standard approach is to invoke the `GetStatus` function. Please refer to [section 1.3](claim_spec.md#1.3-attest-contract) for more information. + + ```json + "clm-rev": { + "type": "AttestContract", + "addr": "8055b362904715fd84536e754868f4c8d27ca3f6" + } +``` + +### [More claim template examples](./template-definition.md) + + + diff --git a/prod-doc/en/ontid/framework/spec/ontid.md b/prod-doc/en/ontid/framework/spec/ontid.md new file mode 100644 index 00000000..976540d0 --- /dev/null +++ b/prod-doc/en/ontid/framework/spec/ontid.md @@ -0,0 +1,459 @@ +# ONT ID规范 + +> 版本:1.3.5 +> +> This version is based on [`ONT ID 0.7.0`](./archived/ontid-0.7.0.md). Brief update is referenced [`here`](./archived/ontid-update-1.3.5.md). + +ONT ID是本体提供的一套身份标识系统,具有去中心化、自主管理、隐私保护、安全易用等特点。 + +## 生成ONT ID + +ONT ID是一种URI,由每个实体自己生成成,生成算法需要保证碰撞概率非常低。同时在向本体注册时,共识节点会检查该ID是否已被注册。 + +一个合法的ONT ID生成过程如下: + +1. 生成32字节的随机nonce,计算h = Hash160(nonce),data = VER || h; +2. 计算出data的一个4字节校验,即checksum = SHA256(SHA256(data))[0:4]; +3. 令idString = base58(data || checksum); +4. 将"did:ont:"与idString拼接,即ID = "did:ont:" || idString; +5. 输出ID。 + +上述过程中,|| 表示连接前后两个字节串,VER 是1个字节的标签位。 + + +## 管理权 + +ONT ID有两种管理方式:自主管理和代理控制 + +### 自主管理 + +自主管理即ONT ID的所有者自己控制ID,进行注册、修改和注销等操作。在注册到链上时,ONT ID需要绑定所有者的公钥,而所有者自己持有对应的私钥。 + +一个ONT ID可以绑定多个公钥。各公钥按照绑定顺序依次从1开始编号。绑定数量的上限为2^32-1。绑定的公钥可以被废除。已废除的公钥不可被再次启用,且仍占有一个编号。 + +当使用ID时,所有者使用私钥进行签名,并给出对应公钥的编号。验证端根据编号查找到公钥,验证签名。 + +### 代理控制 + +一个ONT ID可以被其他ONT ID代理控制。这种情况下被控制的ONT ID可以不绑定公钥。控制者拥有被控制ID的注册、修改和注销权限,但不能操作恢复人。在操作时被控制ID时,控制者需提供有效的数字签名。 + +控制者可以是一个ONT ID,也可以是若干ONT ID组成的管理组。管理组能够设置复杂的门限控制逻辑,以满足不同的安全需求。如设置n个ONT ID,最少m个ID共同签名才能进行操作(m <= n),以如下JSON形式表示: + +```json +{ + "threshold": m, + "members": [ID1, ID2, ... , IDn] +} +``` + +进一步的,可以定义递归组合的控制逻辑,即组成员可以是ONT ID,也可以是嵌套的管理组,如下所示: + + +```json +{ + "threshold": m1, + "members": [ + ID1, + { + "threshold": m2, + "members": [ID2, ...] + }, + ... + ] +} +``` + +控制者的ONT ID必须是自主管理的。 + +控制者可以为被控制的ID绑定公钥,将其转换为自主管理模式。但是自主管理的ID无法转换成代理控制的模式。 + +## 恢复人 + +自主管理的ONT ID允许所有者设置其他ONT ID为恢复人。在所有者意外丢失密钥的情况下,恢复人可以帮助其重置密钥。 + +恢复人使用组管理的方式,规则同代理控制的管理组相同。 + +恢复人能够为ID添加、废除公钥,以及更新恢复人设置。操作时需提供符合控制逻辑的有效的数字签名。 + +## 附加属性 + +ONT ID的所有者或代理控制者可以为其添加、修改或删除附加属性。属性以健值对的方式保存。属性的具体内容不在本规范的范畴内,由应用层自行定义。 + + +## 注销ONT ID + +ONT ID的所有者或代理控制人可以将其注销。执行注销操作后,该ONT ID关联的密钥、控制人、属性及恢复人等一切数据将被删除,仅保留ID本身。已注销的ONT ID无法继续使用,也不能再次注册启用。 + + +## 合约实现 + +ONT ID的管理功能由一个native合约实现。合约地址是0x0000000000000000000000000000000000000003。 + +### 接口 + +#### 数据结构 + +* 管理组: + +``` +Group { + threshold //门限,整数 + members //成员数组 +} +``` + +其中成员数组中的每个成员是一个字节串,根据前8个字节是否为"did:ont:"判断是一个ONT ID或一个嵌套的Group结构体。若是ONT ID,则必须是已注册的自主管理的ONT ID。 + +* 签名人: + +``` +Signer { + id //签名人ONT ID + index //验签公钥编号 +} +``` + + +* 属性: + +``` +Attribute { + key //属性的键,字节串 + type //属性的类型,字节串 + value //属性的值,字节串 +} +``` + + +#### 注册自主管理的ONT ID + +regIDWithPublicKey + +参数: + +编号 | 类型 | 说明 +----|---------|------- + 0 | 字节串 | 注册的ONT ID + 1 | 字节串 | 所有者的公钥 + +调用此接口需提供参数中的公钥对应私钥的签名。注册完成后此公钥即与ONT ID绑定。 + +触发事件:("Register", ONT ID) + + +#### 注册代理控制的ONT ID + +regIDWithController + +参数: + +编号 | 类型 | 说明 +----|---------|------- + 0 | 字节串 | 注册的ONT ID + 1 | 字节串 | 代理控制人 + 2 | 整数/字节串 | 签名公钥编号/序列化的签名人数组 + +参数1的字节串即可以是一个ONT ID,也可以是一个序列化的管理组结构体,根据前8个字节加以区分。 + +调用此接口需要提供代理控制人的有效签名。代理控制人若是一个ONT ID,则参数2为验签公钥的编号;若是一个管理组,则参数2是签名人列表。 + +触发事件:("Register", ONT ID) + + +#### 废弃自主管理的ONT ID + +revokeID + +参数: + +编号 | 类型 | 说明 +----|---------|------- + 0 | 字节串 | 注册的ONT ID + 1 | 整数 | 所有者的验签公钥编号 + +触发事件:("Revoke", ONT ID) + + +#### 废弃代理控制的ONT ID + +revokeIDByController + +参数: + +编号 | 类型 | 说明 +----|---------|------- + 0 | 字节串 | 注册的ONT ID + 1 | 整数/字节串 | 签名公钥编号/序列化的签名人数组 + +触发事件:("Revoke", ONT ID) + + +#### 撤销代理控制人 + +removeController + +参数: + +编号 | 类型 | 说明 +----|---------|------- + 0 | 字节串 | ONT ID + 1 | 整数 | 所有者的验签公钥编号 + +调用此接口需提供所有者的签名,并通过参数1指明验签公钥的编号。 + +触发事件:("RemoveController", ONT ID) + + +#### 设置恢复人 + +addRecovery + +参数: + +编号 | 类型 | 说明 +----|---------|------- + 0 | 字节串 | ONT ID + 1 | 字节串 | 恢复人,为序列化的管理人数组 + 2 | 整数 | 验签公钥 + +调用此接口需提供所有者的签名,并通过参数2指明验签公钥的编号。 + +触发事件:("Recovery", "add", ONT ID, JSON形式表示的恢复人) + + +#### 更新恢复人 + +changeRecovery + +参数: + +编号 | 类型 | 说明 +----|---------|------- + 0 | 字节串 | ONT ID + 1 | 字节串 | 新恢复人,为序列化的管理人数组 + 2 | 字节串 | 签名人列表,为序列化的签名人数组 + +调用此接口需提供原恢复人的有效签名。 + +触发事件:("Recovery", "change", ONT ID, JSON形式表示的新恢复人) + + +#### 所有者添加公钥 + +addKey + +参数: + +编号 | 类型 | 说明 +----|---------|------- + 0 | 字节串 | ONT ID + 1 | 字节串 | 添加的新公钥 + 2 | 字节串 | 验签公钥 + +调用此接口需提供所有者的签名,并通过参数2给出验签公钥。验签公钥必须已绑定到该ID。 + +触发事件:("PublicKey", "add", ONT ID, 新公钥, 新公钥编号) + + +#### 所有者废除公钥 + +removeKey + +参数: + +编号 | 类型 | 说明 +----|---------|------- + 0 | 字节串 | ONT ID + 1 | 字节串 | 废除的公钥 + 2 | 字节串 | 验签公钥 + +调用此接口需提供所有者的签名,并通过参数2给出验签公钥。验签公钥必须已绑定到该ID。 + +触发事件:("PublicKey", "remove", ONT ID, 废除的公钥, 废除公钥的编号) + +#### 代理控制人添加公钥 + +addKeyByController + +参数: + +编号 | 类型 | 说明 +----|---------|------- + 0 | 字节串 | ONT ID + 1 | 字节串 | 添加的新公钥 + 2 | 整数/字节串 | 签名公钥编号/序列化的签名人数组 + +调用此接口需要提供代理控制人的有效签名。代理控制人若是一个ONT ID,则参数2为验签公钥的编号;若是一个管理组,则参数2是签名人列表。 + +触发事件: ("PublicKey", "add by controller", ONT ID, 新公钥, 新公钥编号) + + +#### 恢复人添加公钥 + +addKeyByRecovery + +参数: + +编号 | 类型 | 说明 +----|---------|------- + 0 | 字节串 | ONT ID + 1 | 字节串 | 添加的新公钥 + 2 | 字节串 | 序列化的签名人数组 + +调用此接口需提供恢复人的有效签名。 + +触发事件:("PublicKey", "add by recovery", ONT ID, 新公钥, 新公钥编号) + + +#### 恢复人废除公钥 + +removeKeyByRecovery + +参数: + +编号 | 类型 | 说明 +----|---------|------- + 0 | 字节串 | ONT ID + 1 | 整数 | 废除公钥的编号 + 2 | 字节串 | 序列化的签名人数组 + +调用此接口需提供恢复人的有效签名。 + +触发事件:("PublicKey", "remove by recovery", ONT ID, 废除的公钥, 废除公钥的编号) + + +#### 注册ONT ID同时添加属性 + +regIDWithAttributes + +编号 | 类型 | 说明 +----|------------|------- + 0 | 字节串 | ONT ID + 1 | 字节串 | 所有者的公钥 + 2 | 属性结构体数组 | 属性数组 + +调用此接口需提供所有者的签名,并通过参数1给出所有者公钥。注册完成后公钥与该ID绑定,且参数2给出的属性被添加到该ID中。 + +触发事件:("Register", ONT ID) + + +#### 所有者添加属性 + +addAttributes + +参数: + +编号 | 类型 | 说明 +----|------------|------- + 0 | 字节串 | ONT ID + 1 | 属性结构体数组 | 属性数组 + 2 | 字节串 | 验签公钥 + + +调用此接口需提供所有者的签名,并通过参数2给出验签公钥。验签公钥必须已绑定到该ID。 + +触发事件:("Attribute", "add", ONT ID, 添加的属性键列表) + + +#### 所有者删除属性 + +removeAttribute + +参数: + +编号 | 类型 | 说明 +----|---------|------- + 0 | 字节串 | ONT ID + 1 | 字节串 | 删除属性的键 + 2 | 字节串 | 验签公钥 + +调用此接口需提供所有者的签名,并通过参数2给出验签公钥。验签公钥必须已绑定到该ID。 + +触发事件:("Attribute", "remove", ONT ID, 删除属性的键) + + +#### 代理控制人添加属性 + +addAttributesByController + +参数: + +编号 | 类型 | 说明 +----|------------|------- + 0 | 字节串 | ONT ID + 1 | 属性结构体数组 | 属性数组 + 2 | 整数/字节串 | 签名公钥编号/序列化的签名人数组 + +调用此接口需要提供代理控制人的有效签名。代理控制人若是一个ONT ID,则参数2为验签公钥的编号;若是一个管理组,则参数2是签名人列表。 + +触发事件:("Attribute", "add by controller", ONT ID, 添加的属性键列表) + + +#### 代理控制人删除属性 + +removeAttributeByController + +参数: + +编号 | 类型 | 说明 +----|---------|------- + 0 | 字节串 | ONT ID + 1 | 字节串 | 删除属性的键 + 2 | 整数/字节串 | 签名公钥编号/序列化的签名人数组 + +调用此接口需要提供代理控制人的有效签名。代理控制人若是一个ONT ID,则参数2为验签公钥的编号;若是一个管理组,则参数2是签名人列表。 + +触发事件:("Attribute", "remove by controller", ONT ID, 删除属性的键) + + +#### 验证签名 + +VerifySignature + +参数: + +编号 | 类型 | 说明 +----|---------|------- + 0 | 字节串 | ONT ID + 1 | 整数 | 公钥编号 + +接口调用的交易需包含被验证的签名,且通过参数1指明验证公钥的编号。 + +返回:True/False + +#### 验证控制人签名 + +VerifyController + +参数: + +编号 | 类型 | 说明 +----|---------|------- + 0 | 字节串 | ONT ID + 1 | 整数/签名人结构体数组 | 签名公钥编号/签名人列表 + + +若控制人是一个ONT ID,则参数1数组中仅包含其一个元素;若是一个管理组,则需要列出所有参与的签名人。 + +调用接口的交易需包含所有被验证的签名。代理控制人若是一个ONT ID,则参数2为验签公钥的编号;若是一个管理组,则参数2是签名人列表。 + +返回:True/False + +### 存储 + +所有数据均存储在此合约空间内,即存储的键添加合约地址作为前缀。方便起见,以下列出的存储键均省略前缀。 + +符号说明: + +* `+` 表示连接前后字节串 +* `ID` 表示ONT ID + + +存储内容 | 键 | 值 | 备注 +--------|----------|-------------|----- +注册标记 | `ID` | `0x01` | 作为ONT ID的存在标记 +公钥 | `ID+0x01` | 公钥列表 | 记录ONT ID绑定的公钥,包括已废弃的公钥 +属性 | `ID+0x02` | 属性列表 | 以链表形式存储ONT ID的属性,便于删除操作 +恢复人 | `ID+0x03` | 管理组结构体 | 存储的结构体与接口传入的相同 +控制人 | `ID+0x04` | ONT ID或管理组结构体 | +版本号 | `0x00` | `0x01` | 标示当前存储版本,用于非兼容处理,目前取值为1 diff --git a/prod-doc/en/ontid/framework/trust-anchor/README.md b/prod-doc/en/ontid/framework/trust-anchor/README.md new file mode 100644 index 00000000..55423178 --- /dev/null +++ b/prod-doc/en/ontid/framework/trust-anchor/README.md @@ -0,0 +1,25 @@ +# Trust Anchor + +Trust anchor refers to the partner that provides authentication services on the Ontology ecosystem. It may be government agencies, universities, banks, third-party authentication service agencies (e.g., CA agencies), biometric technology companies, etc. Trust anchors provides standardized and credible claims for entities for their qualification in certain areas. Trust anchors provides verification service for the claims. The claims will be managed by the entities on their own. + +## 1. Major Terms of Service + +* Trust Anchor is not allowed to store any user data without related qualifications or user permission. +* Trust Anchor should announce on the official website that it is the provider of Ontology identification and verification service and specify the registered ONT ID. +* Trust Anchor should guarantee the accuracy and authenticity of its user information. The Ontology team is not responsible for the authenticity of the user information submitted by the Trust Anchor. The Ontology team does not take responsibilities for the invalidity of legal documents due to false or incomplete user information. The relevant responsibility should be taken by the Trust Anchor itself to its users or third parties. +* Trust Anchor should have the capability of identification and authentication management. The principle requirements are as follows. The target requirements can be specified by Party A according to the specific service requirements. +* Have the hardware and the network facilities for identification and authentication; +* Have safety protection standards; +* Deploy the software of identification and authentication management provided by Ontology open source standard code; +* Based on the management process of identification and authentication, the Trust Anchor should provide at least the following services of verifiable claim: + 1. the issuance of a verifiable claim; + 2. the revocation of a verifiable claim; 3. Providing open services of verifiable claim in official domain URL. + +## 2. Become a `claim provider` + +[>>> The verifiable claim specification](../spec/claim.md) + +- Use [RESTful api](./restful-api.md) to provide claims for your end users. +- Create a [new trust anchor](./deployment.md) to provide claims for your end users. + - Use [`Ontology general trust anchor`](./saas-tenant.md) (SaaS) to provide your own credentials for your customers + diff --git a/prod-doc/en/ontid/framework/trust-anchor/claimtemplate/cfca-realname-certification.md b/prod-doc/en/ontid/framework/trust-anchor/claimtemplate/cfca-realname-certification.md new file mode 100755 index 00000000..a167c819 --- /dev/null +++ b/prod-doc/en/ontid/framework/trust-anchor/claimtemplate/cfca-realname-certification.md @@ -0,0 +1,76 @@ + +## CFCA实名认证可信声明模板 + + +### header: + +```json +{ + "alg": "ES256", + "typ": "JWT-X", + "kid": "did:ont:TRAtosUZHNSiLhzBdHacyxMX4Bg3cjWy3r#keys-1" +} +``` + +### payload: + +```json +{ + "ver": "0.7.0", + "iss": "did:ont:TRAtosUZHNSiLhzBdHacyxMX4Bg3cjWy3r", + "sub": "did:ont:SI59Js0zpNSiPOzBdB5cyxu80BO3cjGT70", + "iat": 1525465044, + "exp": 1530735444, + "jti":"4d9546fdf2eb94a364208fa65a9996b03ba0ca4ab2f56d106dac92e891b6f7fc", +    "@context":"claim:cfca_authentication", + "clm":{ + "身份证号": "510808088991762615", + "姓名": "zz", + "IssuerName":"CFCA" + }, + "clm-rev":{ + "typ": "AttestContract", + "addr": "8055b362904715fd84536e754868f4c8d27ca3f6" + } +} +``` + + +可信声明具体内容clm对应字段说明: + +| Field | Type | Description | +| :--------------: | :--------:| :------: | +|   身份证号|   String| 身份证号 | +| 姓名| String| 姓名 | +| IssuerName| String| 签发机构名称 | + + +### signature + +``` +"addadasdadadadadadadad" +``` + +### blockchain_proof + +``` +{ + "Type":"MerkleProof", + "TxnHash":"c89e76ee58ae6ad99cfab829d3bf5bd7e5b9af3e5b38713c9d76ef2dcba2c8e0", + "ContractAddr": "8055b362904715fd84536e754868f4c8d27ca3f6", + "BlockHeight":10, + "MerkleRoot":"bfc2ac895685fbb01e22c61462f15f2a6e3544835731a43ae0cba82255a9f904", + "Nodes":[{ + "Direction":"Right", + "TargetHash":"2fa49b6440104c2de900699d31506845d244cc0c8c36a2fffb019ee7c0c6e2f6" + }, { + "Direction":"Left", + "TargetHash":"fc4990f9758a310e054d166da842dab1ecd15ad9f8f0122ec71946f20ae964a4" + }] +} +``` + + + + + diff --git a/prod-doc/en/ontid/framework/trust-anchor/claimtemplate/email_mobile_claim.md b/prod-doc/en/ontid/framework/trust-anchor/claimtemplate/email_mobile_claim.md new file mode 100755 index 00000000..b261e915 --- /dev/null +++ b/prod-doc/en/ontid/framework/trust-anchor/claimtemplate/email_mobile_claim.md @@ -0,0 +1,146 @@ + +## 邮箱认证可信声明模板 + + +### header: + +```json +{ + "alg": "ES256", + "typ": "JWT-X", + "kid": "did:ont:TRAtosUZHNSiLhzBdHacyxMX4Bg3cjWy3r#keys-1" +} +``` + +### payload: + +```json +{ + "ver": "0.7.0", + "iss": "did:ont:TRAtosUZHNSiLhzBdHacyxMX4Bg3cjWy3r", + "sub": "did:ont:SI59Js0zpNSiPOzBdB5cyxu80BO3cjGT70", + "iat": 1525465044, + "exp": 1530735444, + "jti":"4d9546fdf2eb94a364208fa65a9996b03ba0ca4ab2f56d106dac92e891b6f7fc", + "@context":"claim:email_authentication", + "clm":{ + "Email": "510808088991762615", + "IssuerName":"Ontology" + }, + "clm-rev":{ + "typ": "AttestContract", + "addr": "8055b362904715fd84536e754868f4c8d27ca3f6" + } +} +``` + + +可信声明具体内容clm对应字段说明: + +| Field | Type | Description | +| :--------------: | :--------:| :------: | +| Email| String| 邮箱 | +| IssuerName| String| 签发机构名称 | + + +### signature + +``` +"addadasdadadadadadadad" +``` + +### blockchain_proof + +``` +{ + "Type":"MerkleProof", + "TxnHash":"c89e76ee58ae6ad99cfab829d3bf5bd7e5b9af3e5b38713c9d76ef2dcba2c8e0", + "ContractAddr": "8055b362904715fd84536e754868f4c8d27ca3f6", + "BlockHeight":10, + "MerkleRoot":"bfc2ac895685fbb01e22c61462f15f2a6e3544835731a43ae0cba82255a9f904", + "Nodes":[{ + "Direction":"Right", + "TargetHash":"2fa49b6440104c2de900699d31506845d244cc0c8c36a2fffb019ee7c0c6e2f6" + }, { + "Direction":"Left", + "TargetHash":"fc4990f9758a310e054d166da842dab1ecd15ad9f8f0122ec71946f20ae964a4" + }] +} +``` + + + + +## 手机认证可信声明模板 + + +### header: + +```json +{ + "alg": "ES256", + "typ": "JWT-X", + "kid": "did:ont:TRAtosUZHNSiLhzBdHacyxMX4Bg3cjWy3r#keys-1" +} +``` + +### payload: + +```json +{ + "ver": "0.7.0", + "iss": "did:ont:TRAtosUZHNSiLhzBdHacyxMX4Bg3cjWy3r", + "sub": "did:ont:SI59Js0zpNSiPOzBdB5cyxu80BO3cjGT70", + "iat": 1525465044, + "exp": 1530735444, + "jti":"4d9546fdf2eb94a364208fa65a9996b03ba0ca4ab2f56d106dac92e891b6f7fc", + "@context":"claim:mobile_authentication", + "clm":{ + "PhoneNumber": "510808088991762615", + "IssuerName":"Ontology" + }, + "clm-rev":{ + "typ": "AttestContract", + "addr": "8055b362904715fd84536e754868f4c8d27ca3f6" + } +} +``` + + +可信声明具体内容clm对应字段说明: + +| Field | Type | Description | +| :--------------: | :--------:| :------: | +| PhoneNumber| String| 手机号 | +| IssuerName| String| 签发机构名称 | + + +### signature + +``` +"addadasdadadadadadadad" +``` + +### blockchain_proof + +``` +{ + "Type":"MerkleProof", + "TxnHash":"c89e76ee58ae6ad99cfab829d3bf5bd7e5b9af3e5b38713c9d76ef2dcba2c8e0", + "ContractAddr": "8055b362904715fd84536e754868f4c8d27ca3f6", + "BlockHeight":10, + "MerkleRoot":"bfc2ac895685fbb01e22c61462f15f2a6e3544835731a43ae0cba82255a9f904", + "Nodes":[{ + "Direction":"Right", + "TargetHash":"2fa49b6440104c2de900699d31506845d244cc0c8c36a2fffb019ee7c0c6e2f6" + }, { + "Direction":"Left", + "TargetHash":"fc4990f9758a310e054d166da842dab1ecd15ad9f8f0122ec71946f20ae964a4" + }] +} +``` + + + + + diff --git a/prod-doc/en/ontid/framework/trust-anchor/claimtemplate/employment-certification.md b/prod-doc/en/ontid/framework/trust-anchor/claimtemplate/employment-certification.md new file mode 100755 index 00000000..8db4140b --- /dev/null +++ b/prod-doc/en/ontid/framework/trust-anchor/claimtemplate/employment-certification.md @@ -0,0 +1,82 @@ +### 公司在职证明可信声明模板 + +公司给本公司的在职职员签发的在职证明可信声明 + + + +### header: + +```json +{ + "alg": "ES256", + "typ": "JWT-X", + "kid": "did:ont:TRAtosUZHNSiLhzBdHacyxMX4Bg3cjWy3r#keys-1" +} +``` + +### payload: + +```json +{ + "ver": "0.7.0", + "iss": "did:ont:TRAtosUZHNSiLhzBdHacyxMX4Bg3cjWy3r", + "sub": "did:ont:SI59Js0zpNSiPOzBdB5cyxu80BO3cjGT70", + "iat": 1525465044, + "exp": 1530735444, + "jti":"4d9546fdf2eb94a364208fa65a9996b03ba0ca4ab2f56d106dac92e891b6f7fc", +    "@context":"claim:employment_authentication", + "clm":{ + "IdNumber": "510806199002122991", + "Name": "zhangsan", + "Gender":"male", + "JobTitle": "SoftwareEngineer", + "MonthlySalary": 3000.00, + "Hiredata": "2017-03-20" + }, + "clm-rev":{ + "typ": "AttestContract", + "addr": "8055b362904715fd84536e754868f4c8d27ca3f6" + } +} +``` + + + +可信声明具体内容clm对应字段说明: + + + +| Field | Type | Description | +| :--------------: | :--------:| :------: | +| IdNumber| String| 身份证号 | +| Name| String| 姓名 | +| Gender| String| 性别 | +| JobTitle| String| 公司职位 | +| MonthlySalary| Long| 月工资 | +| Hiredata| String| 入职时间,格式:yyyy-MM-dd | + + +### signature + +``` +"addadasdadadadadadadad" +``` + +### blockchain_proof + +``` +{ + "Type":"MerkleProof", + "TxnHash":"c89e76ee58ae6ad99cfab829d3bf5bd7e5b9af3e5b38713c9d76ef2dcba2c8e0", + "ContractAddr": "8055b362904715fd84536e754868f4c8d27ca3f6", + "BlockHeight":10, + "MerkleRoot":"bfc2ac895685fbb01e22c61462f15f2a6e3544835731a43ae0cba82255a9f904", + "Nodes":[{ + "Direction":"Right", + "TargetHash":"2fa49b6440104c2de900699d31506845d244cc0c8c36a2fffb019ee7c0c6e2f6" + }, { + "Direction":"Left", + "TargetHash":"fc4990f9758a310e054d166da842dab1ecd15ad9f8f0122ec71946f20ae964a4" + }] +} +``` diff --git a/prod-doc/en/ontid/framework/trust-anchor/claimtemplate/employment-certification2.md b/prod-doc/en/ontid/framework/trust-anchor/claimtemplate/employment-certification2.md new file mode 100644 index 00000000..c66dc7aa --- /dev/null +++ b/prod-doc/en/ontid/framework/trust-anchor/claimtemplate/employment-certification2.md @@ -0,0 +1,84 @@ +### Employment certification claim template + +Claim of employment certification issued by the company to employees. + +```json +{ + "Id":"ca4ab2f56d106dac92e891b6f7fc4d9546fdf2eb94a364208fa65a9996b03ba0", + "Context":"https://example.com/salary/template/v1", + "Content":{ + "IdNumber": "510806199002122991", + "Name": "zhangsan", + "Gender":"male", + "JobTitle": "SoftwareEngineer", + "MonthlySalary": 3000.00, + "Hiredata": "2017-03-20" + }, + "Metadata":{ + "CreateTime":"2017-04-01T12:01:20Z", + "Issuer":"did:ont:TRAtosUZHNSiLhzBdHacyxMX4Bg3cjWy3r", + "Subject":"did:ont:SI59Js0zpNSiPOzBdB5cyxu80BO3cjGT70", + "Expires":"2018-06-01", + "Revocation": { + "Type": "Contract", + "Addr": "8055b362904715fd84536e754868f4c8d27ca3f6" + } + }, + "Signature":{ + "PublicKeyId": "did:ont:TRAtosUZHNSiLhzBdHacyxMX4Bg3cjWy3r#keys-1", + "Format":"pgp", + "Algorithm":"ECDSAwithSHA256", + "Value":"rsjaenrxJm8qDmhtOHNBNOCOlvz/GC1c6CMnUb7KOb1jmHbMNGB63VXhtKflwSggyu1cVBK14/0t7qELqIrNmQ==" + }, + "Proof":{ + "Type":"MerkleProof", + "TxnHash":"c89e76ee58ae6ad99cfab829d3bf5bd7e5b9af3e5b38713c9d76ef2dcba2c8e0", + "ContractAddr": "8055b362904715fd84536e754868f4c8d27ca3f6", + "BlockHeight":10, + "MerkleRoot":"bfc2ac895685fbb01e22c61462f15f2a6e3544835731a43ae0cba82255a9f904", + "Nodes":[ + { + "Direction":"Right", + "TargetHash":"2fa49b6440104c2de900699d31506845d244cc0c8c36a2fffb019ee7c0c6e2f6" + }, + { + "Direction":"Left", + "TargetHash":"fc4990f9758a310e054d166da842dab1ecd15ad9f8f0122ec71946f20ae964a4" + } + ] + } +} +``` + + +Content format definition JSON file: +``` +{ + "Type": "claim:employment_authentication", + "IdNumber": { + "Doc": "Unique number of certificate", + "ValType": "String" + }, + "Name": { + "Doc": "The full name of certificate owner", + "ValType": "String" + }, + "Gender": { + "Doc": "The gender of certificate owner", + "ValType": "String" + }, + "JobTitle": { + "Doc": "The job title of certificate owner", + "ValType": "String" + }, + "MonthlySalary": { + "Doc": "The monthly salary of certificate owner", + "ValType": "double" + }, + "HireDate": { + "Doc": "Hiring date", + "ValType": "Time" + } +} + +``` diff --git a/prod-doc/en/ontid/framework/trust-anchor/claimtemplate/idm_authentication.md b/prod-doc/en/ontid/framework/trust-anchor/claimtemplate/idm_authentication.md new file mode 100755 index 00000000..72702b9f --- /dev/null +++ b/prod-doc/en/ontid/framework/trust-anchor/claimtemplate/idm_authentication.md @@ -0,0 +1,222 @@ + +## 1. IdentityMind驾照认证可信声明模板 + + +### header: + +```json +{ + "alg": "ES256", + "typ": "JWT-X", + "kid": "did:ont:TRAtosUZHNSiLhzBdHacyxMX4Bg3cjWy3r#keys-1" +} +``` + +### payload: + +```json +{ + "ver": "0.7.0", + "iss": "did:ont:TRAtosUZHNSiLhzBdHacyxMX4Bg3cjWy3r", + "sub": "did:ont:SI59Js0zpNSiPOzBdB5cyxu80BO3cjGT70", + "iat": 1525465044, + "exp": 1530735444, + "jti":"4d9546fdf2eb94a364208fa65a9996b03ba0ca4ab2f56d106dac92e891b6f7fc", +    "@context":"claim:idm_dl_authentication", + "clm":{ + "Nationality": "CN", + "Name":"Zong shen", + "CredentialNumber":"510807199001012551", + "IssuerName":"IdentityMind" + }, + "clm-rev":{ + "typ": "AttestContract", + "addr": "8055b362904715fd84536e754868f4c8d27ca3f6" + } +} +``` + + +可信声明具体内容clm对应字段说明: + +| Field | Type | Description | +| :--------------: | :--------:| :------: | +|   Nationality|   String| 国家代码。格式:ISO-3166-1 alpha-2 | +|   Name|   String| 姓名 | +|   CredentialNumber|   String| 证件号 | +|   IssuerName|   String| 签发机构名称 | + +### signature + +``` +"addadasdadadadadadadad" +``` + +### blockchain_proof + +``` +{ + "Type":"MerkleProof", + "TxnHash":"c89e76ee58ae6ad99cfab829d3bf5bd7e5b9af3e5b38713c9d76ef2dcba2c8e0", + "ContractAddr": "8055b362904715fd84536e754868f4c8d27ca3f6", + "BlockHeight":10, + "MerkleRoot":"bfc2ac895685fbb01e22c61462f15f2a6e3544835731a43ae0cba82255a9f904", + "Nodes":[{ + "Direction":"Right", + "TargetHash":"2fa49b6440104c2de900699d31506845d244cc0c8c36a2fffb019ee7c0c6e2f6" + }, { + "Direction":"Left", + "TargetHash":"fc4990f9758a310e054d166da842dab1ecd15ad9f8f0122ec71946f20ae964a4" + }] +} +``` + + +## 2.IdentityMind护照认证可信声明模板 + + +### header: + +```json +{ + "alg": "ES256", + "typ": "JWT-X", + "kid": "did:ont:TRAtosUZHNSiLhzBdHacyxMX4Bg3cjWy3r#keys-1" +} +``` + +### payload: + +```json +{ + "ver": "0.7.0", + "iss": "did:ont:TRAtosUZHNSiLhzBdHacyxMX4Bg3cjWy3r", + "sub": "did:ont:SI59Js0zpNSiPOzBdB5cyxu80BO3cjGT70", + "iat": 1525465044, + "exp": 1530735444, + "jti":"4d9546fdf2eb94a364208fa65a9996b03ba0ca4ab2f56d106dac92e891b6f7fc", +    "@context":"claim:idm_passport_authentication", + "clm":{ + "Nationality": "CN", + "Name":"Zong shen", + "CredentialNumber":"510807199001012551", + "IssuerName":"IdentityMind" + }, + "clm-rev":{ + "typ": "AttestContract", + "addr": "8055b362904715fd84536e754868f4c8d27ca3f6" + } +} +``` + + +可信声明具体内容clm对应字段说明: + +| Field | Type | Description | +| :--------------: | :--------:| :------: | +|   Nationality|   String| 国家代码。格式:ISO-3166-1 alpha-2 | +|   Name|   String| 姓名 | +|   CredentialNumber|   String| 证件号 | +|   IssuerName|   String| 签发机构名称 | + + +### signature + +``` +"addadasdadadadadadadad" +``` + +### blockchain_proof + +``` +{ + "Type":"MerkleProof", + "TxnHash":"c89e76ee58ae6ad99cfab829d3bf5bd7e5b9af3e5b38713c9d76ef2dcba2c8e0", + "ContractAddr": "8055b362904715fd84536e754868f4c8d27ca3f6", + "BlockHeight":10, + "MerkleRoot":"bfc2ac895685fbb01e22c61462f15f2a6e3544835731a43ae0cba82255a9f904", + "Nodes":[{ + "Direction":"Right", + "TargetHash":"2fa49b6440104c2de900699d31506845d244cc0c8c36a2fffb019ee7c0c6e2f6" + }, { + "Direction":"Left", + "TargetHash":"fc4990f9758a310e054d166da842dab1ecd15ad9f8f0122ec71946f20ae964a4" + }] +} +``` + + +## 3.IdentityMind身份证件认证可信声明模板 + + +### header: + +```json +{ + "alg": "ES256", + "typ": "JWT-X", + "kid": "did:ont:TRAtosUZHNSiLhzBdHacyxMX4Bg3cjWy3r#keys-1" +} +``` + +### payload: + +```json +{ + "ver": "0.7.0", + "iss": "did:ont:TRAtosUZHNSiLhzBdHacyxMX4Bg3cjWy3r", + "sub": "did:ont:SI59Js0zpNSiPOzBdB5cyxu80BO3cjGT70", + "iat": 1525465044, + "exp": 1530735444, + "jti":"4d9546fdf2eb94a364208fa65a9996b03ba0ca4ab2f56d106dac92e891b6f7fc", +    "@context":"claim:idm_idcard_authentication", + "clm":{ + "Nationality": "CN", + "Name":"Zong shen", + "CredentialNumber":"510807199001012551", + "IssuerName":"IdentityMind" + }, + "clm-rev":{ + "typ": "AttestContract", + "addr": "8055b362904715fd84536e754868f4c8d27ca3f6" + } +} +``` + + +可信声明具体内容clm对应字段说明: + +| Field | Type | Description | +| :--------------: | :--------:| :------: | +|   Nationality|   String| 国家代码。格式:ISO-3166-1 alpha-2 | +|   Name|   String| 姓名 | +|   CredentialNumber|   String| 证件号 | +|   IssuerName|   String| 签发机构名称 | + + +### signature + +``` +"addadasdadadadadadadad" +``` + +### blockchain_proof + +``` +{ + "Type":"MerkleProof", + "TxnHash":"c89e76ee58ae6ad99cfab829d3bf5bd7e5b9af3e5b38713c9d76ef2dcba2c8e0", + "ContractAddr": "8055b362904715fd84536e754868f4c8d27ca3f6", + "BlockHeight":10, + "MerkleRoot":"bfc2ac895685fbb01e22c61462f15f2a6e3544835731a43ae0cba82255a9f904", + "Nodes":[{ + "Direction":"Right", + "TargetHash":"2fa49b6440104c2de900699d31506845d244cc0c8c36a2fffb019ee7c0c6e2f6" + }, { + "Direction":"Left", + "TargetHash":"fc4990f9758a310e054d166da842dab1ecd15ad9f8f0122ec71946f20ae964a4" + }] +} +``` + + diff --git a/prod-doc/en/ontid/framework/trust-anchor/claimtemplate/sensetime-realname-claim.md b/prod-doc/en/ontid/framework/trust-anchor/claimtemplate/sensetime-realname-claim.md new file mode 100755 index 00000000..144bd3f3 --- /dev/null +++ b/prod-doc/en/ontid/framework/trust-anchor/claimtemplate/sensetime-realname-claim.md @@ -0,0 +1,72 @@ +## 商汤实名认证可信声明模板 + +### header: + +```json +{ + "alg": "ES256", + "typ": "JWT-X", + "kid": "did:ont:TRAtosUZHNSiLhzBdHacyxMX4Bg3cjWy3r#keys-1" +} +``` + +### payload: + +```json +{ + "ver": "0.7.0", + "iss": "did:ont:TRAtosUZHNSiLhzBdHacyxMX4Bg3cjWy3r", + "sub": "did:ont:SI59Js0zpNSiPOzBdB5cyxu80BO3cjGT70", + "iat": 1525465044, + "exp": 1530735444, + "jti":"4d9546fdf2eb94a364208fa65a9996b03ba0ca4ab2f56d106dac92e891b6f7fc", +    "@context":"claim:sensetime_authentication", + "clm":{ + "身份证号": "510808088991762615", + "姓名": "zz", + "IssuerName":"Sensetime" + }, + "clm-rev":{ + "typ": "AttestContract", + "addr": "8055b362904715fd84536e754868f4c8d27ca3f6" + } +} +``` + +可信声明具体内容clm对应字段说明: + +| Field | Type | Description | +| :--------: | :----: | :----------: | +| 身份证号 | String | 身份证号 | +| 姓名 | String | 姓名 | +| IssuerName | String | 签发机构名称 | + +### signature + +``` +"addadasdadadadadadadad" +``` + +### blockchain_proof + +``` +{ + "Type":"MerkleProof", + "TxnHash":"c89e76ee58ae6ad99cfab829d3bf5bd7e5b9af3e5b38713c9d76ef2dcba2c8e0", + "ContractAddr": "8055b362904715fd84536e754868f4c8d27ca3f6", + "BlockHeight":10, + "MerkleRoot":"bfc2ac895685fbb01e22c61462f15f2a6e3544835731a43ae0cba82255a9f904", + "Nodes":[{ + "Direction":"Right", + "TargetHash":"2fa49b6440104c2de900699d31506845d244cc0c8c36a2fffb019ee7c0c6e2f6" + }, { + "Direction":"Left", + "TargetHash":"fc4990f9758a310e054d166da842dab1ecd15ad9f8f0122ec71946f20ae964a4" + }] +} +``` + + + + + diff --git a/prod-doc/en/ontid/framework/trust-anchor/claimtemplate/shuftipro_authentication.md b/prod-doc/en/ontid/framework/trust-anchor/claimtemplate/shuftipro_authentication.md new file mode 100755 index 00000000..b0c36c78 --- /dev/null +++ b/prod-doc/en/ontid/framework/trust-anchor/claimtemplate/shuftipro_authentication.md @@ -0,0 +1,167 @@ +## 1. Shuftipro驾照认证可信声明模板 + + +### header: + +```json +{ + "alg": "ES256", + "typ": "JWT-X", + "kid": "did:ont:TRAtosUZHNSiLhzBdHacyxMX4Bg3cjWy3r#keys-1" +} +``` + +### payload: + +```json +{ + "ver": "0.7.0", + "iss": "did:ont:ARAtosUZHNSiLhzBdHacyxMX4Bg3cjWy3r", + "sub": "did:ont:AI59Js0zpNSiPOzBdB5cyxu80BO3cjGT70", + "iat": 1525465044, + "exp": 1530735444, + "jti":"4d9546fdf2eb94a364208fa65a9996b03ba0ca4ab2f56d106dac92e891b6f7fc", + "@context":"claim:sfp_dl_authentication", + "clm":{ + "Nationality": "US", + "Name":"john smith", + "BirthDay":"1990-01-01", + "IssueDate":"2000-01-01", + "ExpirationDate":"2020-01-01", + "IDDocNumber":"510807199001012551", + "IssuerName":"Shuftipro" + }, + "clm-rev":{ + "typ": "AttestContract", + "addr": "8055b362904715fd84536e754868f4c8d27ca3f6" + } +} +``` + + +可信声明具体内容clm对应字段说明: + +| Field | Type | Description | +| :--------------: | :--------:| :------: | +| Nationality| String| 国家代码。格式:ISO-3166-1 alpha-2 | +| Name| String| 姓名 | +| BirthDay| String| 出生日期,格式:YYYY-MM-DD | +| IssueDate| String| 证件签发日期,格式:YYYY-MM-DD | +| ExpirationDate| String| 证件过期日期,格式:YYYY-MM-DD | +| IDDocNumber| String| 证件号 | +| IssuerName| String| 签发机构名称 | + +### signature + +``` +"addadasdadadadadadadad" +``` + +### blockchain_proof + +``` +{ + "Type":"MerkleProof", + "TxnHash":"c89e76ee58ae6ad99cfab829d3bf5bd7e5b9af3e5b38713c9d76ef2dcba2c8e0", + "ContractAddr": "8055b362904715fd84536e754868f4c8d27ca3f6", + "BlockHeight":10, + "MerkleRoot":"bfc2ac895685fbb01e22c61462f15f2a6e3544835731a43ae0cba82255a9f904", + "Nodes":[{ + "Direction":"Right", + "TargetHash":"2fa49b6440104c2de900699d31506845d244cc0c8c36a2fffb019ee7c0c6e2f6" + }, { + "Direction":"Left", + "TargetHash":"fc4990f9758a310e054d166da842dab1ecd15ad9f8f0122ec71946f20ae964a4" + }] +} +``` + + +## 2.Shuftipro护照认证可信声明模板 + + + +### payload: + +```json +{ + "ver": "0.7.0", + "iss": "did:ont:TRAtosUZHNSiLhzBdHacyxMX4Bg3cjWy3r", + "sub": "did:ont:SI59Js0zpNSiPOzBdB5cyxu80BO3cjGT70", + "iat": 1525465044, + "exp": 1530735444, + "jti":"4d9546fdf2eb94a364208fa65a9996b03ba0ca4ab2f56d106dac92e891b6f7fc", + "@context":"claim:sfp_passport_authentication", + "clm":{ + "Nationality": "US", + "Name":"john smith", + "BirthDay":"1990-01-01", + "IssueDate":"2000-01-01", + "ExpirationDate":"2020-01-01", + "IDDocNumber":"510807199001012551", + "IssuerName":"Shuftipro" + }, + "clm-rev":{ + "typ": "AttestContract", + "addr": "8055b362904715fd84536e754868f4c8d27ca3f6" + } +} +``` + + +可信声明具体内容clm对应字段说明: + +| Field | Type | Description | +| :--------------: | :--------:| :------: | +| Nationality| String| 国家代码。格式:ISO-3166-1 alpha-2 | +| Name| String| 姓名 | +| BirthDay| String| 出生日期,格式:YYYY-MM-DD | +| IssueDate| String| 证件签发日期,格式:YYYY-MM-DD | +| ExpirationDate| String| 证件过期日期,格式:YYYY-MM-DD | +| IDDocNumber| String| 证件号 | +| IssuerName| String| 签发机构名称 | + + +## 3.Shuftipro身份证件认证可信声明模板 + + +### payload: + +```json +{ + "ver": "0.7.0", + "iss": "did:ont:TRAtosUZHNSiLhzBdHacyxMX4Bg3cjWy3r", + "sub": "did:ont:SI59Js0zpNSiPOzBdB5cyxu80BO3cjGT70", + "iat": 1525465044, + "exp": 1530735444, + "jti":"4d9546fdf2eb94a364208fa65a9996b03ba0ca4ab2f56d106dac92e891b6f7fc", + "@context":"claim:sfp_idcard_authentication", + "clm":{ + "Nationality": "US", + "Name":"john smith", + "BirthDay":"1990-01-01", + "IssueDate":"2000-01-01", + "ExpirationDate":"2020-01-01", + "IDDocNumber":"510807199001012551", + "IssuerName":"Shuftipro" + }, + "clm-rev":{ + "typ": "AttestContract", + "addr": "8055b362904715fd84536e754868f4c8d27ca3f6" + } +} +``` + + +可信声明具体内容clm对应字段说明: + +| Field | Type | Description | +| :--------------: | :--------:| :------: | +| Nationality| String| 国家代码。格式:ISO-3166-1 alpha-2 | +| Name| String| 姓名 | +| BirthDay| String| 出生日期,格式:YYYY-MM-DD | +| IssueDate| String| 证件签发日期,格式:YYYY-MM-DD | +| ExpirationDate| String| 证件过期日期,格式:YYYY-MM-DD | +| IDDocNumber| String| 证件号 | +| IssuerName| String| 签发机构名称 | + diff --git a/prod-doc/en/ontid/framework/trust-anchor/claimtemplate/social-claim.md b/prod-doc/en/ontid/framework/trust-anchor/claimtemplate/social-claim.md new file mode 100755 index 00000000..42e7e7ad --- /dev/null +++ b/prod-doc/en/ontid/framework/trust-anchor/claimtemplate/social-claim.md @@ -0,0 +1,324 @@ +## 社交媒体认证可信声明模板 + +#### 标准可信声明模板示例 + +**说明:标准可信声明由header,payload,signature,blockchain_proof四部分组成。组成格式为:header.payload.signature.blockchain_proof 针对自签的可信声明可以没有blockchain_proof** + +#### Header +```json +{ + "alg": "ONT-ES256", + "typ": "JWT-X", + "kid": "did:ont:TRAtosUZHNSiLhzBdHacyxMX4Bg3cjWy3r#keys-1" +} +``` +#### Payload +```json +{ + "ver": "0.7.0", + "iss": "did:ont:TRAtosUZHNSiLhzBdHacyxMX4Bg3cjWy3r", + "sub": "did:ont:SI59Js0zpNSiPOzBdB5cyxu80BO3cjGT70", + "iat": 1525465044, + "exp": 1530735444, + "jti":"4d9546fdf2eb94a364208fa65a9996b03ba0ca4ab2f56d106dac92e891b6f7fc", + "@context":"https://example.com/template/v1", + "clm":{ + "IdNumber": "510806199002122991", + "Name": "Bob Dylan", + "JobTitle": "SoftwareEngineer", + "MonthlySalary": 3000.00, + "HireDate": "2017-03-20" + }, + "clm-rev":{ + "typ": "AttestContract", + "addr": "8055b362904715fd84536e754868f4c8d27ca3f6" + } +} +``` +#### Signature + +``` +"e1231231231231231scsdcsdsddsadasdadas" +``` + +#### Blockchain proof +``` +{ + "Type":"MerkleProof", + "TxnHash":"c89e76ee58ae6ad99cfab829d3bf5bd7e5b9af3e5b38713c9d76ef2dcba2c8e0", + "ContractAddr": "8055b362904715fd84536e754868f4c8d27ca3f6", + "BlockHeight":10, + "MerkleRoot":"bfc2ac895685fbb01e22c61462f15f2a6e3544835731a43ae0cba82255a9f904", + "Nodes":[{ + "Direction":"Right", + "TargetHash":"2fa49b6440104c2de900699d31506845d244cc0c8c36a2fffb019ee7c0c6e2f6" + }, { + "Direction":"Left", + "TargetHash":"fc4990f9758a310e054d166da842dab1ecd15ad9f8f0122ec71946f20ae964a4" + }] + } +} +``` + + +字段说明: + +| Field | Type | Description | Necessary| +| :--------------: | :--------:| :------: |:------: | +| alg| String| 指明使用的签名方案 |Y| +| typ| String| 格式类型, JWT或者JWT-X |Y| +| kid| String| 指明用于签名验证的公钥 |Y| +| ver| String| 指明可信声明版本 |Y| +| iss| String| 可信声明签发者的ONT ID |Y| +| sub| String| 可信声明接收者的ONT ID |Y| +| iat| int| unix时间戳格式的创建时间 |Y| +| exp| int| unix时间戳格式的过期时间 |N| +| jti| int| 可信声明的唯一标识符 |N| +| @context| String| 可信声明内容定义文档的uri,包含每个字段的含义和值的类型的定义 |N| +| clm| Object | 指明了可信声明内容 |Y| +| clm-rev| Object | 指明了可信声明吊销方式 |Y| +| Type| String | 固定值"MerkleProof" |N| +| TxnHash| String | 存证交易hash值 |N| +| ContractAddr| String | 存证合约的地址 |N| +| BlockHeight| int | 存证交易对应的区块高度 |N| +| MerkleRoot| String| 该区块高度的区块对应的Merkle树根 |N| +| Nodes| list | 验证节点数组 |N| +| Nodes.Direction| String | 验证节点方向 |N| +| Nodes.TargetHash| String | 验证节点hash值 |N| + + + +**说明**:可信声明主要分两种类型 + +- 自签名可信声明,该种声明不包含MerkleProof证明,Claim里没有blockchain_proof +- 第三方签名可信声明,该种声明包含了MerkleProof证明,Claim里有blockchain_proof + +---------------------------------------------------------------------------------------------------------------------------------------- + +### 自签可信声明 + +这种可信声明没有blockchain_proof + +### twitter认证可信声明模板 + + +#### Payload + +```json +{ + "ver": "0.7.0", + "iss": "did:ont:TRAtosUZHNSiLhzBdHacyxMX4Bg3cjWy3r", + "sub": "did:ont:SI59Js0zpNSiPOzBdB5cyxu80BO3cjGT70", + "iat": 1525465044, + "exp": 1530735444, + "jti":"4d9546fdf2eb94a364208fa65a9996b03ba0ca4ab2f56d106dac92e891b6f7fc", +    "@context":"claim:twitter_authentication", + "clm":{ + "Id": "424209562", + "Name": "leewi9在上海", + "Alias": "leewi9_shanghai", + "Bio": "", + "Avatar": "https://pbs.twimg.com/profile_images/627454413213315073/NDaMGG_a_normal.jpg", + "Location": "", + "WebSite": "", + "HomePage": "https://twitter.com/leewi9_shanghai", + "TwitterUrl": "https://twitter.com/leewi9_shanghai/status/968687917853036544", + "TwitterCreateTime": "Wed Feb 28 03:22:51 +0000 2018", + "IssuerName":"Ontology" + }, + "clm-rev":{ + "typ": "AttestContract", + "addr": "8055b362904715fd84536e754868f4c8d27ca3f6" + } +} +``` + + + +可信声明具体内容clm对应字段说明: + +| Field | Type | Description | +| :--------------: | :--------:| :------: | +| Id| String| 账户Id | +| Name| String| 账户名称 | +| Alias| String| 账户别名 | +| Bio| String| 个人简介 | +| Avatar| String| 个人头像 | +| Location| String| 位置 | +| WebSite| String| 个人网站 | +| HomePage| String| 个人社媒主页 | +| TwitterUrl| String | 推文链接 | +| TwitterCreateTime| String | 推文发送时间 | +| IssuerName| String| 签发机构名称 | + + +### github认证可信声明模板 + + +#### Payload +```json +{ + "ver": "0.7.0", + "iss": "did:ont:TRAtosUZHNSiLhzBdHacyxMX4Bg3cjWy3r", + "sub": "did:ont:SI59Js0zpNSiPOzBdB5cyxu80BO3cjGT70", + "iat": 1525465044, + "exp": 1530735444, + "jti":"4d9546fdf2eb94a364208fa65a9996b03ba0ca4ab2f56d106dac92e891b6f7fc", + "@context":"claim:github_authentication", + "clm":{ + "Id": "10832544", + "Name": "", + "Company": "", + "Alias": "leewi9", + "Bio": "", + "Avatar": "https://avatars2.githubusercontent.com/u/10832544?v=4", + "Email": "leewi9@yahoo.com", + "Location": "", + "GistUrl": "https://gist.github.com/42298ebb0c44054c43f48e1afd763ff6", + "GistCreateTime": "2018-02-28T03:24:48Z", + "IssuerName":"Ontology" + }, + "clm-rev":{ + "typ": "AttestContract", + "addr": "8055b362904715fd84536e754868f4c8d27ca3f6" + } +} +``` + +可信声明具体内容clm对应字段说明: + +| Field | Type | Description | +| :--------------: | :--------:| :------: | +| Id| String| 账户Id | +| Name| String| 账户名称 | +| Company| String| 账户绑定的公司 | +| Alias| String| 账户别名 | +| Bio| String| 个人简介 | +| Avatar| String| 个人头像 | +| Email| String| 账户绑定的邮箱 | +| Location| String| 位置 | +| GistUrl| String | Gist文章链接 | +| GistCreateTime| String | Gist文章发送时间 | +| IssuerName| String| 签发机构名称 | + + +---------------------------------------------------------------------------------------------------------------------------------- + +### 第三方签发可信声明 + +这种可信声明带有blockchain_proof + +#### Blockchain proof +``` +{ + "Type":"MerkleProof", + "TxnHash":"c89e76ee58ae6ad99cfab829d3bf5bd7e5b9af3e5b38713c9d76ef2dcba2c8e0", + "ContractAddr": "8055b362904715fd84536e754868f4c8d27ca3f6", + "BlockHeight":10, + "MerkleRoot":"bfc2ac895685fbb01e22c61462f15f2a6e3544835731a43ae0cba82255a9f904", + "Nodes":[{ + "Direction":"Right", + "TargetHash":"2fa49b6440104c2de900699d31506845d244cc0c8c36a2fffb019ee7c0c6e2f6" + }, { + "Direction":"Left", + "TargetHash":"fc4990f9758a310e054d166da842dab1ecd15ad9f8f0122ec71946f20ae964a4" + }] + } +} +``` + +### linkedin认证可信声明模板 + +**linkedin认证是由机构签发,所以包含MerkleProof** + + +#### Payload + +```json +{ + "ver": "0.7.0", + "iss": "did:ont:TRAtosUZHNSiLhzBdHacyxMX4Bg3cjWy3r", + "sub": "did:ont:SI59Js0zpNSiPOzBdB5cyxu80BO3cjGT70", + "iat": 1525465044, + "exp": 1530735444, + "jti":"4d9546fdf2eb94a364208fa65a9996b03ba0ca4ab2f56d106dac92e891b6f7fc", +    "@context":"claim:linkedin_authentication", + "clm":{ + "Id": "yL5FdXB-um", + "Name": "feng li", + "FirstName": "feng", + "LastName": "li", + "Bio": "Blockchain App Developer", + "Avatar": "https://media.licdn.com/mpr/mprx/0_-HOmp1u9zNCxbF3iKoYjplm9clNP53AiyuoAplgLHN8Cs56_YaaCtAdIJ0qS66rf1IpK19_gajZa", + "HomePage": "https://www.linkedin.com/in/%E4%BA%9A%E5%B3%B0-%E6%9D%8E-b56b8b79", + "IssuerName":"Ontology" + }, + "clm-rev":{ + "typ": "AttestContract", + "addr": "8055b362904715fd84536e754868f4c8d27ca3f6" + } +} +``` + + +可信声明具体内容clm对应字段说明: + +| Field | Type | Description | +| :--------------: | :--------:| :------: | +| Id| String| 账户Id | +| Name| String| 名称 | +| FirstName| String| 名 | +| LastName| String| 姓 | +| Bio| String| 个人简介 | +| Avatar| String| 个人头像 | +| HomePage| String| 社媒主页 | +| IssuerName| String| 签发机构名称 | + + +### facebook认证可信声明模板 + +**facebook认证是由机构签发,所以包含MerkleProof** + +#### Payload + +```json +{ + "ver": "0.7.0", + "iss": "did:ont:TRAtosUZHNSiLhzBdHacyxMX4Bg3cjWy3r", + "sub": "did:ont:SI59Js0zpNSiPOzBdB5cyxu80BO3cjGT70", + "iat": 1525465044, + "exp": 1530735444, + "jti":"4d9546fdf2eb94a364208fa65a9996b03ba0ca4ab2f56d106dac92e891b6f7fc", +    "@context":"claim:github_authentication", + "clm":{ + "Id": "1803639093262686", + "Name": "lifeng", + "FirstName": "feng", + "LastName": "li", + "Avatar": "https://graph.facebook.com/v2.3/1803639093262686/picture", + "Gender": "male", + "Locale": "zh_CN", + "HomePage": "https://www.facebook.com/1803639093262686", + "IssuerName":"Ontology" + }, + "clm-rev":{ + "typ": "AttestContract", + "addr": "8055b362904715fd84536e754868f4c8d27ca3f6" + } +} +``` + + +可信声明具体内容clm对应字段说明: + +| Field | Type | Description | +| :--------------: | :--------:| :------: | +| Id| String| 账户Id | +| Name| String| 名称 | +| FirstName| String| 名 | +| LastName| String| 姓 | +| Avatar| String| 个人头像 | +| Gender| String| 性别 | +| Locale| String| 地区 | +| HomePage| String| 社媒主页 | +| IssuerName| String| 签发机构名称 | diff --git a/prod-doc/en/ontid/framework/trust-anchor/deployment.md b/prod-doc/en/ontid/framework/trust-anchor/deployment.md new file mode 100644 index 00000000..70e96bb9 --- /dev/null +++ b/prod-doc/en/ontid/framework/trust-anchor/deployment.md @@ -0,0 +1,68 @@ +# ONT ID Trust Anchor - deployment + +## 1. Prerequisite + +### Become a new `trust anchor` + +- **Register ONT ID** + + You need to register your ONT ID first. We recommend you to register it through the official SDK. + + [ont-java-sdk](https://github.com/ontio/ontology-java-sdk) - SDK to create a digital identity. + +- **Integrated Features of Verifiable Claim Management** + + To achieve the issuance and management of the standard verifiable claim. To support the functions including issuing, revoking, verifying, querying, and publishing the templates of verifiable claim. + + We provide components to quickly integrate these features. + +- **Customized Development** + + Step 1: Combine the existing identification methods, customize the A1 interface, and open it to the client; + + Step 2: Use SDK to implement the A2 interface for verifying user identity of ONT ID; + + [ont-java-sdk](https://github.com/ontio/ontology-java-sdk) - SDK to validate user signature. + + Step 3: Set templates of verifiable claim based on your business demand; + + Step 4: Use the A3 interface through the CWC. As shown in above figure, the A3 interface will help the Trust Anchor to issue and send it to the trusted storage and blockchain. + + > Note:Please use official domain name URL to open the API of verifying verifiable claim to the public. + + + +## 2. Configuration + +Sample configuration file in json, + +```json +{ + "ontId": "did:ont:AFmseVrdL9f9oyCzZefL9tG6UbvhUMqNMV", + "domain": "sampletrustanchor.ont", + "enableONS": true, + "defaultPayer": "AFmseVrdL9f9oyCzZefL9tG6UbvhUMqNMV" +} +``` + +| Field Name | Type | Description | +| ---------- | ---- | ----------- | +| ontId | String | ONT ID of the host | +| domain | String | Registered domain in ONS | +| enableONS | boolean | Enable sub-domain for end user | +| defaultPayer | String | The payer of transaction gas fee from customer(s), if leave `blank`, the customer will pay the gas fee on their own | + +### 2.1 Enable ONS + +设置 enableONS 为true 时,启用ONS合约,需注意 ondtid 与 domain 要在ONS合约注册绑定,并登陆。 + +### 2.2 Set default payer + +设置 defaultPayer 为钱包地址,并且要配置该钱包的私钥,以便于签名时使用。 + +### 2.3 Config action(s) + + + +### 2.4 Add customized action + diff --git a/prod-doc/en/ontid/framework/trust-anchor/restful-api.md b/prod-doc/en/ontid/framework/trust-anchor/restful-api.md new file mode 100644 index 00000000..8542da10 --- /dev/null +++ b/prod-doc/en/ontid/framework/trust-anchor/restful-api.md @@ -0,0 +1,375 @@ +# ONT ID Trust Anchor - RESTful api + +1. [Ontology claim system](#claims) +2. [Appendix I. ABI of claim contract](#abi) + +Ontology provides standard protocol for entities to provide endorsement on certain professional capabilities for users, the data privacy protection is also involved. The series of endorsements, a.k.a., claims and proofs, increase the qualifiable of users. + +Due to the blockchain infrastructure, the endorsement turns to be "**trust endorsement**", and the endorsement providers in Ontology ecosystem are called the Ontology Trust Anchors (TAs). + +Tipical trust anchor usecase in ONT ID framework works in the diagram below. + +![img-ta-case](../../res/img-ta-case.png) + +Technically, `Ontology TA` works with `ONT Auth` and `claim store`, provides user qualification in web-apps. + +![img-ta-overall](../../res/img-ta-overall.png) + +The component of Ontology TA list below, + +1. [Trust anchor with ONT Auth (self-sovereign claim)](#claims) + 1. ONT ID, owner of the claims + 2. Claim factory, manipulate the claims, create `anonymous credential` for real usecases, in order to enable data privacy protection. +3. [Claim store](../claim-store/README.md) + +## Ontology claim system + +### 1. Verifiable claim specification + +[>>> Learn more.](../spec/claim.md) + +### 2. Claim generation + +Ontology claim system reuses the "[general interface](../signing-server/restful-api.md#GIfc)" and "[self-sovereign identity](../signing-server/restful-api.md#SSID)" of `ONT Auth` and `signing server`. + +![img-ta-claim-request](../../res/img-ta-claim-request.png) + +#### 2.1 Request a claim + +- End user acquire a claim for certain qualifications, provides proof of the qualification items +- Trust anchor verify the proof and prepare for the claim, the claim follows the `verifiable claim specification`. + +#### 2.2 Generate QR code for ONT Auth + +Ref., [signing server - generate a qrcode to verify the belonging of ONT ID](../signing-server/restful-api.md#genQrcode) + +``` +url:/api/v1/ontid/verify/claim +method:Get +``` + +Response: + +```json +{ + "action": "claim", + "error": 0, + "desc": "SUCCESS", + "result": { + "callback": "http://192.168.3.121:7878/api/v1/ta/claim/invoke", + "id": "a0308abd-d57e-41fe-9554-5fe6435db2fe", + "qrcodeUrl": "http://192.168.3.121:7878/api/v1/ta/qrcode/a0308abd-d57e-41fe-9554-5fe6435db2fe", + "domain": "sampleta.ont", + "msg": "7ca22b" + }, + "version": "v1" +} +``` + +| Field Name | Type | Description | +| ---------- | ------ | ------------------------------------------------------------ | +| action | String | Action name, `claim` | +| error | int | Error code | +| desc | String | If successful, SUCCESS is shown; if failed, error description is shown | +| result | String | If successful, recorded info is returned; if failed, "" is returned | +| callback | String | Callback URL address | +| id | String | Reserved id for the close loop of the transaction, random per request, expired in 24 hours by default | +| qrcodeUrl | String | Get tx parameter address | +| domain | String | The domain of the web-app, registered in ONS. If the signing server is setup by the web-app on its own, this field can leave blank | +| msg | String | Random message to identify the request | +| version | String | Version | + +#### 2.3 Check request status + +Ref., [check tx status](../signing-server/restful-api.md#checkTxStatus), the `action` field of response is "**claimResult**". + +#### 2.4 Log on-chain + +Ref., [ABI of claim](#abi). + +``` +Boolean Commit(ByteArray claimId, ByteArray committerId, ByteArray ownerId); +Boolean Revoke(ByteArray claimId, ByteArray ontId); +ByteArray Getstatus(ByteArray claimId); // return status of the claimId +``` + +| Name | Type | Description | +| -------------- | --------- | --------------------------------------- | +| claimId | ByteArray | Hash of the claim | +| committerId | ByteArray | ONT ID of trust anchor | +| ownerId, ontId | ByteArray | ONT ID of the entity | +| Status | ByteArray | Serialized byte array of struct ClaimTx | + +```c# +ClaimTx +{ + public byte[] claimId; + public byte[] commiterId; + public byte[] ownerId; + public byte status; // 1: actived; 0: revoked +} +``` + +#### 2.5 ONT Auth behavior + +##### 2.5.1 Get tx parameters + +Get transaction pattern of user action(s). The transaction with `ONT ID PK` signed is to verify ONT ID belonging from ONT Auth. + +``` +url:/api/v1/ta/qrcode/{id} +method:Get +``` + +Request + +| Field Name | Type | Description | +| ---------- | ------ | -------------------------------------- | +| id | String | Id returned from "2.2 generate qrcode" | + +Response: + +```json +{ + "action": "claim", + "id": "80edaf95-4706-41f1-a25b-57447e4e3094", + "params": { + "invokeConfig": { + "contractHash": "729635b7135e9eab97daed4e0b48e9f18a71410d", + "functions": [{ + "args": [{ + "name": "ontid", + "value": "String:%ontid" + }, { + "name": "msg", + "value": "String:%msg" + }, { + "name": "expire", + "value": "Long:%expire" + }], + "operation": "verifySign" + }] + }, + "ontidSign": true, + "callback": "http://192.168.3.121:7878/api/v1/claim/invoke" + }, + "version": "v1" +} +``` + +| Field Name | Type | Description | +| ---------- | ------ | ------------------------------------------------------------ | +| action | String | Action name, `claim` | +| id | String | Id returned from "2.2 generate qrcode" | +| params | Object | Transaction parameters, for detail, please view protocol in `ont-auth` and [`signing server`](../ont-auth/transaction-spec.md) | +| version | String | Version | + +##### 2.5.2 Construct transaction and send + +1. ONT Auth will [contruct a claim invoke transaction](../signing-server/restful-api.md#constructTransaction) with the given pattern. +2. Sign the transaction and send. Ref., [transaction with signed tx string](../signing-server/restful-api.md#signedTx). + +#### 2.6 Get claim from TA + +``` +url:/api/v1/ta/claim/{id} +method:GET +``` + +| Field Name | Type | Description | +|---|---|---| +| id | String | Id returned from "2.2 generate qrcode" | + +Response: + +```json +{ + "action": "getClaim", + "version": "v1", + "error": 0, + "id": "10ba038e-48da-487b-96e8-8d3b99b6d18a", + "result": { + "claimTemplate": "claims:yus_chinese_id_authentication", + "claim":"eyJraWQiOiJkaWQ6b250OkFhUEVnNzdmR3FqM2RZUDcxYUFrWnU3M0ZLc01KUWVxaTEja2V5cy0xIiwidHlwIjoiSldULVgiLCJhbGciOiJPTlQtRVMyNTYifQ==.eyJjbG0tcmV2Ijp7InR5cCI6IkF0dGVzdENvbnRyYWN0IiwiYWRkciI6IjM2YmI1YzA1M2I2YjgzOWM4ZjZiOTIzZmU4NTJmOTEyMzliOWZjY2MifSwic3ViIjoiZGlkOm9udDpBSnVhN0M2dGVvRlVzMktoUmVjcWJmYlB3ckY5OWtISGdqIiwidmVyIjoidjEuMCIsImNsbSI6eyJJc3N1ZXJOYW1lIjoiU2Vuc2V0aW1lIiwi5aeT5ZCNIjoi5LiB5bCP57KJIiwi6Lqr5Lu96K+B5Y+3IjoiMzQxMjgxMTk4NzA4MzA2OTA4In0sImlzcyI6ImRpZDpvbnQ6QWFQRWc3N2ZHcWozZFlQNzFhQWtadTczRktzTUpRZXFpMSIsImV4cCI6MTU5NTQxNDMzMywiaWF0IjoxNTYzNzkxOTM1LCJAY29udGV4dCI6ImNsYWltOnl1c19jaGluZXNlX2lkX2F1dGhlbnRpY2F0aW9uIiwianRpIjoiZDNlYzBjZWFkNWEzN2JjNTQ2OTAzODUwY2QxMGY4OTM0NGUyZWVlZGUwM2UxMGJmNTNhZjA1ZGI3YmY4NjY1NCJ9.AZniJRQtytUzoaWAS5CjnqQdTHD4mW9lQnyepwuzwkqA5ZeOM6Jr2ZnHI42R981YHCyRse7qHpC6xhxeQc0XunM=\.eyJUeXBlIjoiTWVya2xlUHJvb2YiLCJNZXJrbGVSb290IjoiYjFmNjUwMGI3MGM0ZGY3YmNlNDQ2MDgxNzIxNDQ1M2E3ZmI4MTZiNjMwZGI1NTRmZDFhM2FhMjgwZDM1ZTA3MSIsIlR4bkhhc2giOiI0MTEyYzE3MDM1OTljMWM1ZThmNmM5NWY4YTNjMGI0ZGYwMDk2MWU0NmIxZDdiMjk3MmY5MjVhYjIyZGM5OTViIiwiQmxvY2tIZWlnaHQiOjMwMzMzNDAsIk5vZGVzIjpbeyJUYXJnZXRIYXNoIjoiZTE0MTcyYzhhNmUxOTM5NDM0NjU2NDhlMWM1ODZhOTE4NmEzNzg0ZWU3ZWUyOWRiOWVkYmY2YWZlMDRmNTM5MCIsIkRpcmVjdGlvbiI6IkxlZnQifSx7IlRhcmdldEhhc2giOiJmNDQwNTMxOTk5YzU0N2RiMDhmNTE2Njc3YzE1MjIxNTQ3NWE2OWRjY2I4MjE3NmU0YmNhMWI3MjYyNjFhMWJlIiwiRGlyZWN0aW9uIjoiTGVmdCJ9LHsiVGFyZ2V0SGFzaCI6IjMzZDQ0ZmIxOTMxZWMwYTVjMjZiMzg1ZmZhYmQwYjUzYTQ5YTE4MDIxZWQxYjljMTEyNmU5ODAzNGFjNzZkNjAiLCJEaXJlY3Rpb24iOiJMZWZ0In0seyJUYXJnZXRIYXNoIjoiYzMzZTg5ZTZhYjcwZjg0YjY2MDkyYThjY2FjMjk5ZWY5MjBlNWQ0NTg2MDc3ZGFlNDk1M2I2MjFhN2Q4NDhjOCIsIkRpcmVjdGlvbiI6IkxlZnQifSx7IlRhcmdldEhhc2giOiI3YTI1MTA1NzkyNmQ5MTc0NGRlYjcyMWYyMjExYjZlZTIwODMwMzRkM2EzOWM5NzFjZDY2ZDhhMzNhMjI1OGU1IiwiRGlyZWN0aW9uIjoiTGVmdCJ9LHsiVGFyZ2V0SGFzaCI6Ijk1ZDY0YThhYmM2NzU5YzU1ZWJjYThiNzU0MGM5OGU0NWUxYzI4NWE4MDk0Zjg4MDdlMjI1NDI4NTRhMDZhOGIiLCJEaXJlY3Rpb24iOiJMZWZ0In0seyJUYXJnZXRIYXNoIjoiNjgxMTY1MmY1ZTI2ZDNjZDk0NjY2ZWI3MDkyMTMxYzU0NThkYTUxYzZmOTBlM2YxMDg3MDU5ODc2M2NjZGVkMSIsIkRpcmVjdGlvbiI6IkxlZnQifSx7IlRhcmdldEhhc2giOiJkNzE1YzllODE3ZmU4NjYzMTkzYjU5N2MzYjZhMjhiNTlmYTY4NWQxZjNmMjVhNjhkZmJhMGYyYzA2Y2I5MjFiIiwiRGlyZWN0aW9uIjoiTGVmdCJ9LHsiVGFyZ2V0SGFzaCI6IjFmMGU4ZTA2YmU5MGQzYTM2MWNlZTk5OWMwYWM5OGVkYjBmNjA4YTViMzNhMTU3ODM4ZTMyNWU0ZmFlMjRkY2MiLCJEaXJlY3Rpb24iOiJMZWZ0In0seyJUYXJnZXRIYXNoIjoiNjA5NDQyYmEyYjk5NWEzYTA4ZTk5ZmE3MTQ3ZDY4NDQ2YjNmY2IzYjNiZTU4ZmQ2MzI3NWU1NDAxM2M1YmM1MSIsIkRpcmVjdGlvbiI6IkxlZnQifSx7IlRhcmdldEhhc2giOiJiMGNkY2I2ZmM1NzRjMzQyMDgyMDYwNzllYzBiNDc4NDM1NGE4YzUwZGI4NTJkNGQ3ZGMzMjY1NjkwOTE5N2Q4IiwiRGlyZWN0aW9uIjoiTGVmdCJ9LHsiVGFyZ2V0SGFzaCI6Ijc5YTgyYzkzZGZiZWNjODhmNzZhYjMzMDk1NWMyZjY0ODlhMmYyNmFkOThhY2FiOGI3NDY4MWViNzJhYjM4YzYiLCJEaXJlY3Rpb24iOiJMZWZ0In1dLCJDb250cmFjdEFkZHIiOiIzNmJiNWMwNTNiNmI4MzljOGY2YjkyM2ZlODUyZjkxMjM5YjlmY2NjIn0=" + } +} +``` + +| Field Name | Type | Description | +| --- | --- | --- | +| action | String | Action name: `getClaim` | +| id | String | Recorded ID | +| version | String | Version | +| error | int | Error code | +| result | Object | Returns the claim object. [`claimTemplate`](./template-definition.md) and `claim` | + +### 3. Proof and authorization + +![img-ta-claim-verify](../../res/img-ta-claim-verify.png) + +#### 3.1 Generate QR code + +```json +{ + "action": "claimQuery", + "version": "v1", + "id": "10ba038e-48da-487b-96e8-8d3b99b6d18a", + "params": { + "dappName": "dapp Name", + "dappIcon": "dapp Icon", + "claimTemplate": "claims:yus_chinese_id_authentication", + "expire": 1546415363, + "callback": "http://101.132.193.149:4027/api/v1/claim/callback" + } +} +``` + +| Field Name | Type | Description | +| ---------- | ------ | ------------------------------------------------------------ | +| action | String | Action name, `claimQuery` | +| version | String | Version | +| id | String | Reserved id for the close loop of the transaction, random per request, expired in 24 hours by default | +| params | Object | Claim requirement parameters | + +Claim requirement parameters + +| Field Name | Type | Description | +| ---------- | ---- | ----------- | +| [TBD] | | | + +#### 3.2 Create anonymous credential + +Ref., [anonymous credential](../claim-store/anonymous-credential.md). + +#### 3.3 Send anonymous credential + +``` +url:/api/v1/claim/callback +method:POST +``` + +The corresponding claim of the local claim template and post to callback +```json +{ + "action": "claimCallback", + "version": "v1", + "id": "10ba038e-48da-487b-96e8-8d3b99b6d18a", + "params": { + "claim":"eyJraWQiOiJkaWQ6b250OkFhUEVnNzdmR3FqM2RZUDcxYUFrWnU3M0ZLc01KUWVxaTEja2V5cy0xIiwidHlwIjoiSldULVgiLCJhbGciOiJPTlQtRVMyNTYifQ==.eyJjbG0tcmV2Ijp7InR5cCI6IkF0dGVzdENvbnRyYWN0IiwiYWRkciI6IjM2YmI1YzA1M2I2YjgzOWM4ZjZiOTIzZmU4NTJmOTEyMzliOWZjY2MifSwic3ViIjoiZGlkOm9udDpBSnVhN0M2dGVvRlVzMktoUmVjcWJmYlB3ckY5OWtISGdqIiwidmVyIjoidjEuMCIsImNsbSI6eyJJc3N1ZXJOYW1lIjoiU2Vuc2V0aW1lIiwi5aeT5ZCNIjoi5LiB5bCP57KJIiwi6Lqr5Lu96K+B5Y+3IjoiMzQxMjgxMTk4NzA4MzA2OTA4In0sImlzcyI6ImRpZDpvbnQ6QWFQRWc3N2ZHcWozZFlQNzFhQWtadTczRktzTUpRZXFpMSIsImV4cCI6MTU5NTQxNDMzMywiaWF0IjoxNTYzNzkxOTM1LCJAY29udGV4dCI6ImNsYWltOnl1c19jaGluZXNlX2lkX2F1dGhlbnRpY2F0aW9uIiwianRpIjoiZDNlYzBjZWFkNWEzN2JjNTQ2OTAzODUwY2QxMGY4OTM0NGUyZWVlZGUwM2UxMGJmNTNhZjA1ZGI3YmY4NjY1NCJ9.AZniJRQtytUzoaWAS5CjnqQdTHD4mW9lQnyepwuzwkqA5ZeOM6Jr2ZnHI42R981YHCyRse7qHpC6xhxeQc0XunM=\.eyJUeXBlIjoiTWVya2xlUHJvb2YiLCJNZXJrbGVSb290IjoiYjFmNjUwMGI3MGM0ZGY3YmNlNDQ2MDgxNzIxNDQ1M2E3ZmI4MTZiNjMwZGI1NTRmZDFhM2FhMjgwZDM1ZTA3MSIsIlR4bkhhc2giOiI0MTEyYzE3MDM1OTljMWM1ZThmNmM5NWY4YTNjMGI0ZGYwMDk2MWU0NmIxZDdiMjk3MmY5MjVhYjIyZGM5OTViIiwiQmxvY2tIZWlnaHQiOjMwMzMzNDAsIk5vZGVzIjpbeyJUYXJnZXRIYXNoIjoiZTE0MTcyYzhhNmUxOTM5NDM0NjU2NDhlMWM1ODZhOTE4NmEzNzg0ZWU3ZWUyOWRiOWVkYmY2YWZlMDRmNTM5MCIsIkRpcmVjdGlvbiI6IkxlZnQifSx7IlRhcmdldEhhc2giOiJmNDQwNTMxOTk5YzU0N2RiMDhmNTE2Njc3YzE1MjIxNTQ3NWE2OWRjY2I4MjE3NmU0YmNhMWI3MjYyNjFhMWJlIiwiRGlyZWN0aW9uIjoiTGVmdCJ9LHsiVGFyZ2V0SGFzaCI6IjMzZDQ0ZmIxOTMxZWMwYTVjMjZiMzg1ZmZhYmQwYjUzYTQ5YTE4MDIxZWQxYjljMTEyNmU5ODAzNGFjNzZkNjAiLCJEaXJlY3Rpb24iOiJMZWZ0In0seyJUYXJnZXRIYXNoIjoiYzMzZTg5ZTZhYjcwZjg0YjY2MDkyYThjY2FjMjk5ZWY5MjBlNWQ0NTg2MDc3ZGFlNDk1M2I2MjFhN2Q4NDhjOCIsIkRpcmVjdGlvbiI6IkxlZnQifSx7IlRhcmdldEhhc2giOiI3YTI1MTA1NzkyNmQ5MTc0NGRlYjcyMWYyMjExYjZlZTIwODMwMzRkM2EzOWM5NzFjZDY2ZDhhMzNhMjI1OGU1IiwiRGlyZWN0aW9uIjoiTGVmdCJ9LHsiVGFyZ2V0SGFzaCI6Ijk1ZDY0YThhYmM2NzU5YzU1ZWJjYThiNzU0MGM5OGU0NWUxYzI4NWE4MDk0Zjg4MDdlMjI1NDI4NTRhMDZhOGIiLCJEaXJlY3Rpb24iOiJMZWZ0In0seyJUYXJnZXRIYXNoIjoiNjgxMTY1MmY1ZTI2ZDNjZDk0NjY2ZWI3MDkyMTMxYzU0NThkYTUxYzZmOTBlM2YxMDg3MDU5ODc2M2NjZGVkMSIsIkRpcmVjdGlvbiI6IkxlZnQifSx7IlRhcmdldEhhc2giOiJkNzE1YzllODE3ZmU4NjYzMTkzYjU5N2MzYjZhMjhiNTlmYTY4NWQxZjNmMjVhNjhkZmJhMGYyYzA2Y2I5MjFiIiwiRGlyZWN0aW9uIjoiTGVmdCJ9LHsiVGFyZ2V0SGFzaCI6IjFmMGU4ZTA2YmU5MGQzYTM2MWNlZTk5OWMwYWM5OGVkYjBmNjA4YTViMzNhMTU3ODM4ZTMyNWU0ZmFlMjRkY2MiLCJEaXJlY3Rpb24iOiJMZWZ0In0seyJUYXJnZXRIYXNoIjoiNjA5NDQyYmEyYjk5NWEzYTA4ZTk5ZmE3MTQ3ZDY4NDQ2YjNmY2IzYjNiZTU4ZmQ2MzI3NWU1NDAxM2M1YmM1MSIsIkRpcmVjdGlvbiI6IkxlZnQifSx7IlRhcmdldEhhc2giOiJiMGNkY2I2ZmM1NzRjMzQyMDgyMDYwNzllYzBiNDc4NDM1NGE4YzUwZGI4NTJkNGQ3ZGMzMjY1NjkwOTE5N2Q4IiwiRGlyZWN0aW9uIjoiTGVmdCJ9LHsiVGFyZ2V0SGFzaCI6Ijc5YTgyYzkzZGZiZWNjODhmNzZhYjMzMDk1NWMyZjY0ODlhMmYyNmFkOThhY2FiOGI3NDY4MWViNzJhYjM4YzYiLCJEaXJlY3Rpb24iOiJMZWZ0In1dLCJDb250cmFjdEFkZHIiOiIzNmJiNWMwNTNiNmI4MzljOGY2YjkyM2ZlODUyZjkxMjM5YjlmY2NjIn0=" + } +} +``` + +| Field Name | Type | Description | +| ---------- | ------ | -------------------------------------- | +| action | String | Action name, ` claimCallback` | +| id | String | Id returned from "3.1 generate qrcode" | +| version | String | Version | +| params | Object | Claim object | + +Response: + +```json +{ + "action": "claimCallback", + "id": "10ba038e-48da-487b-96e8-8d3b99b6d18a", + "error": 0, + "desc": "SUCCESS", + "version": "v1" +} +``` + +| Field Name | Type | Description | +| ---------- | ------ | ------------------------------------------------------------ | +| action | String | Action name, ` claimCallback` | +| id | String | Id returned from "3.1 generate qrcode" | +| error | int | Error code | +| desc | String | If successful, SUCCESS is shown; if failed, error description is shown | +| version | String | Version | + +## Appendix I. ABI of claim contract + +Sample only. + +```json +{ + "contractHash": "", + "abi": { + "hash": "", + "entrypoint": "Main", + "functions": [{ + "name": "Main", + "parameters": [{ + "name": "operation", + "type": "String" + }, { + "name": "args", + "type": "Array" + }], + "returntype": "ByteArray" + }, { + "name": "Commit", + "parameters": [{ + "name": "claimId", + "type": "ByteArray" + }, { + "name": "committerId", + "type": "ByteArray" + }, { + "name": "ownerId", + "type": "ByteArray" + }], + "returntype": "Boolean" + }, { + "name": "Revoke", + "parameters": [{ + "name": "claimId", + "type": "ByteArray" + }, { + "name": "ontId", + "type": "ByteArray" + }], + "returntype": "Boolean" + }, { + "name": "GetStatus", + "parameters": [{ + "name": "claimId", + "type": "ByteArray" + }], + "returntype": "ByteArray" + }, { + "name": "Upgrade", + "parameters": [{ + "name": "code", + "type": "ByteArray" + }], + "returntype": "Boolean" + }], + "events": [{ + "name": "ErrorMsg", + "parameters": [{ + "name": "id", + "type": "ByteArray" + }, { + "name": "error", + "type": "String" + }], + "returntype": "Void" + }, { + "name": "Push", + "parameters": [{ + "name": "id", + "type": "ByteArray" + }, { + "name": "msg", + "type": "String" + }, { + "name": "args", + "type": "ByteArray" + }], + "returntype": "Void" + }] + } +} +``` + diff --git a/prod-doc/en/ontid/framework/trust-anchor/saas-tenant.md b/prod-doc/en/ontid/framework/trust-anchor/saas-tenant.md new file mode 100644 index 00000000..643eac37 --- /dev/null +++ b/prod-doc/en/ontid/framework/trust-anchor/saas-tenant.md @@ -0,0 +1,15 @@ +# ONT ID Trust Anchor - tenant + +This document describes an easy way to provide credential services: become a tenant of Ontology public trust anchor service. + +## 1. Prerequisite + +*[TBD]* + +## 2. Configuration + +*[TBD]* + +## Appendix I. the pricing model + +*[TBD]* \ No newline at end of file diff --git a/prod-doc/en/ontid/framework/trust-anchor/smart-contract-api.md b/prod-doc/en/ontid/framework/trust-anchor/smart-contract-api.md new file mode 100644 index 00000000..3978cf90 --- /dev/null +++ b/prod-doc/en/ontid/framework/trust-anchor/smart-contract-api.md @@ -0,0 +1,131 @@ +# Claim - smart contract api + +代码预览: + +```c++ +{ + "contractHash": "", + "abi": { + "hash": "", + "entrypoint": "Main", + "functions": [{ + "name": "Main", + "parameters": [{ + "name": "operation", + "type": "String" + }, { + "name": "args", + "type": "Array" + }], + "returntype": "ByteArray" + }, { + "name": "Commit", + "parameters": [{ + "name": "claimId", + "type": "ByteArray" + }, { + "name": "committerId", + "type": "ByteArray" + }, { + "name": "ownerId", + "type": "ByteArray" + }], + "returntype": "Boolean" + }, { + "name": "Revoke", + "parameters": [{ + "name": "claimId", + "type": "ByteArray" + }, { + "name": "ontId", + "type": "ByteArray" + }], + "returntype": "Boolean" + }, { + "name": "GetStatus", + "parameters": [{ + "name": "claimId", + "type": "ByteArray" + }], + "returntype": "ByteArray" + }, { + "name": "Upgrade", + "parameters": [{ + "name": "code", + "type": "ByteArray" + }], + "returntype": "Boolean" + }], + "events": [{ + "name": "ErrorMsg", + "parameters": [{ + "name": "id", + "type": "ByteArray" + }, { + "name": "error", + "type": "String" + }], + "returntype": "Void" + }, { + "name": "Push", + "parameters": [{ + "name": "id", + "type": "ByteArray" + }, { + "name": "msg", + "type": "String" + }, { + "name": "args", + "type": "ByteArray" + }], + "returntype": "Void" + }] + } +} +``` + + + +#### 合约API: + +##### 合约地址:729635b7135e9eab97daed4e0b48e9f18a71410d + +1. 声明存证 + +``` +bool Commit(byte[] claimId, byte[] committerOntId, byte[] ownerOntId); +``` + +可信声明存证合约提供存证服务即存证可信声明Id,签发者ONT身份,属主ONT身份等信息,以及记录可用性信息即是否被吊销等信息。 + + + +提供的接口主要是 + +2. 存证查询接口 + +``` +byte[] GetStatus(byte[] claimId); +``` + +返回声明的状态,包含两部分信息: + +- 状态:”未存证“, ”已存证“, ”存证被吊销“; + +- 存证人ONT ID。 + + + +3. 吊销声明 + +``` +bool Revoke(byte[] claimId, byte[] revokerOntId); +``` + +当且仅当声明已被存证,且revokerOntId等于存证人的ONT身份时,才能成功吊销;否则,吊销失败。 + +在存证合约中,声明的唯一标识就是声明的ID,这个将被作为第一个参数,committerOntId就是存证人的ONT身份,ownerOntId是可信声明属主的ONT身份。 + +当且仅当该声明没有被存证过,且`Commit`函数是由committer调用,才能存证成功;否则,存证失败。 + +存证成功后,该声明的状态就是*已存证*(committed)。 \ No newline at end of file diff --git a/prod-doc/en/ontid/framework/trust-anchor/template-definition.md b/prod-doc/en/ontid/framework/trust-anchor/template-definition.md new file mode 100644 index 00000000..d735601f --- /dev/null +++ b/prod-doc/en/ontid/framework/trust-anchor/template-definition.md @@ -0,0 +1,16 @@ +### Claim Template definition + +- [Employment certification claim](./claimtemplate/employment-certification.md) + +- [CFCA real name certification claim](./claimtemplate/cfca-realname-certification.md) + +- [Email Mobile Claim](./claimtemplate/email_mobile_claim) + +- [Shuftipro Authentication](./claimtemplate/shuftipro_authentication.md) + +- [Idm Aauthentication](./claimtemplate/idm_authentication.md) + +- [social-claim](./claimtemplate/social-claim.md) + + + diff --git a/prod-doc/en/ontid/res/img-central-sign.png b/prod-doc/en/ontid/res/img-central-sign.png new file mode 100644 index 00000000..aea17400 Binary files /dev/null and b/prod-doc/en/ontid/res/img-central-sign.png differ diff --git a/prod-doc/en/ontid/res/img-claim-system.png b/prod-doc/en/ontid/res/img-claim-system.png new file mode 100644 index 00000000..54ae4332 Binary files /dev/null and b/prod-doc/en/ontid/res/img-claim-system.png differ diff --git a/prod-doc/en/ontid/res/img-overall.png b/prod-doc/en/ontid/res/img-overall.png new file mode 100644 index 00000000..4ffd7bf1 Binary files /dev/null and b/prod-doc/en/ontid/res/img-overall.png differ diff --git a/prod-doc/en/ontid/res/img-signsvr-general.png b/prod-doc/en/ontid/res/img-signsvr-general.png new file mode 100644 index 00000000..4cdc8a75 Binary files /dev/null and b/prod-doc/en/ontid/res/img-signsvr-general.png differ diff --git a/prod-doc/en/ontid/res/img-signsvr-id-action.png b/prod-doc/en/ontid/res/img-signsvr-id-action.png new file mode 100644 index 00000000..7f1e000f Binary files /dev/null and b/prod-doc/en/ontid/res/img-signsvr-id-action.png differ diff --git a/prod-doc/en/ontid/res/img-signsvr-ons-login.png b/prod-doc/en/ontid/res/img-signsvr-ons-login.png new file mode 100644 index 00000000..fae9ba4e Binary files /dev/null and b/prod-doc/en/ontid/res/img-signsvr-ons-login.png differ diff --git a/prod-doc/en/ontid/res/img-signsvr-ons-overall.png b/prod-doc/en/ontid/res/img-signsvr-ons-overall.png new file mode 100644 index 00000000..723ade74 Binary files /dev/null and b/prod-doc/en/ontid/res/img-signsvr-ons-overall.png differ diff --git a/prod-doc/en/ontid/res/img-signsvr-ons-register.png b/prod-doc/en/ontid/res/img-signsvr-ons-register.png new file mode 100644 index 00000000..e72b0bef Binary files /dev/null and b/prod-doc/en/ontid/res/img-signsvr-ons-register.png differ diff --git a/prod-doc/en/ontid/res/img-signsvr-overall.png b/prod-doc/en/ontid/res/img-signsvr-overall.png new file mode 100644 index 00000000..cae659bf Binary files /dev/null and b/prod-doc/en/ontid/res/img-signsvr-overall.png differ diff --git a/prod-doc/en/ontid/res/img-ta-case.png b/prod-doc/en/ontid/res/img-ta-case.png new file mode 100644 index 00000000..8ab965ce Binary files /dev/null and b/prod-doc/en/ontid/res/img-ta-case.png differ diff --git a/prod-doc/en/ontid/res/img-ta-claim-request.png b/prod-doc/en/ontid/res/img-ta-claim-request.png new file mode 100644 index 00000000..b8a67bf8 Binary files /dev/null and b/prod-doc/en/ontid/res/img-ta-claim-request.png differ diff --git a/prod-doc/en/ontid/res/img-ta-claim-verify.png b/prod-doc/en/ontid/res/img-ta-claim-verify.png new file mode 100644 index 00000000..48020329 Binary files /dev/null and b/prod-doc/en/ontid/res/img-ta-claim-verify.png differ diff --git a/prod-doc/en/ontid/res/img-ta-overall.png b/prod-doc/en/ontid/res/img-ta-overall.png new file mode 100644 index 00000000..13bbb287 Binary files /dev/null and b/prod-doc/en/ontid/res/img-ta-overall.png differ diff --git a/prod-doc/en/ontid/res/qrcode_img.png b/prod-doc/en/ontid/res/qrcode_img.png new file mode 100644 index 00000000..f0b81426 Binary files /dev/null and b/prod-doc/en/ontid/res/qrcode_img.png differ diff --git a/prod-doc/en/ontid/res/queryClaim.png b/prod-doc/en/ontid/res/queryClaim.png new file mode 100644 index 00000000..29de9fd2 Binary files /dev/null and b/prod-doc/en/ontid/res/queryClaim.png differ diff --git a/prod-doc/en/ontid/res/xjbg-sample.png b/prod-doc/en/ontid/res/xjbg-sample.png new file mode 100644 index 00000000..093685c9 Binary files /dev/null and b/prod-doc/en/ontid/res/xjbg-sample.png differ