APP下载

Electronic Auction Scheme Based on Smart Contract and IPFS

2023-02-20WUXiaohuaLIUHuanWUFenghengZHANGKe

计算机工程 2023年2期

WU Xiaohua,LIU Huan,WU Fengheng,ZHANG Ke

(1.School of Information and Software Engineering,University of Electronic Science and Technology of China,Chengdu 610054,China;2.Chengdu Huanhaishaqiu Network Technology Co.,Ltd.,Chengdu 610041,China)

【Abstract】 Sealed-bid auctions are a vital transaction tool in the e-commerce field.Traditional centralized auction schemes typically result in severe threats to data integrity,information transparency,and traceability owing to their excessive reliance on third parties,and blockchain-based auction schemes generally suffer from high storage costs and are deficient in functional and architectural design.To solve these problems,this study presents a sealed-bid auction scheme that removes the third-party based on an Ethereum smart contract,ensuring data integrity,openness,and transparency in the execution process.The commitment mechanism and distributed storage system help to significantly reduce the user′s storage cost and protect the privacy of user bids.For the functional design,this study introduces a fulltext-retrieval and dispute-processing module for commodities,which reduces the defects existing in the functional module design of existing auction systems.Furthermore,a prototype auction system on the Ethereum test chain is built to validate the proposed scheme.Experiments show that compared with traditional storage methods,indirect storage based on a distributed storage system of texts and images can reduce the storage cost by at least 50% while ensuring data integrity.Finally,the gas cost at each stage of the auction scheme and the time required for the full-text retrieval of products are recorded to evaluate the scheme performance and analyze the test results.

【Key words】 sealed bid auction;Ethereum;smart contract;commitment;Interplanetary File System(IPFS)

0 Introduction

Auctions are a powerful financial transaction tool that has played an enormous role in rapid economic development.Auctions have huge advantages over other buying and selling methods.In the auction process,bidders have equal purchase qualifications,equal opportunities to buy products under transparent and open auction rules.Through the participation of multiple people and equal bidding,the maximum value of the goods can be realized.Therefore,more indepth research and improvement of existing auction schemes have essential practical significance.

Auctions can be divided into public auctions and sealed-bid auctions,according to whether the bids are open or not[1].In the open bidding mechanism,each bidder can see the current highest bid in real time and decide whether to submit a higher price.After multiple rounds of bidding or the auction ends,if there is only one bidder with the highest bid left,he or she will be the winning bidder.In a sealed-bid auction,bidders first submit their bids secretly within a specified time,and after the specified time,the auctioneer opens all bids and selects the winning bidder according to the auction rules.In a sealed auction,except for the winner′s bid,the bids of the other bidders are kept secret,which can effectively protect the anonymity of the bidder′s identity and the privacy of the bid.Sealed auction is the most widely used auction method nowadays.

With the rapid development of the Internet,electronic auctions[2-4]have received more and more attention due to the efficiency and convenience of transactions.The main roles of traditional electronic auction schemes include sellers,bidders,and thirdparty platforms[5].Most third-party platforms are centralized institutions that build a trading platform for sellers and bidders.There are many drawbacks to this centralized auction scheme.First,the transaction method is unfair because the centralized platform has a central dominance over users.It can decide whether a product can be listed and even ban the merchant.Second,users need to bear high fees for the services provided by platforms when merchants list products or users conduct product transactions.Finally,the privacy of users can be easily breached because the third-party will store all the details on their servers.Detailed information includes the personal information and transaction information of users.Among them,information about the bidding price of a buyer is especially vital.If a third-party leaks the bidding price information to other users,it will breach the privacy of the user and even affect the normal execution of the transaction,imposing a significant threat to system security.Therefore,it is necessary to remove thirdparty platforms from the auction process.

