A Blockchain Based Mobile Crowdsensing Market

2019-07-08 02:00XinWeiYongYanWeiJiangJingShenXuesongQiu
China Communications 2019年6期

Xin Wei,Yong Yan,Wei Jiang,Jing Shen,Xuesong Qiu,*

1 State Key Laboratory of Networking and Switching Technology of Beijing University of Posts and Telecommunications,Beijing 100876,China

2 State Grid Zhejiang Electric Power Research Institute,Hangzhou 310014,China

3 Internet department of State Grid Corporation of China,Beijing 100031,China

4 State Grid Henan Electric Power Company Information & Telecommunication Company,Zhengzhou 450000,China

Abstract: Mobile crowdsensing(MCS) is an emerging pattern which means task initiators attract mobile users sensing with their own devices by some platforms.MCS could exploit idle resources in low cost,while it has lots of flaws,which impede its developments.First,isolations between different MCS systems leads to wastage of social resources.What's more,current MCS always operate in a centralized way,which causes it vulnerable and unbelievable.Blockchain is a promising technology which could supply a credible and transparent environment.This paper construct a blockchain based MCS market and design smart contract for its operation.In our design,platform breaks isolation by blockchain,task initiators and mobile users manage their tasks by smart contract and bargain price with distributed algorithm.By this way,resource could be exploited better,and the market could be more fair.What's more,the paper analyzes Walrasian Equilibrium (WE) in the market,and details how to deploy MCS in blockchain.Evalution results shows that Equilibrium could be found.

Keywords: mobile crowdsensing; incentive mechanism; blockchain; Walrasian Equilibrium

I.INTRODUCTION

Mobile crowdsensing (MCS) is a sensing paradigm which collects data by a large group of mobile users using their own devices.The pattern consists of three roles,task initiators,mobile users,and MCS platform.Task initiators submit tasks and pay for this while mobile users complete tasks for incentives,platform work as guarantor to help them exchange data and incentives truthfully.Due to low deploying cost and high sensing coverage,MCS has been implemented in a broad range of applications such as public safety and environment monitoring[1].However,the traditional MCS schemes has a lot of flaws,which can be concluded as following.

1) Majority of traditional MCS platform runs on a centralized server,which is vulnerable for DDoS attacks,remote hijacking and mischief attacks,all these attacks would make the services unavailable.And,it suffers from single point of failure inherently.In April 2015,a service outage emerged due to hardware failure in Uber China,which caused passengers can't stop the order at the end of services [2].

2) As MCS platform is responsible for assessing sensing data and paying users,it may cheat users by paying less even nothing when taking the sensing data.Similarly,MCS platform also may cheat task initiators for charging more.

3) MCS systems are isolated from each other,users may not attend to another MCS,even tasks in these MCS systems are similar,which wastes sensing capacities of mobile users.

Decentralized and transparent cooperation could solve these problems well.Blockchain is distributed ledger maintained by many participants,all activities happened in it would be recorded into ledger in a tamper-resistant way.Introducing the technology into marketplace,risk of single point of failure can be eliminated,possibility of cheating would shrink,different MCS systems can work together.

In this paper,we propose a blockchain based unified MCS system,which serves as a generic market model.In the system,task initiators and mobile users operate MCS market together.Price of task is calculated with consensus,remuneration is paid with smart contract.In such scenario,an optimal state for task initiators,mobile users and MCS market can be characterized by Walrasian Equilibrium(WE).Contributions of the paper can be summarized as follows.

1) We design a standard blockchain based MCS model,which could supply a framework with verifiable and distributed transaction history log,multi-signature based authorizations for enhanced fairness and credibility in MCS system.

2) We construct the incentive problem in the model as a optimal problem,and design a distributed algorithm to find the WE.Which means that all three roles involved in mobile crowdsourcing reach its optimal state.

This paper is structured as follows: Section II describes incentive mechanism design in MCS and blockchain based application.Section III describes the MCS model and construct a social welfare maximization problem,whereas Section IV proposes a distributed algorithm to find it and details how to apply the algorithm.We simulate the algorithm in Section V,discuss and conclude it in Section VI.

II.RELATED WORKS

2.1 Incentive mechanism designs in MCS

