4thTech Solana Ignition Hackathon experience & on-chain dChat protocol (November 2021)

4thTech
/4thtech
Published in
12 min readNov 5, 2021

--

4thTech team talks about the Solana Ignition Hackathon 2021 experience, their on-chain instant messaging application, technical challenges, recognition and more. (Blockchain Recorded Podcast EP07 Transcript 05.11.2021)

Talk Participants

*Nina Cerar, Blockchain Recorded Podcast Host (Twitter: @ninacerar10)
*Tali Rezun (Twitter: @talirezun), Denis Jazbec (Twitter: @denisjazbec), Peter Tuk (Twitter: @P4thtech), Andrej Gorenjak

Discussion

Today we have 4thTech returning to our podcast to talk about their Solana Ignition Hackathon 2021 experience…namely their on-chain instant messaging application, technical challenges during the hackathon, their recognition and more. Welcome back guys, I heard you had a crazy couple of months behind you.

There are four of you joining today. Tali, Denis and Peter, we had you once here on the show, and Andrej, you are a newbie. Can each of you give just a quick intro of yourselves?

Tali: Hello, my name is Tali Rezun, I’m the 4thTech R&D Head
Denis: Hello, my name is Denis Jazbec, I’m the 4thTech CTO
Peter: Hello, my name is Peter Tuk, I’m the 4thTech developer
Andrej: Hello, my name is Andrej Gorenjak, I’m the 4thTech developer

Thanks. So the goal of today’s podcast is to talk about the Solana hackathon and your related experience. There are thousands of teams that applied to the hackathon and I’m sure hundreds more that thought about it, so today’s goal is to clarify as much as possible also for them, the ones that were not involved.

Let’s start with a short project overview for the listeners not familiar. Where does 4thTech fit into the blockchain ecosystem? And where do you stand out?

Tali: We started back in 2017 when we realised how important decentralization is. For four years now we have been developing privacy-enabled W2W communication framework and data management solutions, utilising various blockchains in one way or another. You could say that we are contributing to blockchain infrastructure development.

If we take a look at the blockchain landscape these days, most of the attention is focused on decentralized finance, which is great, we all love DeFi, but let’s not forget that there is crucial development still needed in various fields from private communication, secure data exchange, decentralized storage and so on. We are working to solve one piece of that puzzle.

If we simplify, our solutions are not that hard to understand, if we focus on the FOURdx protocol we are talking about peer-to-peer data exchange between users, in our case user wallets. You have all used WeTransfer at one time or another, so the FOURdx can also be compared to WeTransfer, but with a few major differences, the data files are exchanged between wallets and private keys used for access.

The exchanged encrypted data files are stored in the off-chain repository, while the user is provided with the link of the saved data file location, which is stored on the blockchain. This approach was needed to achieve GDPR compliance.

We’re working towards providing an option for storing data files on decentralized storage, but more on that next year.

What is your current main occupation or focus?

Tali: Currently our main occupation is the FOURim or the instant messaging protocol, which is deployed on the Solana blockchain and was also a part of the Solana Ignition hackathon submission.

Solana is suitable for on-chain instant messaging due to its speed and low transaction cost, so deploying on Solana was the logical choice. Similar to the FOURdx protocol, where data and emails are exchanged between wallets, also messages are exchanged between wallets and the private keys are used for decryption.

What we wanted to achieve is to offer different data management solutions under one roof. So now when you log into the 4thTech UI platform, you can exchange dMails, and data files using FOURdx protocol, verify their authenticity and timestamp using the FOURns protocol, and connect your identity with the X.509 digital certificate standard using FOURid or chat on-chain using the FOURim.

As far as we know there is no similar all-in-one solution on the market that is innovated in such depth, EVM, Substrate and Solana compatible and production-ready.

So that is where we definitely stand out.

How did you recognize the importance behind the development of FOURim?

Tali: I think that privacy in online communication is a fundamental right of every person. Exchanging private instant messages securely over the internet should be easy and accessible to all, so yeah with already developed infrastructure such as the 4thTech UI platform and dedicated wallet, there was only a matter of community incentive and finding the right network to support it.

What is extremely important is to know that with the FOURim protocol, the users will gain control over their messages, the messages are end-to-end encrypted and stored on the Solana Blockchain. Messages are not stored on any company server! Every message is signed with the receiver’s public key. Your Solana wallet address serves as your on-chain identity. When the 4thTech platform reaches full decentralization, it will not matter if the project is here or not, all control will be in the user’s hands.

Let’s continue with Solana, when and how did you know that it is the right blockchain for FOURim? Maybe, Peter, can you answer this one...