There has been much research on sealed auctions.Literature [6]designed a sealed electronic auction protocol with no third-party participation.This protocol can protect bidders′ privacy,but almost all calculations need to be completed by the seller,which leads to a heavy burden of calculation and communication as well as a reduction in efficiency.Literature [7]proposed a sealed auction scheme based on an untrusted third-party,protecting the privacy of bidders through digital signature technology.Once the winning bidder is confirmed,the correctness of the result and the security of the scheme are guaranteed based on the discrete logarithm problem.Literature [8]applied the blind signature technology to the bit commitment stage and designed a sealed auction scheme to ensure the privacy and security of the agreement through bit commitment.The British electronic auction scheme proposed by Literature [9]realizes the anonymity and traceability of bidders in the form of bulletin boards.However,their scheme cannot disclose the information of bidders,which threatens the fairness and continuity of the scheme.

In recent years,with the rapid development of blockchain technology[10-12],it has been successfully applied in many fields such as electronic cash,the Internet of Things(IoT),and energy trading[13].More and more researchers want to free electronic auctions from the adverse effects of third-party platforms by taking advantage of the decentralized nature of blockchain.Literature[14]proposed a sealed-bid auction scheme based on Ethereum smart contract.This scheme guarantees the accuracy and fairness of the sealed bid auction scheme.However,the selection of the winner is easily influenced by the auctioneer.Then,Literature [15]proposed a concise and verifiable sealed bid auction scheme based on Ethereum smart contract.The scheme uses zk-SNARKs to achieve non-interactive public verification of bidders.Literature [16]built a bidding system using the Hyperledger Sawtooth framework.The system is implemented based on the alliance chain.However,it is only suitable for certain scenarios because of its limited degree of decentralization.Literature [17]used Ethereum smart contract to build a bidding system for public auctions,ensuring confidentiality and nonrepudiation.However,the Literature [17]gives only the auction system structure and does not give the implementation details and experimental results of the system.Literature[18]proposed an electronic auction protocol based on Ethereum smart contract.The protocol uses blockchain technology to ensure the confidentiality,non-repudiation,and immutability of sealed electronic auctions,but does not consider the cost of data storage for users on Ethereum.According to the notes at the end of their study[18],the protocol implementation uses a consensus mechanism "solo"[19],which is suitable for proof-of-concept and not suitable for production systems.

These blockchain-based auction schemes generally suffer from high storage fees due to the gas cost of storing data on the blockchain and modifying the contract state.However,current solutions generally do not give detailed research and analysis results on user storage costs.Most of them just focus on the performance of the contract itself.Furthermore,the program module design is not perfect.Most of the current auction schemes only consider the design and implementation of the critical steps of the protocol and lack in-depth analysis on the design of modules such as commodity retrieval.

In order to solve the above problems,this study implements a low-cost sealed bid auction scheme based on the Ethereum smart contract and the introduction of a distributed storage system.First,we propose a low-cost sealed-bid auction scheme based on Ethereum.The scheme uses Ethereum smart contract to interact with sellers and bidders to ensure data integrity and open and transparent execution.The commitment mechanism and distributed storage system achieve low-cost storage for users while protecting bid privacy.Second,we implement an auction system prototype to improve the existing blockchain-based auction system built on the proposed auction scheme.By introducing ElasticSearch,we design an off-chain synchronous query module to achieve fulltext retrieval of commodity content and set up escrow contracts to supervise and process disputed transactions.Finally,we evaluate the storage cost of users and contract performance by implementing experiments in the test environment.

1 Auction scheme description

Because of the shortcomings of existing auction schemes,this section provides a low-cost sealed bid auction scheme based on Ethereum smart contract and distributed storage system.The proposed auction scheme is suitable for First Price Sealed Bid Auctions(FPSBA).The design and implementation process of the auction scheme will be introduced below.For ease of reference,essential variables are shown in Table 1.

Table 1 Variables definitions

1.1 Interactive subject

As shown in Fig.1,the auction scheme consists of five interactive subjects,namely buyers,sellers,the Ethereum blockchain,smart contract,and distributed storage system.

