Font Size: a A A

Programmable Smart Contract Design And Implement Based On DSL And Blockchain Technology

Posted on:2018-12-31Degree:MasterType:Thesis
Country:ChinaCandidate:Z N ZhuFull Text:PDF
GTID:2348330533466337Subject:Engineering
Abstract/Summary:PDF Full Text Request
Smart contract is a flexible transaction protocol,developed on the basis of digital encrypted currency and blockchain to implement and manage digital assets in a trusted execution environment.Domain Specific language(DSL)has powerful domain problem expression,higher abstraction layer,language refinement,user-friendly and efficient domain model.Blockchain technology has a de-centralized,data-ordered,programmable,secure and reliable technical features.Designing an easy-to-use description language and building a universal system execution model for smart contract is a prerequisite for popularizing and applying smart contract.For the application scenario from the smart contract modeling,design and implementation to the integration with the block chain technology,there is currently no systematic solution.The goal of this paper is to build decentralized,de-trusted,point-to-point distributed models using DSL and blockchain technologies to achieve smart contract programmability and enforceability of the environment.The basic idea is to use Fabric as the underlying block chain service,design the DSL describing the intelligent contract,and establish the mapping between the contracted text of the DSL description and the handling function of the chain code on ledger.The main work of this paper includes three parts:(1)Based on llvmlite,I design domain specific language(PSL,Programmable Smart contract Language)to describe smart contract.The design of PSL lexical analysis,syntax analysis,abstract syntax tree and LLVM IR code generation and interpreter construction are introduced in detail.Explore the interactivity and expansibility of DSL,and realize mutual call between PSL and host language,shared library.This paper proposes three methods to implement "domain feature" : IR built-in function,basic language library and shared library.(2)Construct the system model of programmable smart contract application.This paper explores the systematic method of constructing smart contract application.And designs and implements the system architecture,programming method and service interface.The framework of programmable smart contract system based on Thrift RPC and C / S model hides the details of the transaction process and provides a unified execution model for intelligent contract under different products and scenarios.(3)The prototype system is designed by taking the crowdfunding stake example.Design and implement of the crowdfunding contract description,ledger database,chain code processing functions.The method of shared library is adopted to realize the domain characteristic and state transformation to drive the execution of smart contract.The test data are presented: the transaction process includes verifying the node topology,block information and transaction data;Contract performance comparison for different end-user and authentication nodes,and time analysis of the system call link.Through the construction and testing of the prototype system,the programmability and credibility of the programmable smart contract are satisfied.The design of programmable smart contract has the following technical advantages: PSL is easy to use and has good scalability;using RPC communication,the transaction channel is easy to apply on multi-language and multi-platform;the framework of programmable smart contract system is universal and easy to extend.
Keywords/Search Tags:Smart contract, Domain Specific language, Blockchain, llvmlite, crowdfunding
PDF Full Text Request
Related items