As MCS relies heavily on participants,incentive mechanism has always been an important part in the field.In [3],it is proposed that incentive can be divided into three types: game,service,monetary.As the former two is rely on specific crowd sensing,monetary incentives is more flexible.In the process of research,game theory is found can be used in the scenario.Koutsopoulos.I [4]takes the scenario which contains one task initiator and multi mobile users as a reverse auction model and design incentive mechanism for it.Zhang X[5]takes dynamic characteristics into account,design online reverse auction algorithm for MCS.Jaimes.L.G [6]adds behavior model of users into reverse auction,aims to assures a minimum number of participants at each round.These works above focus on encouraging users to participate,ignore the quality of sensing data.Gao.L [7]considers time-dependent and location-aware participatory sensing,solves the problem that which sensor should be selected at a certain time slot.Mrazovic.P [8]tries to assign tasks to who is familiar with location.Faltings.B [9]takes evaluation of data quality into incentives mechanism by comparing sensing data with forecast data.Restuccia.F [10]analyses attack models to verify data quality,and modify reputation of users.Gao.Y [11]adopts real-time direct trust and lightweight feedback aggregation trust to choose participants.

All works above stand by task initiators,ignore benefit of users.Zhu.Y [12]helps users to decide to attend which task in next time slot base on history.Tham.C.K [13]points there is an equilibrium that when contributors provide data in a certain quality and frequency,and consumers use data in a certain rate,both of them could gain most.He.S [14]designs an approximation algorithm while Duan.X [15]proposes a distributed algorithm to achieve WE.WE means that there exist a price vector and an allocation can satisfy conditions: 1) demand and supply is matching.2) both benefits of task initiators and mobile users reach the maximum.In short,a WE quantifies a state beneficial to all participating parties,and this is one salient feature going beyond the wellknown notion of Nash Equilibrium.

However,they didn't describe how to apply the incentive mechanism.Since incentive need credible system to ensure,the paper apply distributed algorithm into blockchain based MCS to find WE.

2.2 Blockchain and smart contracts

Blockchain is a technology meant to store,read and validate transactions in a distributed data-base system [16].In blockchain,a group of anonymous strangers can work together to store,curate,and secure a perpetually growing set of data without anyone having to trust anyone else [17].In common,activities in blockchain can be summarized as following.

Users access blockchain by a pair of keys generated by asymmetric encryption.They sign transaction with private key and be accessible via public key.Transactions will be packaged into block,and block will reference to previous block to form blockchain.After consensus,blockchain will be shared among the whole network.Smart contract means a series of scripts stored on the blockchain,when we trigger a smart contract,it will be executed independently and automatically in a prescribed manner on every node in the network.

As everything recorded in blockchain is shared among everyone in the network,it is impossible for a single user to tamper with.Therefore,blockchain can supply a framework with a verifiable and distributed transaction history log,easy extensibility and scriptable programmability for applications.

Some attempts on resource allocation with blockchain have been tried in these years.Public blockchain based Internet source transactions is proposed in [18][19],which could record Internet core transactions like IP address assignments,domain name assignments and AS-Path advertisements,thus allowing Internet peers to verify core Interment resource usage and assignment authorizations.

In MCS scenario,there also are some attempts.Li.M [20]proposes a blockchain based MCS framework,which is lack of evaluation mechanism.Wang.J [21]aims to protect privacy for users by use group signature,while Lu.Y [22]design a protocol for authenticate users.Designs in [20-22]is implemented with public blockchain.And there are several problems in public blockchain based solution [23].Firstly,the prospect of public chain is unpredictable.Public chains rely on a whole community of developers contributes to the open-source code,the process lacks formal governance.Secondly,since public blockchains have to coordinate the resources of multiple unaffiliated participants,they are slower and less private than traditional databases.

To solve efficiency problem of public chain,lots of solution have been proposed,such as hybrid chain which combining permissioned chain[24],lightning network [25]and master-slave chain [26].Lightning network solve it by complete transactions off the public chain,lots of operation can be executed without consensus.Master-slave chain divided traditional blockchain into two layer and designed computing model for these layers individually.While permissioned chain reduces the scale of consensus by limiting the node who can participate in the blockchain.Zou.J[27]adopts permissioned chain to provide an accountability solution for MCS.

In this paper,we construct a permissioned blockchain based MCS platform for task initiators and mobile users.

III.SYSTEM MODEL

The section constructs a blockchain based platform for MCS,completes problem formulation,and analyzes existence of WE in this scenario.

3.1 Blockchain based platform for MCS

To keep balance between truthfulness and performance,the paper adopts permissioned chain to maintain the system.The system is described as following.