Fig.1 Interactive subject of the auction scheme

Buyers and sellers are the primary users of the agreement.The seller is responsible for publishing product information to the smart contract and initializing parameters such as auction start time,duration of each stage,etc.Buyers compete for items through sealed bids,with the highest bidder winning.

Ethereum[20-22]is an open-source,public blockchain platform that supports smart contract,proposed by BUTERIN in 2013.The auction smart contract is coded using Solidity 0.5.25 in the Truffle framework.Truffle is a world-class development environment and testing framework supporting deploying,debugging,and testing Ethereum contracts[23].

Due to the limitation of blockchain on storage,the combination of the distributed storage system and blockchain can ensure data integrity and reduce the storage cost of users.Commonly used distributed storage system include Interplanetary File System(IPFS)[24],FileCoin[25],and Swarm[26].This study uses the interplanetary file system to store product information.

1.2 System architecture

The system architecture is shown in Fig.2,which can be divided into three layers as a whole,namely the data storage layer,the contract service layer,and the user interaction layer.

Fig.2 System architecture

The data storage layer stores all the data of the auction system.IPFS mainly stores the introduction information and pictures of products.The core data of the auction are stored in Ethereum,including user ID,user bid commitment,etc.ElasticSearch updates data synchronously by subscribing to events in Ethereum and provides full-text retrieval functions by directly querying off-chain databases when users query product information.

The contract service layer includes auction smart contract and escrow contract for user dispute processing,providing core functional interfaces for auctions.

The user interaction layer makes it easy to browse and view commodity information and participate in the auction by writing HTML pages.

1.3 Implementation of contract services

We propose that the sealed bid auction scheme consists of seven stages corresponding to each contracted service module in execution order.These seven stages will be executed in sequence.

1.3.1 Register and log in

All buyers and sellers must register as legal users before participating in the auction.The user completes the registration by calling the registration function in the smart contract.The successful execution of the registration function will return the user a legal identity ID,a public key,and a private key.Inside the registration function,the public key of the smart contract is automatically used to encrypt and store the user′s identity ID on the blockchain to ensure privacy.

1.3.2 Product publishing

After users register as legal users and login into the system,they can publish products to the blockchain by calling the publish product service.The launch product phase mainly performs the following tasks:

1)Check whether the user′s identity is legal and return the result.

2)Receive the description information,pictures,auction time(auction start timeT1,deadline for submitting bid commitment stageT2,and deadline for revealing bid commitment stageT3),the minimum number of biddersN,and the minimum starting priceps.

3)Upload the description text and pictures of the product to the IPFS network to obtain the corresponding hash address.

4)The smart contract creates commodity objects according to the initial parameters and stores them in the Ethereum blockchain.

1.3.3 Product search

Because it is difficult to search for commodities on the blockchain,the commodities in the platform are characterized by their large quantities,various categories,and miscellaneous contents.Therefore,this study uses the ElasticSearch full-text index off-chain database to implement this function.ElasticSearch is implemented based on Lucene.It uses the inverted index to store data and still has high-speed search performance for massive data.

In terms of usage,an ElasticSearch instance first obtains data from the MySQL database that stores standard data and then parses the data through a tokenizer to generate multiple fields.Then a document is built,and finally IndexWrite is used to build the index and put the index into the index library,which contains document number,term frequency,position,offset,etc.

After the user enters the search keyword,the system first matches the keyword with the index in the index database and finally returns the result to the user after calculating the TF-IDF algorithm.Users can search and filter products by calling the SearchProduct service.The specific steps are as follows:

1)When a user posts a product to Ethereum,a product creation event is triggered.The off-chain database synchronously updates the latest product data to the off-chain database by subscribing to the product creation event of Ethereum.

2)When a user searches for a keyword of a product,the ElasticSearch application instance searches the offchain database to determine whether the relevant product exists.If the item does not exist,return null directly.

