  Ride-sharing is a service that enables drivers to share their trips with
other riders, contributing to appealing benefits of shared travel costs.
However, the majority of existing platforms rely on a central third party,
which make them subject to a single point of failure and privacy disclosure
issues. Moreover, they are vulnerable to DDoS and Sybil attacks due to
malicious users involvement. Besides, high fees should be paid to the service
provider. In this paper, we propose a decentralized ride-sharing service based
on public Blockchain, named B-Ride. Both riders and drivers can find rides
match while preserving their trip data, including pick-up/drop-off location,
and departure/arrival date. However, under the anonymity of the public
blockchain, a malicious user may submit multiple ride requests or offers, while
not committing to any of them, to discover better offer or to make the system
unreliable. B-Ride solves this problem by introducing a time-locked deposit
protocol for a ride-sharing by leveraging smart contract and zero-knowledge set
membership proof. In a nutshell, both a driver and a rider have to show their
commitment by sending a deposit to the blockchain. Later, a driver has to prove
to the blockchain on the agreed departure time that he has arrived at the
pick-up location. To preserve rider/driver location privacy by hiding the exact
pick-up location, the proof is done using zero-knowledge set membership
protocol. Moreover, to ensure a fair payment, a pay-as-you-drive methodology is
introduced based on the elapsed distance of the driver and the rider. Also, we
introduce a reputation-based trust model to rate drivers based on their past
trips to allow riders to select them based on their history on the system.
Finally, we implement B-Ride in a test net of Ethereum. The experiment results
show the applicability of our protocol atop the existing real-world blockchain.
