Dakiya: Tech Deep Dive

We launched Dakiya, a wallet-to-wallet communication platform last month. It received a fair amount of both appreciation and hate. Irrespective of your view of our product, we believe our journey of building it would help other builders understand how to go about building interesting web3 products.

The problem

We talk about Decentralization, but over 100 billion messages are sent every day and none of them are via a decentralized platform! We NGMI if we continue doing this.

The solution

Dakiya - An on-chain platform to send messages to any Ethereum address and with the security of blockchain.

We call it Dakiya, inspired by the OG mailman from our childhood.

Genesis

It all started with a blog post by Madhavan, the idea was to create an on-chain platform for communication b/w Ethereum wallets.

Result

Our launch was not only well-received but also applauded by the web3 community.

Deep dive into the application flow

In the revolution of decentralization, it was high time to have a decentralized communication platform. All you have to do is, connect your MetaMask and get started on Dakiya. Kudos! Now you can send a message to anyone with a MetaMask wallet.

Fun Fact: If your friend is already a Dakiya user, this is done by e2e encryption so that you have the best security out there protecting your conversations, and if not, your message will still reach them but it won’t be encrypted.

Dakiya is built on:

→ Frontend: NextJs

→ Smart Contract: Solidity

→ Storage: IPFS

→ Data Storage and querying: TheGraph’s Subgraph

Get started

You can log in/signup on Dakiya via Metamask, if it’s your first time, we would just need your Public Encryption key provided by the MetaMask wallet and store it in our smart contract. Now you will be able to use Dakiya to its fullest extent!

We just store your key in our smart contract so that you don’t have to provide it every time and get all annoyed with us. All it would take is insignificant gas fees to save the key.

So, let’s go through with an example where 2 best friends, Alice and Bob are getting started with Dakiya.

Bob got excited about Dakiya and quickly set up his profile. He called Alice and told her that if she also sets up her profile on Dakiya, they would have their secret conversation!

Encrypting data

Complete flow of Dakiya
Complete flow of Dakiya

After getting started, Bob started writing his message. As soon as Bob writes his message, we generate an encryption key, let's call it encKey. We use this encKey to encrypt the message. This is later saved in IPFS and we hold the hash for you.

We are using the concept of symmetric encryption so that we can encrypt the encKey and only the sender and receiver would have the ability to decrypt the message.

To add an extra layer of security, we encrypt this encKey with the Public Encryption Key of both Alice and Bob, so that only they have the power to decrypt the message.

⚠️ If the receiver’s public encryption key isn’t present, then this encryption part would be skipped and instead of encrypted data in IPFS, raw unencrypted data will be stored.

Awesome! Now let’s understand how we store the data.

The data to be stored is relayed from our smart contract via emitting events and reaches our subgraph. All this journey to save bulky gas fees.

Let’s see how things work on Alice’s end,

Decrypting Data

After Alice onboarded, we looked around in our subgraph for any existing Daks for her. And we found there was a message from Bob!

There were two messages already waiting for her! One was encrypted and the other was non-encrypted. We don’t know the content of both messages, but we can tell you how both of them work.

The encrypted message

When Alice opens this thread, there would be a prompt asking user to decode the message.

This is the encryption key being decrypted that was encrypted using Alice’s public encryption key and we’ll have encKey to decrypt the original message.

At the same time, the encrypted data is fetched from IPFS, and once we get the encryption key (encKey), we start decrypting the message and display it to Alice.

This way, only Bob and Alice can see the message and have a secret conversation!

And a non-encrypted message

Alice can simply read the message. We just fetch it from IPFS, any further replies to this thread would also be maintained in a similar way.

Once both Alice and Bob are signed up on the platform, any new threads would be encrypted from then onwards.

This is how Dakiya works in a nutshell.

If you also want to have secret conversations like Bob & Alice, you can always use Dakiya so that your secrets always remain secret.

If you feel Dakiya is for that special 1% who can afford gigantic gas fees, don’t worry we got you guys too, we are also available on Rinkeby Network! We mean it is when we say WAGMI 🚀

Checkout Dakiya on Rinkeby

Reference Links

We have more things planned for Dakiya so keep an eye out 👀 or we might just surprise you 🤯!

This was written by the phenomenal builders of Makerdock - Shashank, Abhishek, and Yash

Subscribe to Makerdock
Receive the latest updates directly to your inbox.
Verification
This entry has been permanently stored onchain and signed by its creator.