Finally spring burst into glorious green and Reuben s spirits erupted. The time had come! He ran into the barn, climbed to the hayloft and uncovered the tin can. He poured the coins out and began to count.

3)If the product exists,ask the user to specify keywords for further filtering.If not,all product information will be displayed.

4)If further filtering is required,continue to ask the user to specify keyword sorting and return the processing result.

1.3.4 Bid commitment submit

We use a commitment mechanism in cryptography to protect the privacy of bids.A commitment is a promise to sensitive data to ensure that a verifier can verify the truth of the promise at a specific time in the future.The bidder′s bid in this paper is sensitive data.

A commitment scheme includes two roles of the committer and the verifier,and there are three phases:initialization phase,generating commitment phase,and revealing commitment phase.An algorithm for generating commitments and initialization parameters needs to be selected for use in the subsequent two phases in the initialization phase.In generating commitments,the committing party uses bids to generate commitments according to the commitment algorithm.The verifier ensures that the committer is honest by verification during the verification phase.

An excellent commitment scheme needs to deliver excellent anonymity and binding.Anonymity means that the generated commitment guarantees that nothing other than the promise itself will be revealed about the original secret data.Binding means that once a promiser generates and publishes a commitment,it cannot replace its secret value with any other secret data.

Commonly used commitment algorithms include hash commitment and Pedersen commitment.The hash commitment is generated as shown in Equation(1).In Equation 1,pis the personal data to be protected,Cis the generated commitment,and HASH is a specified hash function,such as the SHA series of hash algorithms designed and published by the most widely used NSA[27].The essence of the hash commitment is to rely on the one-way hash function to ensure the anonymity of the promised result.However,the hash function produces a deterministic result for each unique secret value.Attackers can decipher the secret value through enumeration,thereby destroying the privacy of the data.

The generation of Pedersen commitments[28]is shown in Equation(2).GandHin Equation(2)are the two initial points on the elliptic curve,pis the personal data to be protected,ris a random value,andCis the generated commitment.Pedersen commitment is a more stealthy and secure commitment algorithm based on Elliptic Curve Cryptography(ECC).By introducing the random valuer,the randomness of the commitment value is enhanced,and the brute force attack of enumeration can be resisted simultaneously.When two initial points on the elliptic curve are selected for the unique secret valuep,the same secret data can be mapped to different commitments by selecting different random valuesr.

1)When a legitimate bidderbidecides to bid on a commodity of interest,he secretly selects a bid pricepiand a random numberri.

2)The bidderbicalculates the bid commitmentCilocally by Equation(3)and submits the commitmentCiand the depositdito the smart contract.

3)The smart contract verifies whether the deposit is greater than the starting price,and after the verification is passed,it is stored in the blockchain,and a notification message of successful submission is returned to the user.

1.3.5 Bid commitment revealing

During the revealing bid commitment phase,the main flow of execution is as follows:

1)The bidderbisubmits the bidpiand the random numberrito the smart contract.

2)The smart contract verifies whether the current time is greater thanT1,verifies whether the caller′s identity is legal,and terminates if it is abnormal.

3)The smart contract recalculates the commitmentaccording to Equation(3)andpi,ri.Then comparetoCiand pass if equal.

4)The smart contract selects the final winnerbwby comparing the bid size of each bidder and records it in the blockchain.

1.3.6 Dispute handling

When all bidders have revealed their bids,the bidders can be verified according to the winner information published by the smart contract.Ifbifinds that his/her bid is higher than that of the winning bidder,he or she can apply for a new judgment.We implemented a vote counter inside the contract by setting an escrow contract in the dispute processing,allowing all participating bidders to vote.The winning bidder is determined when votes are greater than two-thirds of all bidders.We assume that most users of the system are honest.

In the dispute resolution stage,the main processes performed are as follows:

1)The bidderbirequests to recalculate the winner and announcepi,ri.