Peter: We recognized Solana’s advantages already at the beginning of 2021 and were searching for a technically acceptable way to deploy the instant messaging protocol. We needed a fast and low transaction cost blockchain to make it work. The name instant messaging speaks for itself, the messages must be exchanged close to real-time. There is speed and there is cost, the goal was to develop a truly on-chain chat, but that means “one message, one transaction”, can you imagine the cost on Ethereum? So, yes Solana was a perfect fit here because transactions are executed in less than a second with a cost of 0.0025$.

Let’s move on to the Solana Hackathon, what drove you to the decision of applying? Denis?

Denis: We were already deep in the FOURim development when we noticed the Solana Hackathon. So applying was the logical thing to do, we were already deploying on Solana in any case. Hackathon success could bring the needed adoption and FOURim recognition.

As I understand you applied with two solutions, Solana FOURdx and Solana FOURim? What was the process?

Peter: Yes, we entered the Hackathon with the Solana version of the FOURdx or data file exchange protocol and the FOURim, the Solana instant messaging. We filed two separate submissions as two stand-alone projects. We needed to provide solution description, and technical clarification and we needed to provide a way for the judges to test both solutions and give them access to the code on Github.

Denis, can you take us through the last 10 days before the deadline? I imagine they were monumental and ones to remember? Or maybe you'd rather forget them :) I heard that you did not sleep much?

Denis: What can I say :) Despite all the planning, new issues were popping up that needed to be resolved. One of the problems was that we had multiple subscriptions on program account change that worked fine on a local node but on a DevNet that wasn’t working. So I had to change this to only one subscription per program. There were also some other issues, but this is all part of programming where you have to solve all kinds of problems. I think that on Thursday, one day before the deadline, I didn’t sleep for 40 hours.

That sounds intense….so, can we actually test the chat, or was it opened only for hackathon judges?

Peter: FOURim testing is available for all by logging into the 4thTech Web Platform. Note that at this moment FOURim is running under Solana DevNet so DevNet tokens are needed to execute transactions. Tokens are available publicly, so anyone can airdrop them to their FOUR wallet Solana account.

Can you maybe take us through how the chat works?

Peter: To exchange instant messages from one FOURwaL SOL address to another FOURwaL SOL address, there are a few steps to take: (1) DL 4thTech FOURwaL and initialize it; (2) Log in to the 4thTech Web Platform; (3) Airdrop SOL to the FOURwaL Solana Account (available in the account section); (4) Click the “instant messaging” TAB; (5) Add new contact by pasting the FOURwaL SOL recipient address (available in the friends FOURwaL account section); (6) Start chatting; (7) Check your transactions by clicking on an Explorer link below.

Ok, so if I understand correctly both protocols are up and running, Andrej can you talk about this more?

Andrej: Both protocols are currently deployed on Solana DevNet. DevNet is a Solana testing network. FOURdx is close to production, and while the FOURim needs some more development time, there are some challenges that need to be solved. In any case, both protocols are operational and free to test.

Andrej, what did you do exactly, what part of the development was your responsibility?

Andrej: At first, I created and implemented a FOURim design into the 4thtech platform. The next thing was to add Solana support to FOURwal, and in the end, I was helping with connecting platform implementation with the blockchain program.

What were the technical challenges that accompanied both deployments?

Denis: The Solana blockchain offers quite a lot of options for developers, but it’s crucial to know that it is its own unique infrastructure and it cannot be compared to other blockchains. There are some similarities but the “getting up to speed learning curve” is demanding itself. First, we had to learn all the ins and outs to find a perfect solution that would make sense and would enable both FOURdx and FOURim. The approach of constructing the smart contract used on other chains was not applicable here. For example, on-chain storage was a challenge, figuring out how to store messages on-chain the right way took me more time than I expected because, at first, I tried to keep all data in one place, but Solana has limited space, and we needed a better solution.

Can you try to explain which FOURim smart contract solution or approach prevailed in the end?

Denis: Yes, I will try but it is quite complicated for all not familiar with Solana systems. All data on the Solana blockchain is saved in the PDA accounts. PDA accounts are owned by the FOURim program (smart contract). FOURim uses five different types of accounts:

  1. The user account that holds conversation counter data.
  2. Conversation account that holds message counter.
  3. User conversation account that holds conversation address.
  4. Message account that holds message data (sender, message type, content timestamp).
  5. Conversation encryption info-account that holds data of the encryption conversation.

We initialize the conversation between two wallets by:

  1. creating a user account for the sender and receiver;
  2. creating a conversation account;
  3. creating two user conversation accounts, one for the sender and the second for the receiver;
  4. creating a message account;
  5. creating a conversation encryption account.

When the already created conversation continues, a new message account is created and the message counter in the conversation account is increased.

Ok, this is quite technical, can anybody offer a more general clarification?

