Font Size: a A A

Design And Implementation Of Smart Contract Based On Multi-node Off-chain Transaction

Posted on:2024-02-28Degree:MasterType:Thesis
Country:ChinaCandidate:H LeiFull Text:PDF
GTID:2568307130453024Subject:Software engineering
Abstract/Summary:PDF Full Text Request
The blockchain technology has broad application prospects because of its properties of decentralization,traceability,and immutability.However,it has a serious bottleneck of transaction performance,and there is still a big gap between the practical application,facing the problem of insufficient scalability.The payment channel technology shifts transactions to the off-chain through the deposit mechanism,realizing instant off-chain settlement and improving transaction performance.However,one payment channel can only contain two nodes.When facing the off-chain transactions of multiple nodes,payment channels need to be created frequently,which leads to the problem of information redundancy.In addition,the payment channels are independent of each other,and ultimately much on-chain transactions are still required to return the funds in these payment channels,resulting in high fees and storage costs.This thesis focuses on the problems faced by payment channel technology in multi-node off-chain transaction scenarios,and conducts the following research:(1)To address the problem of frequent creation of payment channels due to the limited number of nodes in payment channel technology,this thesis proposes a scalable architecture for a multi-node off-chain transaction system based on smart contract technology.This architecture is applicable to service delivery application scenarios,including but not limited to supply chain management and medical systems.According to the system structure,this thesis designs the similar off-chain transaction logic of payment channel structure,and introduces the hashed timelock mechanism,which not only realizes the off-chain transactions between any nodes in the system,but also supports the cross-node off-chain transactions between different structures outside the system,thus achieving the compatibility with each other.Finally,the security analysis shows that the security of funds can be guaranteed in the off-chain transaction,and the experimental results prove that the proposed scheme can meet the high efficiency of off-chain transactions with lower fees and storage cost.(2)To address the problem that returning multiple funds in the payment channel technology requires multiple on-chain transactions,this thesis proposes the efficient algorithms to return funds based on the proposed multi-node off-chain transaction system.Its core is to submit the information set of multiple funds through one on-chain transaction and process these funds at once,thus binding multiple on-chain transactions into one on-chain transaction.Considering the various ways of returning funds and the possible malicious behaviors,verification mechanism,rollback mechanism,delay mechanism and punishment mechanism are introduced to guarantee the security of funds.Finally,through the performance analysis and experimental analysis,the algorithms we proposed outperform the existing payment channel off-chain transaction scheme in terms of fees and storage cost.(3)We design and implement the multi-node off-chain transaction system.Using the concept of modular programming,the system is divided into the on-chain smart contract module and the off-chain front-end and back-end modules.We implement the multi-node off-chain transaction prototype system based on the Truffle framework,Go crypto library,and Web3.js library.The corresponding logics of the on-chain smart contract is adapted and executed under the chain.Finally,we provide the front-end UI interactive interface,and display the main function interface of the system.
Keywords/Search Tags:Blockchain, Scalability, Smart Contract, Multi-Node Off-Chain Transaction, On-Chain Transaction
PDF Full Text Request
Related items