2)The remaining bidders recalculate the commitmentaccording to Equation(3)and compare them withCi.If they are not equal,it means thatbiprovides a fake bid value.

3)Ifbiis honest,compare the size ofpiandpw,and decide whether to vote forbi.

4)The escrow contract re-announces the winnerbwaccording to the voting results.

1.3.7 Auction finish

In the dispute resolution stage,the main processes performed are as follows:

1)The smart contract refunds the deposit of the unsuccessful bidder.

2)The smart contract transfers the winner′s bid to the seller.

3)Notify users that the auction is over.

2 Analysis and comparison

2.1 Analysis of program characteristics

The proposed sealed bid auction scheme not only satisfies the essential characteristics of the sealed auction but also realizes data integrity and low storage cost for users through smart contract and IPFS.The detailed characteristic analysis is as follows:

1)Decentralization:the proposed auction scheme will remove the third-party in the traditional auction scheme so that the publishers and bidders of commodities can directly conduct transactions through blockchain smart contract.

2)Fairness:bidders have equal status,and all bidders can equally obtain lot information and submit bid information from smart contract.

3)Correctness:the proposed auction scheme needs to ensure the correctness of the auction results.There is only one winner with the highest bid in the end.

4)Bid privacy:each bidder enjoys privacy protection of their actual bids,and will not be able to know the actual bids of others when submitting their bid commitments by the deadline.

5)Nonrepudiation:each user is uniquely bound to his or her bid commitment,and the previous bid cannot be denied after the winner is revealed.

6)Unforgeability:once a bidder has determined a commitment during the bidding phase,he cannot forge his bid commitment during the verification phase.

7)Low storage cost:the seller can publish the introduction text and pictures at a low gas cost.

8)Full-text search:when a user searches for a product,the system background will perform a full-text search of the product data in the off-chain database according to the keyword to improve the query speed and return the query result to the user in time.

2.2 Comparative analysis

From the perspectives of decentralization,fairness,correctness,etc.,we give an analysis of the proposed sealed bid auction scheme,and compare it with the existing blockchain-based schemes.

The comparison results are shown in Table 2.Both CHENG[7]and GALAL[14]provide a relatively complete solution and meet most of the indicators,but their common problem is that they ignore the high storage cost resulting from storing a large amount of commodity data on the blockchain.Furthermore,the scheme proposed by GALAL[14]needs to rely on the auctioneer to select the winning bidder,which will threaten the security of the protocol.Comparison results show that the auction scheme proposed by this study has the essential characteristics such as correctness and fairness required by the sealed bid auction,and can also realize decentralization of the protocol and low storage costs for users.

Table 2 Comparison of three auction schemes

3 Experimentation and evaluation

In this section,we experimentally evaluate a prototype implementation of the auction scheme.The main issues we want to evaluate are the user′s storage cost and the performance of the system.

3.1 Experimental environment setting

In order to ensure the authenticity of the test,we complete all experiments on the Ethereum test chain platform Ropsten.We first deploy the smart contract on the Ethereum blockchain using Truffle,and then package the application and deploy it to a cloud server.Real-world buyers and sellers are simulated with ten computers equipped with Intel i5 CPU,8 GB RAM,and 1 000 Mb/s network links.The specific configuration of the test environment is shown in Table 3.

Table 3 Test environment configuration

3.2 Storage cost evaluation

Operations in the Ethernet network,such as modifying variables in a contract or storing data in the blockchain,cost gas.The gas cost of executing a transaction in Ethereum is a direct measure of the work of the operation.There are two main costs to executing transactions and submitting data to the blockchain.The execution cost includes modifying contract variables and the contract state.The other is transaction costs,including execution costs and the cost of submitting data to the blockchain[29].

The blockchain will save the pictures and related description information of the goods and other essential auction data in the auction system.The pictures and descriptions of the products are essential references for buyers to participate in the auction.It is necessary to ensure the integrity and traceability of this information.The storage cost analysis in this section mainly evaluates the cost of storing image and text information on Ethereum.

