Font Size: a A A

Research On On-chain Upgrade Method Of Token Smart Contracts Based On Blockchain

Posted on:2022-08-03Degree:MasterType:Thesis
Country:ChinaCandidate:Y X LiuFull Text:PDF
GTID:2518306551470644Subject:Master of Engineering
Abstract/Summary:PDF Full Text Request
With the mature development of blockchain technology,the use of smart contracts continues to expand,and the threshold for the development of smart contracts is gradually reduced.The security of smart contracts has received unprecedented attention.Because when smart contracts are deployed on the blockchain,anyone can't tamper with it,when there is a code bug in a smart contract deployed on the blockchain or a contract business needs to expand,smart contracts designed based on traditional patterns cannot be partially upgraded on the blockchain,developers can only discard the original contract and redevelop a new version of the smart contract and deploy it to the blockchain.The upgrade of the original smart contract,discarding the original contract,will seriously affect the normal call of users,and all the data generated by the original contract will be abandoned,causing great losses.Besides,redeploying a new version of the contract also makes it too expensive to upgrade the contract.Aiming at the problem that smart contracts deployed on the blockchain cannot achieve partial upgrades on the blockchain,the main research contents and results of this paper are as follows:(1)This paper proposes the Loose Coupling Smart Contract model(LCSC).Combining blockchain technology with the contract separation concept provided by Open Zeppelin platform,this paper proposes a new type of loose coupling smart contract model named LCSC as a new design pattern of smart contract for the Ethereum platform.The LCSC model divides the traditional smart contract into three subsets: interface contract,logic contract and data contract.The three subsets maintain the loose coupling relationship of calling each other and realize the transaction processing together.(2)This paper designs an on-chain upgrade scheme of the token contracts based on LCSC model.Based on the LCSC model,this paper takes the token smart contracts as the research object,and designs the on-chain upgrade schemes of the token contracts respectively for the two cases of contract code vulnerability and contract business demand expansion.The solution supports low-cost on-chain upgrades of the target token contracts in both cases of contract vulnerability and contract business expansion.(3)In this paper,a bidirectional version chain model of smart contracts is constructed.In view of the version management problem of smart contracts,this paper builds a two-way version chain model of smart contracts,forming a traceable,accessible and tamper-free version chain,which helps users to realize the version monitoring during the whole process of upgrading for smart contracts on the chain.(4)Finally,this paper conducts a system test experiment for the on-chain upgradation of token contracts on the Ethereum platform,and analyzes the feasibility of the on-chain upgrade scheme and the cost of the contract upgrade,the experiment verifies that the token contracts designed based on LCSC model can achieve on-chain partial low-cost upgrade,and the user interface and data generated by the smart contracts remain unchanged,the smart contracts upgrade operation do not affect the user's normal call to it.In addition,the version iteration of the smart contracts can be traced through the two-way version chain of the smart contracts.
Keywords/Search Tags:Blockchain, Smart contract, On-chain upgrade, Ethereum, Loose coupling
PDF Full Text Request
Related items