Inspiration

We often encounter a lot of trust issues when we want to trade products online with strangers as credibility is crucial for trading to occur. We are inspired by dexcrows project which allows users to trade cryptocurrencies. However, when it comes to real-world trading, One limitation is that there is no way a smart contract can know that the trade between two parties is completed and when to allow one side to claim the fund. So, We created a reliable trading environment that encourages the users to trade without any concern and capable of knowing the trading status in real-world.

What it does

Halffin is a platform that allows two strangers to trade without any middleman. Halffin will guarantee that the buyer will be charged only if the product is delivered to their hand by using chainlink oracle to track the delivery status of the product's shipment.

How we built it

We used ReactJS as a web interface and Moralis server to store additional information off-chain. We used file coin IPFS to store the image and description of the product. Also, we used ChainLink Node and External Adapter to feed delivery status to the contract. Finally, python and brownie to develop smart contract on ethereum blockchain

Challenges we ran into

  • We had to balance the decentralization and the user’s privacy. We do not want to expose user details to the blockchain so we have to store the details off-chain. The first problem is it will be readable for everyone, however, Moralis tackles this issue with ACL permission.
  • The second problem is the step where buyers send their address details to moralis when the product contract was initiated, there is a window that a bad guy can send their address details to the moralis at the same time the real buyer confirms with the contract. The seller would never know that the shipping address retrieved is the address of the actual buyer or the attacker. Therefore, we prevent that by using web3 to check the actual buyer EthAddress from the product contract ensuring that the eth address of the requested user is the same as the eth address of the buyer in the contract. This way will prevent third-person attacks.

Accomplishments that we're proud of

  • We successfully feed logistic information to smart-contract so that it is capable of determining whether the trade is ended or not.
  • We are able to connect various component together which include moralis server, AWS lambda function for an external adapter, and the ethereum blockchain.
  • We found a secure way to balance decentralization and user privacy.
  • Although we were very new to this blockchain and had little knowledge of its tech stack, we finally built the entire project from scratch.

What we learned

  • In a decentralized world, there still are security issues.
  • We have to balance between privacy and decentralization
  • We learned new hard skills - a number of new tools and stacks like Solidity, Brownie, and Moralis.
  • We developed soft skills - how to work and collaborate as a team, problem-solving, and time management.

What's next for Halffin

  • We will improve the update tracking process in which we will check that the name and the address related to the tracking number that the seller entered are the same as the buyer to confirm that the seller has sent the packet to the right person.
  • We will create an Incentive program to attract people to use our platform. For example, we might provide the governance token for people who complete the entire process without cheating i.e. package is successfully delivered. the token can be used as a discount on the next purchase or can be used to participate in future campaigns of Halffin.

Built With

  • aftership-adapter
  • aws-lambda-function
  • brownie
  • chainlink-node
  • dynamodb
  • etheruem
  • ipfs
  • javascript
  • moralis
  • python
  • react
Share this project:

Updates