Сepheus: Decentralized marketplace in pictures

Anastasia Kondaurova
7 min readJun 25, 2020

I am obsessed with DeFi and DApps. I think that decentralization can make almost anything better: from small software to the whole industry. I had the luck to find the guys who share this opinion and that is how the concept of Cepheus was born.

Imperfect world

We get used to saying that capitalism is cool and the market is free but is it true? The government tries to control every atom, every movement in this field, most of the services are centralized, to purchase something clients provide their personal data that can be compromised on central servers, banks supervise operations and can restrict transactions any time. Is the picture still so cool?

Things are not supposed to go this way in the XXI century. The market should be free. Anybody can sell, anybody can buy. All critical decisions should be made by DAO. KYC is the step back to the past. Anonymity is the biggest treasure tomorrow. And blockchain is a good tool to turn dreams into reality.

Make it better

Cepheus is a decentralized marketplace on Tezos blockchain. The platform allows buying and selling with paying in stablecoin. The main goods are items for men: bags, perfumes, ties and belts, phone accessories, alcohol, e-cigarettes. It seems the male audience prevails in cryptoworld.

Not to be so boring and use all the power of visualization, let’s consider the flow of possible scenarios by examples.

Suppose, we have two actors. Selena is about to sell apples and Bellerophon has the intention to buy some fruit. They don’t know each other and would prefer to stay anonymous: IPFS and Tezos blockchain are the only communication channels between them.

Greeks create Tezos accounts, fund it and generate RSA keypairs that will be used to encrypt sensitive data and hide it from strangers. Users should keep the private keys safely outside of the platform.

Preparation

Everyone registers by sending the transaction to the Cepheus smart contract with their public key and subscription type. Thanos wallet is a convenient and secure tool that makes these blockchain interactions for guys as simple as never before.

Registration

All users are anonymous so if Poseidon wants to check whether Selene’s address is worth trusting he checks the reputation: how many successful deals the address made and how many refunds the clients requested. He also sees the balance, public key, and subscription but he doesn't actually know that address belongs to Selene.

Fetching user info

So, Selene is ready to trade. She stores the item description in the IPFS node and gets its cid. Cid becomes the unique identifier of Selene’s item. The transaction with cid and price is sent to smart contract on Tezos and the new item is successfully added to the global store. Selene can remove added goods at any time.

Adding item

Bellerophon wants some sort of fruit. He is searching for goods on IPFS when he finally notices apples. Yeh, exactly what’s needed. He encrypts one copy of his personal delivery information by his public key and one copy by Selene’s public key and stores them in IPFS. The request to make an order is sent to the smart contract with apple cid (content identifier), the number of items to buy, and IPFS link to encrypted delivery data. The tokens are charged immediately and locked until Bellerophon receives goods.

Making order

Added order is visible for everybody including Selene. She looks at order details on IPFS, decrypts her copy with her private key and sends apples to Bellerophon.

Preparing delivery

Once the tracking number of the package is known, the goddess of the Moon encrypts one copy of it by her own public key, another one by Bellerophon’s public key, and stores information on IPFS. The transaction with a cid of encrypted data is sent to confirm and update the order status. If Selene was not about to execute an order, she could cancel it and the payment would be returned to the buyer.

Confirm order

Bellerophon notices delivery’s IPFS, fetches encrypted tracking number, decrypts it with his private key and uses off-chain services to track it.

Fetching tracking number

After receiving and checking the package Bellerophon confirms it by the separate transaction. Platform charges fees from Selene’s profit based on her subscription plan and unlocks her profit, Bellerophon receives cashback for his responsibility.

Confirming delivery

As soon as funds are unlocked Selene can withdraw it to any address. Let’s say she visited Aphrodite’s beauty salon this weekend and wanted to pay back. Goddess triggers smart contract passing Aphrodite’s address and amount. Coins quickly go to the target account. Bellerophon can withdraw his cashback in the same way.

Withdrawing

When something is going wrong

But what if Bellerophon lives high off the hog and doesn’t care about cashback? Well, Selene can wait for a month and unfreeze profit. If no refunds were requested funds will be unlocked immediately.

Seller’s refund

Imagine another scenario. Bellerophon is waiting for his apples and almost feels their taste when he finds pear in the shipped package instead. To appeal, the hero decodes the tracking number and sends the refund request with the number and order cid.

Buyer’s refund request

Zeus who manages the platform and helps to solve issues (and that’s why charges fees) notices the refund request. Fetches tracking number and order cid, collects and analyzes all the information about it, and accepts refund.

Buyer’s refund

And one more case. Let’s go to the point when the order wasn’t confirmed by Selene, it just was added by an ancient hero. Once in a sudden, Bellerophon recognized: “Sure, apples in two weeks are cool, but vine today is better”. So, he wants the money back. Greek sends a refund transaction and money is assessed to his platform balance. It can be withdrawn or used for future purchases.

Buyer’s refund before the order is sent

From concept to reality: step by step

We are working on the project a little bit more than a month but are ready to present the first results.

Frontend features:

  • register/auth;
  • items management for sellers;
  • search for items;
  • cart;
  • orders management for buyer and seller;
  • encryption for private order information;
  • refunds management.

Smart contract features:

  • global settings management;
  • register/subscription management;
  • items management;
  • orders management;
  • refunds management;
  • withdraw/withdraw fees functions.

IPFS features:

  • set public IPFS node;
  • store encrypted item/order/tracking number data;
  • get full items list;
  • get and decrypt data by cid.

Try it here(but, please, be polite and lenient, it is just a small development milestone) or look at demo.

Conclusion

Decentralization is a big power and a decentralized marketplace is one of its possible use-cases. Our immediate plans about Cepheus on Tezos contain two vectors. One is an improvement in the concept and architecture. We face some challenges that will be discussed in the next article along with approaches to play around it. Second is prettifying the frontend and integrating new functionality.

Cepheus is decentralized marketplace for secure anonymous online shopping.

Tezos is an open-source platform for assets and applications backed by
a global community of validators, researchers, and builders.

IPFS is a peer-to-peer hypermedia protocol designed to make the web faster, safer, and more open.

--

--