Andrej: Maybe I can give you a simpler clarification from a different point of view. Let’s say that you want to read all data related to you. At first, you need to know how many conversations you have. You get this info from a user account. Now you have to get all messages for every conversation. To do that, you have to know how many messages a conversation has. This info is stored in a conversation account, but you have to get an address for a conversation account before that. And that address you get from a user-conversation account. And now we have all the data to retrieve all messages from a conversation.

How did you solve the message speed challenge? Solana is fast, but surely there must be some caching involved?

Denis: Yes, of course. The main problem is that when you load a conversation, all messages need to be retrieved from a blockchain, which takes some time because every message is stored on a separate account, and the more messages the conversation has, the more time it takes to load messages.

Caching is a solution to prevent repeatedly loading all data from a blockchain that was already retrieved in the past.

Ok, I must ask, what was happening behind the scenes? I read that there were over 5000 applicants?

Tali: Yes, the hackathon was massive, there were 5879 participants. As far as we know there were only 568 submissions that made it to the second round.

I’m reading the Devpost mail from the 25. Of October, which explains to the 568 participants that only top presentation selections will go through a formal code review, do you know if you were among the top selections?

Tali: During the judging process, we were contacted three times by the Solana team. According to them, our submission was super impressive and our code was part of the evaluation, so yes, we could say that we were among the top selections.

So you know your code was evaluated. Do you have any idea, what could be the reason why you did not make the final breakthrough?

Tali: There could be a number of reasons, our solutions are for one limited to be used only with FOURwaL. The FOURwaL was designed from the ground up with the specific purpose of supporting data exchange in one form or another, so enabling other wallets to serve the same function would require significant changes on the protocol and web platform end. The FOURim messaging protocol was made to be used as a part of the 4thTech desktop web platform, with the plans to evolve into a mobile version. The chat that was selected by the judges was presented as a mobile solution from the beginning. It’s hard to say what the final deciding factor was. We are proud to have made it so far, to be recognized and to establish an active relationship with the Solana team. In the process, we managed to deliver a working FOURim messaging BETA protocol, deployed on the Solana DevNet and added additional network support to the FOURdx, all that in record time.

Can we take a step back toward understanding your tokenization model?

Tali: I will try to simplify as much as possible. When using the data file exchange of FOURdx, there are two costs appearing. Blockchain transaction cost and 4thTech margin cost. FOURdx supports Ethereum, Tolar, Polkadot Substrate Edgeware and Solana, so if the user opts for the Ethereum chain, the Ethereum transaction cost will be settled in ETH, if the user chooses Solana, the TX cost will be settled in SOL and so on. To simplify the user’s experience, we kept the settlements in the native tokens of the selected chain.

The FOURim or instant messaging protocol transaction cost is for now solely based on the Solana blockchain network transaction cost and for now has no additional service FEE margin. To use it SOL tokens will be needed.

Ok, let’s wrap up with a final question, what are your current plans?

Tali: We can divide our plans into three goals, first and foremost we must finish the Solana implementations, which include the FOURim transformation from BETA to production and deployment of FOURdx and FOURim smart contracts from DevNet to Solana mainnet.

Parallel to that, we will be concentrating on UI platform update 2.2, which will include design upgrades and quite a lot of user-related feature updates.

Well, thanks, guys, this looks like a good point to end…is there anything else you'd like to add?

Tali: I would just like to thank all of my colleagues on the 4thTech team. It’s amazing what can be achieved in such a short timeframe. I know that the Hackathon process was taxing, I know that we did not get any sleep during the process, but I know that it was worth it, we now have a working on-chain messaging solution running, so congrats to all of us and thank you, Nina, for hosting us.

My pleasure, thank you all and hope to have you on again in some time to see your overall progress.

Disclaimer

All content provided herein, including but not limited to text, graphics, logos, and images (the “Content”), is the property of Block Labs Luxembourg S.a r.l., a legal entity established under the laws of the Grand Duchy of Luxembourg, registered with R.C.S. Luxembourg under N B263508 at the following address: 41, rue du Puits Romain, z.a. Bourmicht (Atrium Business Park), L-8070 Bertrange, Luxembourg (the “Company” or “we”). It is protected by copyright and other laws that protect intellectual property and proprietary rights. You are granted a non-exclusive, non-transferable, revocable license to access and use the Content for the sole purpose of obtaining information about the 4thTech technology and other educational purposes. We have done our best to ensure that the Content is accurate, updated, complete, and provides valuable information, but neither do we guarantee nor take any responsibility for its accuracy and/or completeness. The Content is not intended as, and shall not be understood or construed as legal, financial, tax, or any other professional advice, sale or offer for sale of any securities, and/or crypto-assets. The Company is not engaged in rending of and/or is not licensed to render any of the crypto-asset services and/or financial services, such as investment or brokerage services, capital raising, fund management, or investment advice.

--

--

4thTech
/4thtech

L1 Secured W2W E2EE Immutable dMail & dChat Technology