3.2.1 Text storage cost

The blockchain auction schemes implemented in the Literature [10-14]all use strings to store information.Taking the description information of the product as an example,it generally takes 50 to 300 words to accurately describe the configuration,functional characteristics,and other information.By deploying smart contract in the test environment,we test the transaction cost of directly storing different numbers of words in Ethereum.Furthermore,compared with the transaction cost of storing the text content address(CID)in this study,the results are shown in Fig.3.

Fig.3 Comparison of transaction gas costs for storing text

When storing auction item information directly in string format,each word requires execution cost because they need to occupy the storage space of Ethereum.It can be concluded from the experiments that when storing auction item information directly,the user′s storage cost is proportional to the number of words.For every 50 words added,the user needs to pay an additional cost of 200 × 103gas.However,by storing the CID of the text,the user′s cost is not proportional to the number of words stored.When a user submits text to an IPFS node,the IPFS node returns a fixed-length content address,thus controlling the user′s storage cost.The experimental results show that the transaction cost of using IPFS CID storage is about 200×103gas cost for any number of words.By storing IPFS CIDs,users can reduce costs by 50% to 85% when their stored text is between 50 and 300 words in length.Of course,the premise of this situation is to use a CID.IfkCIDs are stored,the cost to the user also increases by a factor ofk.

3.2.2 Image storage cost

Pictures are the most intuitive form of understanding commodities.However,most blockchain-based auction schemes[10-14]do not consider the necessity of storing pictures.Since pictures cannot be directly stored on Ethereum,one solution is to convert the picture data in Base64 encoding format and store the converted string in Ethereum.The inverse operation is performed when the original image needs to be obtained.After experiments,we find that this method is less effective in practice and can only store images of tiny sizes.As the image size increases,the cost to the user becomes unacceptable.We calculate the number of characters after converting 3 KB to 6 KB images using the Base64 encoding format.Finally,the result is stored on Ethereum to evaluate the transaction cost.The calculation results are shown in Table 4.A more intuitive transaction cost is shown in Fig.4.

Table 4 Cost of storing images in Base64 encoding format

Fig.4 Comparison of transaction gas costs for storing image

The solution using Base64 encoding is not feasible because the size of the picture will directly affect the character length after encoding conversion.From the experiments in the previous section,we know that the length of characters is proportional to the transaction gas cost.The solution for storing IPFS CIDs is used to hash the images using a hashing algorithm and then store the hash results in Ethereum.Due to the compressibility of the hash function,inputs of different lengths can be guaranteed to obtain the same length of results.Thus,the invariance of transaction gas cost can be guaranteed.However,after analysis,we found that although this solution solves the problem of transaction cost,it cannot inversely calculate the picture information according to the hash result.

IPFS encapsulates the traditional hash function and uses the multi-hash method to calculate a file or image[30].At the same time,it provides IPSE,a content search engine on the IPFS network.We test the transaction cost of storing the image content address(CID)in Ethereum and compare it with the transaction cost of using Base64 encoding.

It can be seen from the experiment that as the image size increases,the storage cost of users will increase proportionally.An average of 1 KB of storage costs 1.1×106gas.By storing the CID of the image,the transaction cost of users can be kept constant,which is about 200×103gas.Furthermore,when the image is 3 KB,the storage cost of users can be reduced by about 93% by storing the IPFS CID.Therefore,using IPFS CID in our proposed auction scheme can significantly reduce the storage cost of users.

3.3 System performance evaluation

This section evaluates the performance of the scheme by testing the gas cost of each stage of the auction scheme and the time-consuming full-text retrieval of products.In constructing the dataset,we reconstruct the eBay auction dataset[31]by writing scripts.

3.3.1 Time-consuming analysis of ElasticSearch

