Inspiration
Whenever we speak about online security we consider it a topic important to us. Securing your digital communications should be your highest priority when going online. Blockchain has always offered the promise of enabling secure, immutable W2W (i.e. wallet-to-wallet) communication while retaining data and identity ownership, it is by design the perfect security tool. However, it could never really take off due to early-generation blockchains' scalability and cost constraints. Enters TRON with its network stability, low transaction cost, fast transaction finality and vast user base fulfilling all needed parameters to support Web3's first secure on-chain communication. At the same time, its thriving ecosystem would benefit from the social messaging communication layers.
Season 2 vs Season 3 Clarifications:
4thTech is building Tron & Bittorrent Chain Secured W2W dMail & dChat communication framework. The Hackathon Season 2 submission was focusing on the dMail solution while illustrating the big picture of the future on-chain communication infrastructure that we are building. The Hackathon Season 3 submission is solving the other piece of the puzzle, the dChat. To clarify further:
- 4thTech = Web3 Secured W2W dMail & dChat communication framework stack.
- HolaChain = dMail & dChat application-specific TRON sidechain (future development)
- TRON hackathon season-2 Winner = TRON L1 Secured W2W dMail communication infrastructure (available at tron.4thtech.io as Beta).
- TRON hackathon season-3 Submission = TRON L1 Secured W2W dChat communication infrastructure (available at tron.4thtech.io as TestNet).
🔗 Season 2 Smart Contract link:
Shasta TestNet dMail
🔗 Season 3 Smart Contract link:
Shasta TestNet dChat
The dChat EVM framework was developed specifically for the TRON hackathon season 3. Both the dMail and dChat are already live on Tron Shasta TestNet (tron.4thtech.io). We are waiting for TronLink to enable the ComputeSharedSecret Method planned to be enabled in the next TronLink update. After the update, we can deploy the Tron Beta dMail & dChat on MainNet.
Background key points:
- The right to online safety should be above all and provided for all online communications.
- Blockchain protocols offered great promise but scalability, throughput and cost were always an issue.
- Web3 projects & DAOs all use Web2 communication tools, which goes against the decentralization ethos.
- Immutable on-chain W2W messaging is prime to become the future of secure Web3 communication - Not Your Keys, Not Your Message!
Solution key points:
- Establishing a TRON L1 on-chain communication framework that is web, desktop & mobile interoperable - One Message = One TRON L1 Transaction.
- Bringing social communication to the Web3 Ecosystem.
- E2EE (i.e. end-to-end encrypted) secure, immutable, censorship-resistant, scalable & accessible »on-chain« messaging.
- Web3 wallet login, no signup or personal information.
- Resistant to identity theft.
- W2W private, group & community on-chain messaging with an option of NFT curated chat groups (i.e. users will be able to connect to the on-chain messaging groups holding a specific NFT or token asset).
- Data file & media sharing via BTFS decentralized storage.
- Stand-alone app or White labelled (SDK).
- Interoperable with all significant TRON wallets.
- Due to heavy on-chain activity (i.e. 1 message = 1 TX), 4thTech enabled dApps can bring significant growth in daily TRON transactions volume.
What it does
Web3’s dChat framework enables security & data ownership within W2W communication:
- W2W E2EE dChat, Group dChat & NFT curated Group Chat.
- dChat SDKs & White-Labels.
Value proposition
When you think about 4thTech and what value it delivers, it really is quite straightforward. There are four major value propositions.
- 4thTech utilises blockchain to enable immutability and security in online communication, which is now virtually non-existing in traditional Web2 applications.
- Behind the scenes, 4thTech enables any project to integrate the dMail & dChat layers into their platform UIs or wallets using the SDK framework.
- To ensure true on-chain security 4thTech protocols have to be transaction heavy as every message represents its own transaction. Due to this heavy on-chain activity (i.e. one message = one transaction), 4thTech dApps bring significant growth in daily L1 transactions.
⚡️ 10 messages per day MainNet transaction projection.
| No. of dChat users on TRON | Daily TX | Monthly TX | Yearly TX |
|---|---|---|---|
| 1,000 | 10,000 | 300,000 | 109,500,000 |
| 10,000 | 100,000 | 3,000,000 | 1,095,000,000 |
| 25,000 | 250,000 | 7,500,000 | 2,737,500,000 |
| 50,000 | 500,000 | 15,000,000 | 5,475,000,000 |
| 100,000 | 1,000,000 | 30,000,000 | 10,950,000,000 |
| 250,000 | 2,500,000 | 75,000,000 | 27,357,000,000 |
💡 If we take a look at the third row for example 25,000 TRON users sending 10 messages per day produce 7.5 Mio transactions a month, those users also create 75k of monthly L1 transaction fees but they also created 7.5k of dChat service fees considering the fee is based at only 10% of the L1 transaction cost.
4thTech Core Primitives:
⚡️ One Message = One L1 Transaction
To enable true message immutability, the dChat W2W message exchange happens on-chain, as one short message represents one immutable L1 transaction. Blockchain is used to store encrypted messages, timestamps & sender addresses.
⚡️ Not Your Keys = Not Your Message
Every wallet becomes an on-chain identity & message data vault, accessible/decrypted only with users' private keys!
⚡️ L1 security + Encryption + Decentralized storage = Secure W2W dChat Communication
True dChat security is achieved by utilising L1s security, encryption-hashing cocktail (AES, RSA, SHA-256, ECDH) and BTFS decentralized storage.
How we built it
Security by design was our guiding approach, that simply means that we put into consideration how we could preserve immutability, guarantee protection, and obfuscate metadata to the largest possible degree at the forefront of all our architectural decisions. At the same time, no personal data whatsoever is collected by the protocol. Code is Law, principles apply!
The full project framework consists of six main parts;
- (1) dChat Protocol;
- (2) dMail Protocol (i.e. dMail Framework - TRON hackathon season-2 Web3 track Winner);
- (3) dID;
- (4) UI platform (i.e. tron.4thtech.io);
- (5) SDK framework, and;
- (6) Encryption framework.
The dChat EVM framework was developed specifically for the TRON hackathon season 3. The dChat is deployed on TRON Shasta TestNet and ready for TRON MainNet. Other solutions are in development and a part of the grand project roadmap. To ensure true on-chain immutability and utilise the security of an underlining L1, 4thTech protocols have to be transaction heavy as every dChat message or email represents its own transaction which comes with the cost of writing data on the blockchain. 4thTech protocols can strongly contribute to TRON L1 transaction volume, while its solid fee model can support the project in the future. Let's not forget one message = one transaction, which = one service fee.
⚙️dChat Protocol (EVM SC): Solidity-based W2W messaging protocol that enables on-chain E2EE immutable messaging, group chat & curated community chats.
Smart Contract link: dChat SC
The Messaging process itself is pretty straightforward. Let’s take an example of Alice and Bob:
- ➡️ Step 1 - A public and private key pair are created for Alice & Bob. Alice creates a message along with a picture or data file attachment she wants to send to Bob.
- ➡️ Step 2 - The send message is encrypted with Advanced Encryption Standard (AES), while Elliptic-Curve Diffie-Hellman (ECDH) key agreement protocol is used for generating the secret key (used in AES encryption). At the final stage of step 2, the message hash is written on the TRON blockchain. Just to clarify, this message is temporarily stored on-chain, while attachments are stored on decentralized storage.
- ➡️ Step 3 - Bob receives and decrypts the message and attachment sent by Alice with his private key.
- ➡️ Step 4 - The message and its attachments are stored in Bob's local storage.

