智能合约系统解决方案 Intelligent Contract System Solution

1 背景概述 Background Overview

智能合约:“运行在区块链上模块化、自动执行的脚本,能够实现数据处理、价值转移、资产管理等一系列功能”

智能合约最大的优势是利用程序算法替代人为仲裁和执行合同。本质上讲,智能合约是一段程序,且具有数据透明、不可篡改、永久运行等特性。

智能合约无须中间媒介即可在合同主体之间直接交易,是一种基于算法的自动执行的合约。智能合约以效率性为突出优点,区块链技术能最大限度地保障交易透明性并保护当事人。智能合约由计算机预设,相较于人的订约,智能合约中语言误解的几率更低。

多方用户共同参与制定一份智能合约,合约中包含了双方的权利和义务,触发的条件以及触发后的执行的动作,使用编程语言编程实现,开源公示给各方。

到条件触发合约执行:条件可以是规定的时间、可以是外部输入的交易和数据(比如到货、初验、终验、招标、抵押等,这些交易由调用者发起并保存到区块链),部署合约的节点,共同执行合约内容完成之前指定的动作(比如付款、抵押、解抵押),利用共识算法把运行状态保存到区块链。

智能合约层负责将区块链系统的业务逻辑以代码的形式实现、编译并部署,完成既定规则的条件触发和自动执行,最大限度的减少人工干预。数据上链后难以修改、触发条件强等特性决定了智能合约的使用具有高价值。

Intelligent contract: "The script which runs on the block chain is modular and executes automatically, and can realize a series of functions such as data processing, value transfer, asset management and so on." The greatest advantage of intelligent contract is to use program algorithm instead of arbitration and execution contract. Essentially, intelligent contract is a program, and it has the characteristics of data transparency, non-tampering, permanent operation and so on. Intelligent contracts can be directly traded between contract subjects without intermediaries. It is an automatic execution contract based on algorithm. Intelligent contract takes efficiency as its prominent advantage. Block chain technology can maximize the transparency of transactions and protect the parties. Intelligent contracts are preset by computers, and the probability of language misunderstanding in intelligent contracts is lower than that in human contracts. Multi-user participation in the formulation of an intelligent contract, the contract contains the rights and obligations of both parties, trigger conditions and triggered action, using programming language programming, open source publicity to all parties. Conditions trigger contract execution: Conditions can be specified time, can be external input transactions and data (such as arrival, preliminary, final, tender, mortgage, etc.), these transactions are initiated by the caller and saved to the block chain, deploy the nodes of the contract, jointly perform the actions specified before the completion of the contract content (such as payment, mortgage, collateral removal), and use consensus computing. The method saves the running state to the block chain. Intelligent contract layer is responsible for implementing, compiling and deploying the business logic of block chain system in the form of code, triggering and automatic execution of established rules, and minimizing manual intervention. The characteristics of hard to modify and strong triggering conditions after data linking determine that the use of intelligent contracts has high value.

2 平台架构 Platform Architecture

      沃链以联盟链服务平台为技术支撑,以区块链行业应用为导向,将联盟链服务平台和区块链行业应用两条线并行发展。联盟链服务平台面向政府机构、企业、和产业联盟的区块链技术需求,提供区块链解决方案。区块链行业应用着眼于区块链技术的实际落地,以业务场景合作为主要模式,对行业痛点针对性的提供基于区块链的解决方案。同时以实际需求推动联盟链服务平台的技术发展

      沃链联盟链服务平台基于区块链技术建立了信任金字塔,分别是基于区块链账本的可信记录、基于国家授时中心的可信时间、基于手机盾的可信身份、基于数字签名的可信行为、基于智能合约的可信关系、以区块链技术锚定构建*度的数字网络社会。

      可为生态伙伴提供存在性证明、完整性证明、身份证明、时间戳证明、数据关系证明和凭证登记流转等能力;同时,联合联盟链各节点对数字身份、可信数据、数字凭证进行可信登记,向调用这些信息的第三方提供存在性、完整性、身份、时间戳、数据关系和凭证登记等信息。这些信息具备可验证、可审计、可追溯、不可篡改等特性。

