| At present,the application of blockchain has gone far beyond cryptocurrency,which enables both sides of communication to build protocols according to predefined rules without relying on third parties.Various applications of smart contracts,including medical care,trade,transportation,Internet of Things,digital rights management and government departments,have been discussed worldwide.Because blockchain systems are closed,it is not possible to obtain new data directly from external systems during the execution of smart contracts,so the customized oracle is needed to provide the service of the out-of-chain data,and this is based on it.The first part is the design and implementation of smart contract of identity authentication and differential authorization,the second part is the establishment of a trust model according to the characteristics of oracle.The third part is the realization of the oracle trust model and the interface between oracle module and smart contract.(1)Design and implementation of smart contracts of identity authentication and differentiated authorization.On the platform of lightweight blockchain,users are registered,logged in,accessed resources,controlled authority and queried by smart contract technology.RBAC(Role-based Accessed Control)is introduced to simplify the privilege management of the platform and separate different users from different roles,so as to meet the needs of user authentication and differentiated authorization.(2)Establishment of trust model.This solves the problem of how to guarantee the reliability of external data.That is,trust management of the oracle module of the blockchain platform,distinguishing different trustworthiness of physical entities,quantifying trustworthiness,measuring it with mathematical methods and establishing a trust model.(3)Oracle module and the implementation of its interface with smart contract.This defines the communication interface between the smart contract and the oracle.The smart contract calls the oracle contract through the data request interface,and the smart contract needs to implement the callback interface to receive the callback of the oracle contract request result.To sum up,this thesis proposes a oracle module based on trust model in the authentication authorization block chain system,and verifies its feasibility of trust management by testing. |