Different MCS platforms get authorization from each other,set rules as smart contract.Each operation happened in the system would be recorded into blockchain after consensus.Task initiators and mobile users manage their tasks and incentives by invoke smart contract in permissioned chain.To complete the system,the smart contract can be detailed as following:

TableI.Summary of the notation used in this paper.

Fig.1.System model.

1) task publish

The smart contract should be invoked by task initiators.It checks whether the invoker has enough assets to pay for remuneration,charges some deposit,publishes information about the task to blockchain,and returns a unique task ID to task initiator.After this,task and changes in account of invoker will be recorded into blockchain.

2) task query

Users query task with keywords of task description,task initiator,or task ID by the smart contract.Mobile users query reasonable task for itself,while initiators query process of task.

3) task complete

Mobile users submit their results by this contract.Then the contract would calculate the remuneration for users and pay it,send results to task initiators.After this,hash of results,changes of task,and changes of users will be recorded into block.The rest of deposit will be returned to initiator after deadline.

Pseudocode is shown in the following.

According to the design,process of MCS market would be transparent.For a task initiator,he can setevaluation functionto filter mobile users and data.For mobile users,he can query history log of task initiators to decide whether attend tasks publish by it or not.

3.2 Problem model

This part constructs the WE problem in MCS market as a convex optimization problem.Notation used in this paper is summarized in TableI.

It is noteworthy that cost functionCki() is assumed to be a monotonically increasing differentiable and strictly convex function of x.φi() is assumed to be a monotonically increasing differentiable and strictly concave function of x.

Both of mobile users and task initiators aim to maximize their own profits.The profit of task should be subtract its incentives in each subarea from utility as (1),while pro fit of user should be subtract its cost from incentives for each task as (2).

According to concept of WE,market must be clear.As ability of mobile users should be spent out,at least one task initiator would choose user i.This implies that price ofinot less than the user can accept.Similarly,at least one mobile user would choose the task initiator,so the price ofinot higher than the task initiator can accept.So task initiators would cut price while mobile users would increase price,and the price of each certain task will be stable at each certain area.

What's more,when growth of profit is slower than growth of cost of hiring mobile users,task initiators will increase demands in the area.As cost of hiring mobile user will get stable,demands of tasks will also be stable at each certain area gradually.

Hence,there must exist a stable state for both task initiators and mobile users.As social welfare is the sum of profits of all users,the final stable state would be optimal for MCS market too.Therefore,an WE would exist in this scenario,and it could be found by solving problem (1) and (2) optimally.

IV.ALGORITHM

This section studies WE of the market we designed.Part A decomposes the global optimization into local optimization problem of task initiators and mobile users,and propose a distributed algorithm to solve it.Part B demonstrates how to deploy the algorithm in MCS market.

4.1 Distributed algorithm to find equilibrium

We define social welfare as the sum of payoff functions of each role in the crowd sensing system,which can be expressed as the following:

Algorithm 1.Smart contract on Task.Define Task which including ID(unique number),description(text),author(address of blockchain),status(list of mobile users and their workload),evaluation function ,deadline.Function publish (description ,workload,evaluation function,validity function,deadline,deposit)1.if the parameters are legitimate and complete 2.Calculate maximum value T of evaluation function and workload 3.if account balance of invoker is no less than T 4.Freeze deposit from the account 5.Generate a unique number as ID for the task 6.publish a Task and set its status as null 7.Return Task ID 8.Else 9.throw an error 10.Return the rest of deposit to author after deadline Function complete(ID,result)1.Query the Task according to Task ID and get its evaluation function 2.Calculate reward according to evaluation function and result 3.Pay reward R from deposit to the account of who invoke the function 4.Add the account and reward to status of Task Function query(keywords ,author or ID)1.Return the Task whose description match keywords ,whose author match the task initiator and which match the ID

To construct a standard convex optimization problem,the social welfare maximization problem is formulated as

As the cost function of mobile users is convex and the utility function of task initiators is concave,the problem is a convex optimization problem.Since supply and demand is matching in WE.There is:

According to (1)(2)(3),the objective function -J can be simplified as

Since (5),the augmented objective function without considering local constraints can be formulated as

λijare coupling variables.Since the primal variableXijandxkiare all separable,an iterative approach given below solves the problem.The problem can be completed in a distributed way.

For task initiators:

Fig.2.Node capabilities.