Wochain take alliance chain service platform as technical support and block chain industry application as orientation. They develop alliance chain service platform and block chain industry application in parallel. Alliance Chain Service Platform provides block chain solutions to the technical needs of government agencies, enterprises and industry alliances. The application of block chain industry focuses on the actual landing of block chain technology and takes business scenario cooperation as the main mode to provide a solution based on block chain for Industry pain points. At the same time, it promotes the technological development of alliance chain service platform with actual demand.

The Wochain alliance chain service platform builds trust pyramid based on block chain technology, which is based on the trusted record of block chain account book, the trusted time based on national time service center, the trusted identity based on mobile phone shield, the trusted behavior based on digital signature, the trusted relationship based on Intelligent contract, and the digital network society anchored by block chain technology.

It can provide ecological partners with the ability of existence certificate, integrity certificate, identity certificate, time stamp certificate, data relationship certificate and voucher registration and transfer; at the same time, each node of the federation chain can trustfully register digital identity, trusted data and digital vouchers, and provide the third party that calls these information with the ability of existence, integrity, identity, time stamp, data relationship and vouchers. Registration and other information. The information is verifiable, auditable, traceable and untouchable.



图片1.png

3 技术架构 Technical Framework   

      智能合约平台由基础层、核心层、管理层、服务层、用户层等组成,体系结构如下图所示:

Intelligent contract platform is composed of basic layer, core layer, management layer, service layer and user layer. Its architecture is shown in the following figure:

图片2.png

1)基础层 Foundation layer

基础层实现联盟链系统网络中信息的记录、存储、验证和传播。区块链是建立在传播机制、验证机制和存储机制基础上的一个分布式系统,整个网络没有中心化的硬件或管理机构,任何节点都有机会参与总账的记录和验证,将计算结果广播发送给其他节点,且任一节点的损坏或者退出都不会影响整个系统的运作。

根据数据类型和系统结构设计,联盟链系统中的数据使用不同的数据存储模式。存储模式包括关系型数据库(如MySQL)和非关系型数据库(如LevelDB)。

The basic layer realizes the recording, storage, validation and dissemination of information in the network of alliance chain system. Block chain is a distributed system based on communication mechanism, verification mechanism and storage mechanism. There is no centralized hardware or management organization in the whole network. Any node has the opportunity to participate in the recording and verification of the general ledger. The results of calculation are broadcast to other nodes, and the damage or withdrawal of any node will not affect the operation of the whole system.

According to the data type and system structure design, the data in the federation chain system uses different data storage modes. Storage patterns include relational databases (such as MySQL) and non-relational databases (such as LevelDB).

2)核心层 Core layer

核心层包括共识机制、账本记录、数字签名、时序服务、智能合约等功能。

共识机制负责协调保证联盟链各节点数据记录一致性。在共识机制的协调下,共同步各节点的账本,从而实现节点选举、数据一致性验证和数据同步控制等功能。

在公有链中被证明有效的 POW 共识机制在联盟链中面临诸多挑战,其交易确认时间长、吞吐量性能低下、严重依赖算力竞争的记账确认机制存在安全隐患。POW 的算法无法为联盟链的可靠运作提供安全保障。

联盟链目前采用Kafka模式/PBFT(实用拜占庭将军容错)共识算法。

账本记录负责联盟链系统的信息存储,包括收集交易数据,生成数据区块,对本地数据进行合法性校验,以及将校验通过的区块加到链上。账本层将上一个区块的签名嵌入到下一个区块中组成块链式数据结构,使数据完整性和真实性得到保障,这正是区块链系统防篡改、可追溯特性的来源。典型的区块链系统数据账本设计,采用了一种按时间顺序存储的块链式数据结构。

联盟链采用基于账户的数据记录方式,基于账户的数据模型可以更方便的记录、查询账户相关信息。

联盟链在将数据保存到区块链上之前,可以把数据通过安全的加密方式,将敏感的*数据保护起来。另外,也可以将敏感的数据或文件通过数字摘要的方式,将其数据指纹保存在区块链上。

智能合约负责将区块链系统的业务逻辑以代码的形式实现、编译并部署,完成既定规则的条件触发和自动执行,最大限度的减少人工干预。