An important indicator to measure the search product is the response time of the system.We store 30 000 item data as the experimental object by reconstructing the eBay auction data set.We take the title field,brand,and description information of the product as the keywords of the index.We search the keywords "phone,Huawei,Apple,computer" ten times in the testing phase and record the average time spent in ElasticSearch and MySQL.The experimental results are shown in Fig.5.

Fig.5 Comparison of search times

It can be seen from the experiment that for different keywords,the search time of ElasticSearch fluctuates within a narrow range.Overall,the proposed ElasticSearch-based full-text retrieval scheme takes much less time than that based on traditional MySQL databases.

3.3.2 Smart contract gas cost

We simulate the bidding process of buyers and sellers in the test environment and record the gas cost of each transaction.By controlling the difference in the number of participating bidders,the total gas cost of each transaction stage is tested in each round of auction activities.The results are shown in Fig.6.

Fig.6 Total transaction gas cost in each stage

As can be seen from Fig.6,the gas cost of deploying the contract in each auction is almost constant.Since the data structure and the item of the auction contract are constant,the total cost of the item publishing stage is also almost constant.The total cost of submitting the commitment phase,revealing the commitment phase,and closing the auction phase increases proportionally as the number of auctions increases.

Overall,the total cost of revealing the commitment phase is the highest,followed by the total cost of closing the auction phase and the least total cost of revealing the commitment phase.The total cost of each stage is closely related to the amount of computation and storage.

Our analysis reveals the total cost spent in the commitment phase.Inside the contract,the Commitment needs to be calculated based on the bidder′s information and compared with the previous commitment to judge whether the user is honest.The revealing commitment phase requires more gas than other phases due to more complex computations.

It should be noted that the gas of the contract operation is fixed,but the value of Ether that the user spends for each transaction is variable.The amount of Ether paid by the user equals the gas price multiplied by the gas.Since miners will prioritize packaging for higher gas prices,transactions will be processed faster when users are willing to pay a higher gas price.

According to the data released by ETH Gas Station[32],on June 25,2020,the exchange rate of Ether is about 1 Ether=241 USD,and the gas price is about 30 Gwei.We convert the average cost of each stage of the system based on the ratio of Ether to gas,and the calculation results are displayed in USD,as shown in Table 5.

Table 5 Average transaction gas cost in each stage

We compare the calculated gas cost with the eBay online auction platform.When users sell items on the eBay platform,they will be charged 9% of the sale price as a service fee,up to a maximum of 50 USD[33].However,the cost of each stage of our auction scheme is controlled at 1 USD to 5 USD,which shows that adopting an auction system based on blockchain smart contract is relatively cheaper than existing centralized auction platforms because it eliminates service fees paid to third-party providers.

For the different bidders,we test the gas cost of each transaction stage in each auction round.Then,the overall transaction gas cost of the user is calculated,and the result is shown in Fig.7.

Fig.7 User's total transaction gas cost

In an auction event,the cost of the seller is almost constant,and the seller only needs to deploy the contract and publish the product information to the blockchain.The total cost of bidders increases with the number of people,but the average cost per bidder is about the same and remains low.Therefore,the total transaction cost for users is also meager.

4 Conclusion

This paper provides an auction scheme based on Ethereum smart contract and distributed storage system.Without a third-party intermediary,the proposed scheme can rely on smart contract to complete the entire sealed-bid auction process.In the function realization of the system,we provide the fulltext retrieval and dispute processing module of commodities,which improves the functional defects of the current auction system.Furthermore,we test the gas spent at each stage of the auction solution and the elapsed time for full-text retrieval of products to evaluate the solution′s performance.The experimental results show that the solution with stored IPFS CIDs can reduce the storage cost of users by at least 50%.Compared with the traditional MySQL retrieval method,this system provides significantly less index response time.For future work,we intend to use a zeroknowledge proof algorithm to further improve user privacy and continue modifying the smart contract to apply it to other auction types.