TRON L1 Secured W2W dChat Communication Framework

Hackathon Project Name: HolaChain, TRON L1 Secured W2W dChat Communication Framework
Track: TRON Hackathon Season 3, Web3
Team Name: 4thTech
Team Member(s): 6
Season 3 DevPost URL: https://devpost.com/software/holachain-tron-l1-secured-w2w-dchat-communication-framework

Project Goal: To not be only an end-user dMail & dChat UI dApp but a permissionless communication standard that enables 1000s of dMail & dChat dApps Blum on Web3, via SDKs & White-labels, while its core Web3 primitive; one message = one L1 transaction, utilises L1s security to enable immutable W2W on-chain communication.

Project Deck: TRON-secured-W2W-dMail-dChat-communication_public-v2.pdf (5.4 MB)

Project Websites: https://4thtech.io/, https://wiki.4thtech.io/, https://tron.4thtech.io/

Project Test Instructions:
Step 1: DL & setup FOURwaL by following the link below (TronLink wallet will be enabled in Q4);
Step 2: Log in to the tron.4thtech.io;
Step 3: Airdrop TRON Shasta TestNet tokens to the FOURwaL account (address available in the accounts tab);
Step 4: Click the ā€œdMailā€ or ā€œdChatā€ TAB;
Step 5: Add new contact by pasting the FOURwaL (later TronLink) 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.

:bulb: Note: Both, the wallet of the sender and the wallet of the receiver must have a positive TRX balance

:link: Tron dChat Onboarding Video Tutorial
:link: Tron dChat TestNet Video
:link: FOURwaL Chromium DL (testnet wallet)
:link: FOURwaL Mozilla DL (testnet wallet)
:link: TRON dChat TestNet UI (tron.4thtech.io)
:link: TestNet token mint

:bulb: Tron dMail & dChat are already available for testing. Feel free to test Tron dMail & dChat using the FOURwaL TestNet wallet and tron.4thtech.io UI.

:link: Shasta TestNet dChat Smart Contract - Season 3
:link: Shasta TestNet dMail Smart Contract- Season 2

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 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 & BTTC L1 Secured W2W dMail communication infrastructure.
  • TRON hackathon season-3 Submission = TRON L1 & BTTC Secured W2W dChat communication infrastructure.

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 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.
  • 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 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 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.

:zap: 10 messages per day MainNet transaction projection.

No. of dChat users on TRON Daily TX Monthly TX Yearly TX
1000 10000 300000 109500000
10000 100000 3000000 1095000000
25000 250000 7500000 2737500000
50000 500000 15000000 5475000000
100000 1000000 30000000 10950000000
250000 2500000 75000000 27357000000

:bulb: 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:

:zap: One Message = One L1 Transaction

The dChat W2W message exchange happens on-chain, as one short message represents one L1 transaction. Blockchain is used to store encrypted messages, timestamps & sender addresses.

:zap: Not Your Keys = Not Your Message

Every wallet becomes an on-chain identity & message data vault, accessible/decrypted only with usersā€™ private keys!

:zap: L1 security + Encryption + Decentralized storage = Secure W2W dChat Communication