Fig.3.Market process.

For mobile users:

For platform:

4.2 Application scenario

The section demonstrates how to integrate the algorithm we proposed into blockchain.Fabric[27]is a promising permissioned chain,we take it as example to construct MCS market in the following description.

In Fabric,nodes are the communication entities of the blockchain,and they can be divided into three types as Figure 2.Client nodes create and broadcast transactions to peer nodes by invoke smart contract.Peer nodes execute contract and submit to orderer,and record result to ledger according to consensus among orderer.

It is noteworthy that node is only a logical function in the sense that multiple nodes of different types can run on the same physical server.Considering peers need large storage to maintain blockchain,and orderers need high performance to reach consensus,mobile users and task initiators always act as clients only.Since both orderers and peers all be acted by MCS platform,we merge the two roles here.

Before all begins,a rootCA should be constructed to authorize orderers and peers.Instead of a central organization,rootCA is acted by all peers has been in the cooperation.After MCS platform get trust from each other,the permissioned chain could work.

Then they should expose smart contract for clients including mobile users and task initatiors.Client proposes a transaction by invoking smart contract in permissioned chain.After verifying the identify of client,peers will endorse the transaction.When consensus is reached among orderers,peers could record the transaction into blockchain.

Activities in the system can be summarized as follows:

1) Users register in permissioned chain by client,after authenticate,they can generate private key in local and sign transactions.

2) Task initiators publish task withFunction publish,which contains initial price and demand.

3) Orderer verify the task initiators and broadcast the task to mobile users.

4) Mobile users submit supplies for the task to Orderer.

5) Orderer verify mobile users.From here,iteration is beginning.

6) Mobile users and task initiator calculate x and X in local and submit to orderer.Orderers calculate price of task.All this will be executed in client silently.Tasks received at this time will be processed in next cycle.

7) When the mismatch is lower than thereshold,the iteration is end.Task initiators and mobile users who attend the task is recorded into blockchain.This cycle is ending up with a block which records participant and the negotiation process.Next cycle will begin from 2).

The process of market can be concluded as figure 3.Register and verifications including 3) and 5) is omitted in the figure.Only after 7),the contract oftask completeis invoked successfully.

V.SIMULATION RESULTS

In order to verify the validity of proposed algorithm,we simulate it.The simulation settings are listed as following.Cobb-Douglas production function[28]is adopted as utility function for task initiator and quadratic function is selected as cost function for each mobile user.

We set 15 users and 3 tasks in 4 subareas as Figure 4.

In Figure 5,the mismatch between demand and supply in each subarea is illustrated respectively.It can be observed that the mismatch of tasks in each subarea declines quickly.Eventually,mismatches equal to zero,which means that the market is cleared and a balance between supply and demand is achieved regarding the sensing task in its interested sensing subarea.From Figure 6,we can see the social welfare converges to the maximum when social resources are in full use.

Fig.4.Scenario settings.

Fig.5.Mismatch.

Fig.6.Social welfare.

Figure 7 illustrate the mismatch of eachtasks in each area,we can see each task is cleared in the scenario by proposed algorithm.

TableII.Parameters settings.

Task price is illustrated as Figure 8.It can be seen that each price gets stable in each subarea after several iterations.

As figure 9.shown,both profit of task initiators and mobile users reach maximum value.According to concept of WE,the equilibrium is met by algorithm we designed.

VI.DISCUSSION AND CONCLUSIONS

Fig.7.Mismatch.

Fig.8.Task price.

Fig.9.Profit.

This paper proposes a blockchain based MCS market and design smart contract for it.By analyzing WE in the market,a fair bargaining for task initiators and mobile users is designed.By blockchain,an interconnected,credible,and fair market is constructed for MCS.

Trust is another crucial problem in MCS.Generally,MCS platform always improve data quality by analyzing users such as [30].By our design,these platforms can get more comprehensive data to distinguish high-quality users.Since identity based data audit method had been proposed in [31],and blockchain is suitable for identity management,it can be used for improving data quality.

And there still exists a dilemma that how to maintain a balance between privacy and fairness.In our design,others may deduce the method of using sensing data from evaluate function,which may hurt the benefit of task initiator.However,if the right of evaluating data is kept on task initiator,it is hard to ensure mobile users to get their deserved.

We are still in an early age of research on blockchain.In this paper,we only take primitive process into consideration,more complex scenarios will be considered in the future.