To test the product:

https://www.mercurium.site/

Use Polygon Mainnet on Metamask Wallet!!!!

Needless to say, you need a friend to test, two browsers with two Polygon Addresses or you could message us via Devpost.

Introduction and Problem Statement:

Messaging systems and apps such as whatsapp, telegram, wechat, facebook messenger and so many others have become ubiquitous nowadays. And not only that, but businesses and individuals have become partially dependent on these and we trust them because of the number of people that use them. With more than 3.6 billion people worldwide and over 145 billion messages being sent every day.

Image

This has brought forth stratospheric market valuations.

WhatsApp was acquired for $19 billion in 2014, Telegram has over 500 million users and rejected an investment offer at $30 billion. Skype was sold to Microsoft for $8.5 billion in 2011. And they will continue growing at a rate of 10% per year by 2030.

But there's a huge privacy problem in regards to siloed enterprises controlling data. These are regarding several right’s violations mainly around privacy such as Data sharing violations like the fine of 266 million euros that Whattsapp received by the EU in September last year, Telegram’s constant issues with cyber theft mainly around bank accounts and quite a large number of cases of Blackmail. And private data leaks such as the one that happened through facebook in April 2021.

Image

Nevertheless, messaging companies are still operating under practices that suggest data governance has not been solved.

We indeed have a problem!

Data is the most valuable resource an individual has and through blockchain technology this privacy issue can be quenched. We think that the way to launch a competitor is through the DeFi ecosystem as it is growing at an incredible rate and Serum is one of the premium platforms for that.

Having said that we decided to build it with the following characteristics:

Fully on-chain encrypted chat app, Directly integrated with Polygon scan and built on Polygon. Moralis managing everything from the backend for a faster implementation. Will allow MATIC and MATIC-based token transfer between chatters! And everything will be stored on Arweave through Bundlr.network.

Our Solution:

Mercurium is an instant messenger built on the Polygon Mainnet. It has file transfer integrated with bundlr.network, a multi-chain layer 2 solution for Arweave.

Image

The Dapp is fully on-chain, allows Matic and File transfer.

Image Contract address: https://polygonscan.com/address/0xF4aBfb397D67BabcaF7C3cC2edCf0d041bE32c38

A Fully on-chain instant messenger was developed in Solidity, deployed on the Polygon mainnet, making interactions through Metamask Wallet and integrating file transfer with bundlr.network.

System's Architecture:

Image

How it's built:

Our chat is based on the use of transactions and interaction with a smart contract, developed in Solidity, deployed on the Polygon blockchain (mainnet), using the Moralis JS SDK for interactions from the frontend, the Metamask Wallet to sign all the transactions and integrated file transfer with bundlr.network.

First of all, we deployed our own smart contract, through the Remix IDE.

Image

All the chat is completely on-chain, so all the data obtained is through the Moralis JS SDK, so in order to track transactions and messages.

Tech we use

Polygon

Polygon is used for almost everything, we sign every single message (as they are all on-chain) with Metamask through the mainnet RPC and the MATIC transactions are done, well, through it also.

Image

Here is the UI and how you can chat, send files, and also send and request MATIC tokens.

Arweave:

Bundlr Network and Arweave L2, are used to send the files in a decentralized way in order to make a completely on-chain chat.

Bundlr Setup:

let providerName = "MetaMask";
let currencyName = "matic"
const providerFunc = providerMap[providerName] // get provider entry
const currency = currencyMap[currencyName] // get currency entry
const provider = await providerFunc(currency); // 
const bundlr = new WebBundlr(bundlrNode, "matic", provider);
await bundlr.ready();
return bundlr; // done!

Bundlr Upload File and add to message:

let response = await this.bundlr.uploader.upload(this.state.fileBuffer, this.state.file)
tempMessage += `:file:https://arweave.net/${response.data.id}/${this.state.file.name}:filef:`

NOTE: This way of adding information to a message is based on how Discord adds items to your chat. Image

Moralis

We use Moralis for almost everything on the backend, from managing the Polygon RPC to interactions from the frontend and the Metamask Wallet to sign the transactions.

await this.Moralis.start({ serverUrl, appId });
    let user = this.Moralis.User.current();
    if (user ? false : true) {
        try {
        user = await this.Moralis.authenticate({ signingMessage: "Log in using Moralis" })
        console.log("Ok authentication");
        }
        catch (e) {
        console.log("Cancel authentication");
        window.open(`/`, "_self");
        }
    }
    if (user ? false : true) {
        console.log("User Rejected");
    }

Example transaction:

Here is the example of a transaction directly from the Blockchain.

Polygon Scan Transaction

Image

What's next:

We will be working to improve on this Prototype, we already have the main characteristics of an instant messenger and it works seamlessly, but we need a couple more features.

Other features we will be looking at from here on are:

  • NFT transfer.
  • Push Notifications
  • Online Status
  • Mobile Version

Data is the ultimate resource for the coming years and in an age where we have incredible machine learning and cryptographic technologies, not to mention blockchain it is a shame that we have to rely on big tech for an application that has to become a human right. Of course, privacy is paramount and when we are dealing with a use case for money, which DeFi is, it is of utmost importance.

Hopefully you liked the project and please support it.

References:

https://www.buzzfeednews.com/article/charliewarzel/why-facebook-bought-whatsapp https://www.aljazeera.com/economy/2021/9/2/whatsapp-fined-266m-by-eu-privacy-watchdog-over-data-breach https://www.forbes.com/sites/zakdoffman/2021/04/22/forget-whatsapp-new-telegram-warning-for-millions-of-windows-10-users/?sh=3c609d8d7857 https://www.independent.co.uk/life-style/gadgets-and-tech/news/north-korea-telegram-cryptocurrency-bitcoin-lazarus-hackers-kaspersky-a9277956.html https://www.businessinsider.com/stolen-data-of-533-million-facebook-users-leaked-online-2021-4?r=MX&IR=T https://www.npr.org/2021/04/09/986005820/after-data-breach-exposes-530-million-facebook-says-it-will-not-notify-users

Built With

Share this project:

Updates