True dChat privacy is achieved by utilising L1s security, encryption 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 privacy, 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) FOURim Protocol (i.e. dChat framework - TRON hackathon season-3 submission);
  • (2) FOURdx Protocol (i.e. dMail Framework - TRON hackathon season-2 Web3 track Winner);
  • (3) FOURid Protocol;
  • (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 privacy 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.

:gear: FOURim Protocol (EVM SC): Solidity-based W2W messaging protocol that enables on-chain E2EE private messaging, group chat & curated community chats. FOURim docs.

  • Tron dChat TestNet Smart Contract link:
    FOURim SC (shasta testnet)

The Messaging process itself is pretty straightforward. Letā€™s take an example of Alice and Bob:

  • :arrow_right: 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.
  • :arrow_right: 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.
  • :arrow_right: Step 3 - Bob receives and decrypts the message and attachment sent by Alice with his private key.
  • :arrow_right: Step 4 - The message and its attachments are stored in Bobā€™s local storage.

  • :bulb: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.

:gear: FOURdx Protocol (EVM SC): Solidity-based E2EE email protocol resilient to data mining & spoofing, that enables users to share content, files and media from wallet to wallet. TRON dMail is currently available in BETA. FOURdx docs.

  • :bulb:As dMail is data heavier, lite encrypted JSON files are created to hold the dMail metadata (i.e. subject, content & attachment location) while the link to this JSON metadata file & checksum (i.e. dMail content structure SHA-256 hash) are recorded on-chain in the form of an L1 transaction. So again the core primitive ā€œone message = one L1 transactionā€ applies.

  • Tron dMail TestNet Smart Contract link:
    FOURdx SC

:gear: FOURid 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.

:gear: 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.

:gear: SDK framework (Typescript): EVM compatible dMail & dChat SDK framework enables back-end partner integration into their UIs or Wallets.

:gear: 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 private & secure W2W on-chain communication.
  • dChat SDK framework for direct back-end integration into 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 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.

Tokenomisc:

There are two approaches to project tokenomics;

  • 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 DAppChain the native token utility is quite straightforward. The token would be used as gas while also having governance functions.

If needed a dChat brand spin-offs can be deployed with their own tokenomics layers, while the 4thTech genesis asset will enable SDK partner incentive staking with fee discounts. 4thTech can also enable additional revenues for dMails & dChat SDK partners or L1s in the form of smart contract fee sharing (i.e. to ensure true on-chain security, 4thTech protocols are transaction heavy as every message or email represents its own transaction). Blockchain transactions are accompanied by dMail & dChat service fees that can be shared with onboarding partners.

Challenges we ran into

We spent over four years developing the 4thTech multi-chain communication building blocks, built around privacy 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 private 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 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, dChat, dMail, dNotary (EVM, Solidity).
  • 2022: Tron dChat (EVM, Solidity).

What we learned

  • Blockchain has always offered the promise of enabling private, 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 private online communication. The privacy and security of Web3 native features are just too good to be overlooked ā€œNot Your Keys, Not Your Message!ā€

Hackathon-related Project Milestones:

:arrow_right: Q4 2022 TRON dMail BETA (done).
:arrow_right: Q4 2022 TRON dChat TestNet.
:arrow_right: Q1 2023 TRON dMail & dChat MainNet, E2EE chat groups, BTFS, white-label & SDK.
:arrow_right: Q4 2023 Application-specific TRON sidechain (e.g. HolaChain).

12 Likes

Welcome to TRON Hackathon :blush:ā€¦ best wishes :+1:

1 Like

HOLA, siempre es agradable escuchar que se consigue privacidad en lo referente a tu mail, opiniones, manera de gestionar, lo mƔs interesante para obtener esto, es al final el coste total de interactuar para los usuarios.

1 Like

@antonio thanks for reading the post:) There are two options regarding user cost; (1) the current Web2 ā€œfreeā€ not secured, and; (2) the future Web3 L1 transaction-cost based. Like the saying goes ā€œIf you are not paying for the product, then you are the productā€. In Tronā€™s case, this might even not be true. With Tron staking you can get a number of transactions for free, so with moderate use, the dMail or dChat transaction cost would be close to zero.

All the best form 4thTech

2 Likes

GRACIAS por la respuesta, proyecto interesante, suerte.

2 Likes

wow what a detailed project, loved that omg

1 Like

@4thtech Privacy and encrypted messaging will be a large part or web 3 going forward so good to see a project with this focus in mind as we see more people coming online people are not understanding how much of their security is given away

Looking at the details you have supplied this is well thought out and underway, keep the updates coming as this is a great entry for season 3 :ok_hand:

1 Like

Looks Great, Looking Forward To it.

2 Likes

Thanks, we try to do our best:)

1 Like

We appreciate the recognition of the value that we try to bring:) Thanks for the kind words:)

Greetings 4thtech! Your project seems to be missing details on the following. Please add them to your project. Thank you!

Please Include:
Contract Address

After a thorough scan, it looks like your project post is very similar to a project that has been posted in Season 2 - HolaChain, Web3 Secured W2W Communication Infrastructure | Devpost. According to post #6 of TRON Grand Hackathon Season 3 - Get started Now! projects that havenā€™t completed their roadmap for the Hackathon in past Hackathons will not be eligible for the current season. Please make sure your existing project is already live and for the community to use.

2 Likes

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.
*TRON hackathon season-2 Winner = TRON L1 Secured W2W dMail communication infrastructure (available at tron.4thtech.io as TestNet).
*TRON hackathon season-3 applicant = TRON L1 Secured W2W dChat communication infrastructure (available at tron.4thtech.io as TestNet).
*HolaChain = dMail & dChat application-specific TRON sidechain (future development).

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.

All this is also clarified in both Season 2 & 3 submissions.

The contract address for Season 3 hackathon is also included: TRONSCAN | TRON BlockChain Explorer | ę³¢åœŗåŒŗå—é“¾ęµč§ˆå™Ø

3 Likes