S

Share Ride

A decentralized and fully transparent ride-sharing dapp

The problem Share Ride solves

  1. Lack of transparency in pricing
    The ride prices vary from time to time. There will be some peak times where the cost of the ride will be high. Customers can't predict the average fare of a ride. The driver and customer have no idea of how the service provider rates a ride.

  2. Extra costs from by the intermediaries between a driver and a passenger.
    In traditional ride-sharing apps, the company assigns a driver for a journey. Providers impose a 20-30% commission on the total fare for this process. These increases travel costs for the customer. Also, this affects the revenue of the driver.

  3. Lack of privacy and data security mechanisms
    We often end up seeing similar prices on all the ride-sharing apps and wonder why this is happening. Our data is not secure on this platform. They can easily share the pricing between similar providers so they will get maximum profit. Also, there are a lot of fake profiles which misleads the customers.

Our solution

  1. Transparent pricing model
    In our solution, the driver can add the cost per km for a ride. So the pricing will be fixed and won't change. The customer has the option to choose the rider. Also, the customer can choose a driver depending on parameters like cost, number of seats, etc.

  2. Fast and secure transactions
    Transaction to the blockchain is fast and secure. There are no intermediaries. So the driver will get maximum profit while the customer only needs to pay a lower price.

  3. Privacy and data security
    All the data are stored securely on the blockchain. No external authority could know the cost and other information about a ride. Once a ride is accepted, an escrow account connected to the driver's wallet securely stores the customer's token. It ensures that the driver can only withdraw the tokens once he completes the ride.

Challenges we ran into

  • Learning rust - This was the first time we were writing rust code and it was an amazing learning opportunity. Initially, the syntax was hard to grasp, and also the Solana programs. But as time went on we were able to tackle that, understand rust and write 2 programs. One for saving the app state and another one for handling transactions.
  • Handling the app state - To understand handling the app state and scaling it, was one of the major challenges we faced. Luckily we found a package called anchor from project serum. Initially, our programs were written with the Solana rust package and borsh for serializing. Anchor helped us to reduce a lot of boilerplate code and handled serializing pretty well.
  • Handling large amounts of data - Since Solana programs require a predefined size of memory and a limit in usable size, it was hard for us to manage the state as it contains a lot of variables with varying sizes like from and to locations. Initially, we thought of using some services like Redis but we wanted to do all this with blockchain. That is when we found out about Arweave. The best thing is it is free, we got an account, pushed our data to Arweave, and saved the Arweave id to our program.
  • Transactions - The biggest advantage of blockchain is secure transactions and we wanted to handle our transactions with Solana. It was the first time we were doing something like this. We learned about minting and were able to create our token (We call it share coin aka sherekhan). We also figured out something called escrow. There was an amazing tutorial by Paul on this and it was super helpful in writing our escrow program.
  • Integrating with wallet - We were able to make escrow transactions using local tests but we wanted to use this along with the Phantom wallet. This was not straightforward and was hard to figure out. After going through a lot of blog posts, youtube videos, and reading the Solana source code we were able to sign a transaction using the Phantom wallet.

Discussion