- 💡To enable the use of the TronLink wallet, we have to upgrade the encryption standard to Elliptic-Curve Diffie-Hellman, while the TronLink wallet needs to add/permit; (1) ComputeSharedSecret(otherPublicKey) method (shared secret key computation) and; (2) permission for executing the calling method. Both issues are being solved.
Message encryption example:
// Asymmetric encrypt
const key = new NodeRSA();
key.importKey(publicKey, 'pkcs8-public');
const encrypted = key.encrypt(messageContent, 'base64');
Save to blockchain:
// Save data to blockchain
const txMessageInfo = await chain.sendMessage(receiver, messageType, content, messageText);
⚙️dID Protocol (Typescript, Vue.js): Serves as a public key exchange point between users and connects wallets during the dMail & dChat data exchange process. FOURid docs.
⚙️UI platform (Typescript, Vue.js): Written with TypeScript, a superset of JavaScript and utilises Vue 3 framework. Serves as 4thTech native UI and White-label GUI framework. UI platform docs.
⚙️SDK framework (Typescript): EVM compatible dMail & dChat SDK framework enables back-end partner integration into their UIs or Wallets.
⚙️Encryption (AES, ECDH): While the message is encrypted with Advanced Encryption Standard (i.e. AES), the Elliptic-Curve Diffie-Hellman (i.e. ECDH) key agreement protocol is used for generating a secret key (i.e. used in AES encryption). The implementation of the Elliptic-Curve Diffie-Hellman protocol will enable the interoperability of 4thTech communication protocols with TRON wallets. Encryption docs.
TRON Deployment
We were thinking about a two-step approach to TRON deployment:
Due to TRONs EVM interoperability, tested network resilience, security, low TX cost and fast transaction finality, we see viable commercialization on TRON MainChain:
- Social dChat layers with immutable & secure W2W on-chain communication.
- dChat SDK framework for direct back-end integration for ecosystem partners' UIs or Wallets.
- W2W exchange of data & media via BTFS decentralized storage (i.e. already in dev as a part of the Tron dMail).
In step 2, we believe that an application-specific TRON sidechain (e.g. HolaChain) is needed to enable stable, scalable, and even lower-cost blockchain infrastructure to power the future on-chain W2W communication. Due to TRON dAppChain EVM interoperability, TRON MainChain shared security and battle-tested design framework, we see real integration possibilities for;
- Web, mobile & desktop dChat framework at scale.
- SDK dChat framework for web, mobile & desktop.
- Low-cost W2W exchange of data & media via BTFS decentralized storage is also suitable for Enterprise.
4thTech Databases & Storage
- Blockchain is used to store; (1) dChat encrypted message, timestamp & sender address. The overall security of the blockchain network depends on its decentralization, while access security depends on the user's private key safety measures;
- Decentralized storage BTFS is used for the temporary or permanent storage of encrypted data files, media and JSON files (i.e. dMail, subject & content attachment location) that are exchanged between wallets in the dMail or dChat process. The decryption and access to the data files are possible only with a private key of the user;
- To comply with GDPR, the data file cloud repository is also an option that is used for the temporary 7-day storage of encrypted data, media and JSON files (i.e. dMail subject, content attachment location) that are exchanged between wallets in the dMail or dChat process. The decryption of the data files is possible only with a private key of the user. The data file cloud repository is protected by a firewall. In the case of a user request, it is possible to delete any user-related data to comply with GDPR regulations;
- User local storage is used to store; (1) wallet private keys; (2) dMail & dChat content, and; (3) user-initiated backup of conversations, data files and reports. The security of local storage is in the user's domain.
Speed & Pricing
The average TRON transaction confirmation is <3s, with a transaction (i.e., TX) estimated price of 0.01$. As one message represents one TRON L1 transaction, we can determine that one message cost is 0.01$. After significant testing on Shasta TestNet, we have come to the conclusion that the send or receive message speed depends on the message length, encryption/decryption process and transaction finality as it varies between 3 to 5 seconds. As every message represents its own on-chain confirmed transaction and needs to be encrypted and decrypted this is still a good result and it is as “instant” as it can get with a current framework. Further TRON MainNet testing will be done to produce more accurate results. Currently, only TRX TX cost is being charged, while a small protocol service fee will be added in the production version.
Fees:
- In the case of TRON MainChain deployment fees are charged in TRX (i.e. one message = one transaction), while the protocol charges an additional service fee. The service fee is charged on-chain and represents a small % of the transaction cost.
- In the case of application-specific HolaChain AppChain the native token utility is quite straightforward. The token would be used as gas while also having governance functions.
Challenges we ran into
We spent over four years developing the 4thTech multi-chain communication building blocks, built around security and ecosystem integrations deployed on various Layer 1s. As time passed, some of the chosen L1s did not pan out due to interoperability or scalability issues. So the main challenge is to find the most suitable underlying L1 that would fit all the main requirements and make on-chain immutable communication usable at scale.
E2EE group messaging was always challenging to achieve, this goes for Web2 and especially for Web3. Developing the tech to support on-chain E2EE group messaging was a challenge in itself. We solve it by random generation of the secret key, that is used to encrypt/decrypt messages. The secret key is distributed to all group members and separately encrypted with Advanced Encryption Standard (i.e. AES) over the Elliptic-Curve Diffie-Hellman (i.e. ECDH) key agreement protocol. This opens a whole new chapter in Web3 on-chain communication and could disrupt traditional Web2 messaging communication platforms.
Accomplishments that we're proud of:
- 2018: Ethereum dID, dMail, dNotary deployment (EVM, Solidity) - Beyond 4.0 award.
- 2020: SI-Chain dID, dMail, dNotary deployment (EVM, Solidity) - UNCEFACT use case.
- 2020: Tolar HashNet, dID, dMail, dNotary (EVM, Solidity) - EU Consortium Grants.
- 2021: Edgeware, dID, dMail, dNotary (Substrate, Rust) - Endorsement.
- 2021: Solana, dID, dChat, dMail, dNotary (Rust) - Endorsement.
- 2022: Moonbeam, dID, dMail, dNotary (EVM, Solidity) - TestNet.
- 2022: Tron, dID, dMail, dNotary (EVM, Solidity) - Tron Grand Hackathon Winner Web3 track.
- 2022: EVMOS, dID, dMail, dNotary (EVM, Solidity).
- 2022: Tron dChat (EVM, Solidity).
What we learned
- Blockchain has always offered the promise of enabling secure, immutable W2W communication while retaining data and identity ownership, it is by design the perfect security tool.
- Due to stability and scalability issues, early-generation blockchains can not sustain the on-chain communication infrastructure.
- User migration from “free” but not private Web2 communication platforms to payable but private Web3 infrastructure will be challenging, so new incentive onboarding models will have to be introduced.
- With the rise of security awareness and Web3 adoption in general, the on-chain W2W email & messaging could become the dominant communication and as such can become the future of immutable online communication. The security of Web3 native features is just too good to be overlooked “Not Your Keys, Not Your Message!”
How to test?
Step 1: Download & setup FOURwaL (follow the link below);
Step 2: Login to the tron.4thtech.io (follow the link below);
Step 3: Airdrop TRON TestNet tokens to the FOURwaL account (address available in the accounts tab);
Step 4: Click the “dChat” TAB;
Step 5: Add new contact by pasting the FOURwaL TRON TestNet recipient address.
Step 6: Start sending on-chain messages.
Step 7: Check your transactions by clicking on the Explorer links available in the UI.
💡 Note: Both, the wallet of the sender and the wallet of the receiver must have a positive TRX balance
🔗 Tron dChat Onboarding Tutorial
🔗 Tron dChat TestNet Recording
🔗 FOURwaL Chromium DL.
🔗 FOURwaL Mozilla DL.
🔗 TRON dChat TestNet.
🔗 TestNet token mint.

Log in or sign up for Devpost to join the conversation.