建立灵活、实用的智能合约系统是联盟链在系统实现上的核心目标之一。我们在技术路线上通过以下几点来实现:

定义标准化和良好可读性的合约中间语言指令集,使合约能够以人类可读的形式进行最终签署,有助于体现智能合约的法律效力;

支持 Java、Go 等主流开发语言作为合约的编程语言,降低合约的学习成本;

支持智能合约的模拟、调试功能,解决合约的可测试问题;

支持灵活的合约间调用和数据访问控制策略,更容易开发复杂的智能合约。

The core layer includes consensus mechanism, account record, digital signature, timing service, intelligent contract and other functions.

Consensus mechanism is responsible for coordinating and ensuring the consistency of data records of each node in the alliance chain. Under the coordination of consensus mechanism, the accounts of each node are jointly processed to realize the functions of node election, data consistency verification and data synchronization control.

The POW consensus mechanism, which has been proved effective in public chains, faces many challenges in alliance chains. There are security risks in its accounting confirmation mechanism, which has long transaction confirmation time, low throughput performance and depends heavily on computing competition. POW algorithm can not provide security for the reliable operation of alliance chain.

The alliance chain currently adopts Kafka mode/PBFT (Practical Byzantine General Fault Tolerance) consensus algorithm.

Account records are responsible for the information storage of the alliance chain system, including collecting transaction data, generating data blocks, verifying the validity of local data, and adding validated blocks to the chain. The ledger layer embeds the signature of the previous block into the next block to form a block chain data structure, which ensures the integrity and authenticity of the data. This is the source of tamper-proof and traceability characteristics of the block chain system. Typical block chain system data account design adopts a block chain data structure stored in time sequence.

The alliance chain adopts account-based data recording mode, and the account-based data model can record and query account-related information more conveniently.

The federation chain can protect sensitive * data by encrypting the data in a secure way before saving the data to the block chain. In addition, sensitive data or files can be saved on block chains by digitizing them.

Intelligent contract is responsible for implementing, compiling and deploying the business logic of block chain system in the form of code, triggering and automatic execution of established rules, and minimizing manual intervention.

Establishing flexible and practical intelligent contract system is one of the core objectives of alliance chain in system realization. On the technical route, we can achieve it through the following points:

Define a standardized and readable contract interlanguage instruction set so that the contract can be signed in a human readable form, which is helpful to reflect the legal effect of the intelligent contract.

L Supports Java, Go and other mainstream development languages as contract programming languages to reduce contract learning costs;

L Supports the functions of simulation and debugging of intelligent contracts, and solves the problem of testability of contracts.

L Supports flexible inter-contract invocation and data access control strategies, making it easier to develop complex intelligent contracts.

3)管理层 Management layer

节点认证与授权:联盟链通过 CA 认证授权实现联盟链节点准入机制。当一个新成员被准许加入联盟时,需将自己的公钥以及必要的身份标识信息发送给证书签证机构:CA。然后,CA 根据这些信息,为其颁发证书,作为加入联盟的许可认证,证书实际是由 CA 签发的对用户的公钥的认证。新成员发送消息时,需要附带自己的身份信息,其他节点收到该成员的消息时,对其身份进行认证,如果认证失败,则无法参与记账。所以,只有通过 CA 授权的成员,才会被联盟中的其他节点承认。

应用接入与授权: 联盟链支持傻瓜接口的方式实现存证与智能合约执行。应用接入通过密钥的方式进行授权,应用的接入与授权模块提供了对应用的增加、删除、授权等功能。

跨链服务管理:跨链服务定义了跨链所需的数据格式和数据接口,跨链服务的管理提供了跨链引擎模块部署、跨链服务的启动、停止等功能。

管理与监控平台:联盟链为用户提供了功能强大的 Web 管理控制平台,支持对底层平台的运维,灵活确定区块链部署的规模和节点运行状态。在底层系统之上实现了一套功能完备的 API 接口以助力基于上层应用的开发,Web 管理控制平台便是通过联盟链的 API接口与联盟链 进行交互,进而实现对区块链节点的实时监控报警、区块链日志的实时分析、区块信息的实时监控、历史浏览,以及智能合约的部署、调用和管理功能。

Node Authentication and Authorization: The alliance chain implements the node access mechanism of the alliance chain through CA authentication and authorization. When a new member is allowed to join the alliance, he or she must send his or her public key and necessary identity information to the certificate and visa authority: CA. Then, according to these information, CA issues certificates for it, as the license authentication of joining the alliance, the certificate is actually the authentication of the user's public key issued by CA. When new members Send messages, they need to attach their own identity information. When other nodes receive messages from this member, they authenticate their identity. If authentication fails, they can not participate in accounting. Therefore, only members authorized by CA will be recognized by other nodes in the alliance.

Application Access and Authorization: Alliance Chain supports fool interface to implement certificate and intelligent contract execution. Application access is authorized by key. Application access and authorization module provides functions of adding, deleting and authorizing applications.

Cross-chain service management: Cross-chain service defines the data format and data interface required for cross-chain service. The management of cross-chain service provides functions such as deployment of cross-chain engine module, start and stop of cross-chain service.

Management and Monitoring Platform: Alliance Chain provides a powerful Web management and control platform for users, supports the operation and maintenance of the underlying platform, and flexibly determines the size of block chain deployment and the running status of nodes. A set of fully functional API interface is implemented on the underlying system to facilitate the development of the application based on the upper layer. The Web management control platform is to interact with the alliance chain through the API interface of the alliance chain, and then realize the real-time monitoring and alarm of the node of the block chain, the real-time analysis of the block chain log, the real-time monitoring of block information, the history browsing, and the deployment of the intelligent contract. Call and manage functions.

4)安全 Security

联盟链在安全设计上,提供的特色服务有:多管齐下的加密保护、国产密码算法、国产CA的支持。

加密保护技术包括:数字指纹技术,HASH值上链,确保数据真实完整,但数据不上链;支持数据的传输限制在特定授权节点;支持用加密解密的方法对用户数据的访问采用权限控制;跨链技术,进一步消除外链应用的*顾虑。

国产密码算法是指联盟链支持SM2、SM3、SM4等算法,并支持国密算法的硬件实现,支持国内主流的加密机。

In terms of security design, the alliance chain provides special services such as multi-pronged encryption protection, home-made cryptographic algorithm, and support of home-made CA.

Encryption protection technology includes: digital fingerprint technology, HASH value up-link, to ensure that the data is true and complete, but the data is not linked; support data transmission limited to specific authorized nodes; support the use of encryption and decryption methods to access user data access authority control; cross-link technology, further eliminate the * concerns of external chain applications.

Domestic cryptographic algorithms refer to alliance chains supporting SM2, SM3, SM4 and other algorithms, and supporting the hardware implementation of national cryptographic algorithms, supporting mainstream domestic encryption machines.

5 应用场景 Application Scenario

      1)公证与记录领域 Notarization and Recording

  业务场景 Business scenario

  电子合同 Electronic contract

  证据保全 Preservation of evidence

  供应链金融/供应链管理 Supply Chain Finance/Supply Chain Management

  解决的业务痛点 Solve business pain points

  出证慢,流程长,易作伪 Slow certification, long process, easy to fake

  维权成本高 The cost of safeguarding rights is high

      2)数字资产领域 Digital Assets

  业务场景 Business scenario

  大数据交易 Big Data Trading

  共享经济 Sharing economy

  积分流通与通兑 Integral Circulation and Conveyance

  解决的业务痛点 Solve business pain points

  共享经济 Sharing economy

  数字资产交易 Digital asset trading

  积分流通与兑换 Integral Circulation and Exchange

     3)防伪溯源领域 Anti-counterfeiting traceability field

  业务场景 Business scenario

  医疗药品溯源 Traceability of Medical Drugs

  烟草溯源 Tobacco traceability

  食品溯源 Food traceability

  处方流转 Prescription circulation

  解决的业务痛点 Solve business pain points

  商品伪造 Commodity forgery

  商品难溯源 Goods are difficult to trace back to their origins

  ...









0

推荐

  • QQ空间

  • 腾讯微博

  • 新浪微博

  • 人人网

  • 豆瓣

  • 首页
  • 留言
  • 位置
  • 会员