# Discover 4thTech


# Layer Infrastructure

  1. product layer defins all project products (i.e. dID, dMail, dNotary, dChat);
  2. use cases layer defines all the project protocols (i.e. FOURid, FOURdx, FOURns, FOURim);
  3. the second layer defines the platform components (i.e. public/private key management service, data encryption service and tokenization service;
  4. the third layer defines the applications (i.e. UI-platform, browser extension wallet, API services and smart contracts);
  5. infrastructural layers are defining capabilities and connectivity’s to blockchain networks and hardware and scalability tools.

4thTech layer Infrastructure

# FOURwaL

Solution

Due to specific requirements of 4thTech on-chain communication protocols (i.e. dID, dMail, dChat, dNotary) where data is being exchanged and confirmed between wallets, a custom non-custodial wallet framework had to be developed which enables UI-platform, UI-staging and White-labels UIs access. Users can transact and communicate using the same wallet account across multiple dApps (i.e. dMail, dChat, dNotary) as their anonymous on-chain identity is seamlessly transferable between them. Furthermore, the 4thTech wallet framework (i.e. FOURwaL) supports multi-chain accounts on Ethereum, Tolar, Edgeware, Solana and Moonbeam blockchains. FOURwaL framework enables white-label partner projects to adopt the 4thTech multi-chain solutions (i.e. dID, dMail, dChat, dNotary) and bridge a gap between Ethereum, Polkadot and Solana based networks, while still having the option to include their native Ethereum (i.e. ERC20, BEP20, POS) based tokens as an incentive to enable additional feature access or transaction fee discounts.

FOURwaL

The FOURwaL wallet framework supports all Chromium & Mozilla based browsers and provides a secure way to connect to Web3 dID, dMail, dChat & dNotary as it contains a pair of public and private cryptographic keys. A public key allows; (1) RSA encryption of data; (2) screening of recipient wallet addresses (i.e. Ethereum, Solana…); (3) for other wallets to execute services to the desired wallet’s address, whereas a private key enables the decryption of received communication such as dMails and short messages from the sender address. With the exception of the backup and restore function, all the wallet account management is available within the UI-platform.

# FOURwaL features

  • Onboarding with no email or phone number
  • Ethereum, Polkadot & Solana multi-chain wallet
  • Data communication layer
  • Standalone white-label solution
  • Interoperable with all Chromium & Mozilla based browsers

FOURwaL

# FOURwaL functions

  • to serve as a gateway connecting user with on-chain services
  • to enable on-chain digital identity
  • to enable wallet to wallet data exchange and comunication;
  • to act as a on-chain data file and message exchange transaction signing tool
  • to be used as a cryptographic token (i.e. FOUR, ETH, GLMR, TOL, EDG, SOL) gas wallet
  • to manage the public and private keys
  • to be used for private keys backup

# Built & Security

The FOURwaL is fully operational within the ecosystem of Chromium and Firefox browsers and performs tech specific features neaded for services execution. FOURwaL utilises advanced encryption standard (i.e. AES), with a combination of RSA encryption and hash algorithm 256 (i.e. SHA 256) to secure immutable data exchange. FOURwaL contains a pair of public and private cryptographic keys. A public key allows for other wallets to execute data communication to the desired wallet’s address, whereas a private key enables the decryption of data from that address.

# Wallets UI

The FOURwaL has a modern minimalistic design style that emphasises simplicity with simple intuitive but effective navigation and setup system. A simple user interface has been designed and developed to offer a step-by-step setup enabling the best possible user experience.

# FOURwaL installation

  • follow the link to Google Chrome or Mozilla Firefox add-on store
  • add an extension to chrome or firefox browser
  • with the installed extension, the wallet icon becomes visible on the right browser side
  • click on the wallet icon and set up your wallet
  • refresh the platform page (opens new window) and log in

🔗 FOURwaL Google Chrome Store: Extension (opens new window) 🔗 FOURwaL Mozilla Firefox Store: AddOn (opens new window)

# FOURwaL privacy clarifications

  • FOURwaL does not collect any user data, it only requires permission to read and write from 🔗 https://app.4thtech.io;
  • storage is used for saving encrypted private keys for Ethereum, Tolar HashNet, Polkadot and Solana wallets and RSA private key.;
  • downloads are used for private keys backup and for downloading decrypted data files;
  • when using the 4thTech platform (opens new window), the active tab is needed to inject JavaScript code which is needed to interact between the 4thTech platform (opens new window) and browser extension.

# Supported Blockchain Accounts

FOURwaL supports storing below blockchain accounts:

Blockchain Accounts Short
Ethereum ETH
The 4th Pillar token FOUR (ERC-20)
Moonbeam GLMR
Tolar TOL
Edgeware EDG
Solana SOL

# UI-Platform

UI

The 4thTech UI-platform serves as an onboarding hub accessed by the user via Web3 wallet. It connects and hosts all the 4thTech protocols and services in one ecosystem, giving the user all in one access to:

  • The 4thTech UX.509-to-Web3 digital identity (i.e. dID);
  • multi-chain W2W E2EE data exchange (i.e. dMail);
  • on-chain data verification (i.e. dNotary);
  • multi-chain W2W E2EE messaging (i.e. dChat)

UI

Tip

💡 To login to the 4thTech UI-platform, please follow this link (opens new window).

# Build

As a part of the 2.0 update, the 4thTech UI-platform codebase was rewritten with TypeScript and has overgone the crucial performance upgrade from Vue 2 to Vue 3. New features and functions are embedded, so the user experience can be as intuitive as possible. The 2.0 update includes an automatic dNotary system, while the blockchain network address recognition system simplifies the dMail process. The 4thTech UI-platform 2.0 enables users to solve important technical blockchain challenges within a niche sector of data exchange while supportingEthereum, HashNet and Substrate public and private chains.

# UI Design

The UI-platform 2.0 re-design brings a modern minimalistic design style that emphasises simplicity with simple yet effective navigation and application system. Light white colours predominate the interface, inspiring the users with simplicity and reassurance while executing complicated transactions in the background.

# UI-Staging

Intro

Usually staging is set up to replicate the production environment, test code or updates to ensure quality under a production-like environment before application deployment. In most cases, Staging is not open to the public domain. This was also the case for 4thTech, but with the emerging online privacy needs dID, dMail, dNotary & dChat are now open for public testing and available in 4thTech UI-staging.

Even though the 4thTech Staging environment is a replica of the production environment, there are still some key differences such as; (1) different UI-platform access links (staging.4thtech.io instead of app.4thtech.io); (2) production environment uses public MainNet blockchains, while Staging uses TestNets and pilot DLT network SI-Chain, and; (3) production environment transactions use valuable MainNet tokens for gas, as Staging uses free TestNet tokens.

In a non-production multi-chain environment, 4thTech Staging supports; (1) Ethereum Test Net Kovan; (2) HashNet protocol based SI-Chain (i.e. Slovenian national blockchain testing infrastructure); (3) Edgeware TestNet, (4) Solana DevNet and; (5) Moonbase TestNet.

Note

💡 Connect to staging (opens new window) or access user guide.

# Kovan

Kovan TestNet is a fast, reliable, Proof of Authority (PoA) Ethereum test blockchain publicly accessible for Ethereum developers. 4thTech enables Kovan to power the following protocols, de-apps, clients; (1) FOURwaL (i.e. 4thTech wallet that enables Web3 communication); (2) FOURid (i.e. 4thTech digital identity protocol that connects wallets when data is exchanged and serves as the public key exchange point between users); (3) FOURdx (i.e. open-source data exchange protocol, that enables E2EE, immutable and verifiable wallet-to-wallet dMail), and; (4) FOURns (i.e. open-source verification dNotary protocol that uses file checksum to check for potential data changes during the dMail data exchange).

🔗 FOURdx Smart Contract on Kovan: Link (opens new window)
🔗 KOVAN Explorer: Link (opens new window)

# SI-Chain

In February 2020, 4thTech joined the Slovenian national blockchain testing infrastructure called SI-Chain. Supported by the Slovenian Ministry of Economic Development and Technology, powered by HashNet and Telemach, Si-Chain was established in November 2019 with the intent to enable testing of existing and new blockchain applications for the public and private sector.

4thTech enables SI-Chain to power the following protocols, de-apps, clients; (1) FOURwaL (i.e. 4thTech wallet that enables Web3 communication); (2) FOURid (i.e. 4thTech digital identity protocol that connects wallets when data is exchanged and serves as the public key exchange point between users); (3) FOURdx (i.e. open-source data exchange protocol, that enables E2EE, immutable and verifiable wallet-to-wallet dMail), and; (4) FOURns (i.e. open-source verification dNotary protocol that uses file checksum to check for potential data changes during the dMail data exchange).

Note

💡 Allow CORS Google Chrome add-on must be installed and enabled to access SI-Chain. Follow the link bellow.

🔗 Allow CORS: Link (opens new window)
🔗 FOURdx Smart Contract on SI-Chain: Link (opens new window)
🔗 Read More: Link (opens new window) Medium (opens new window)

# Substrate Edgeware

In April 2021, 4thTech started to support Edgeware, a Polkadot Substrate smart contract chain. With over eight months in development, 4thTech Edgeware support was a crucial step toward Polkadot ecosystem interoperability.

4thTech enables Edgeware to power the following protocols, de-apps, clients; (1) FOURwaL (i.e. multi-chain 4thTech wallet); (2) FOURid (i.e. 4thTech identity protocol); (3) FOURdx (i.e. open-source web 3 data file exchange protocol), and; (4) FOURns (i.e. data file verification and notarisation protocol).

# Solana

Up to now, on-chain instant messaging would be hard to achieve due to slow blockchain network speed, congestion and Layer 1 transaction cost. With the arrival of the Solana blockchain fast execution apps on-chain, messaging has the potential to become a reality. To address this issue in 4thTech, developed and deployed a unique, safe solution, which leverages the Solana blockchain and enables end-to-end encrypted, immutable, wallet to wallet short messaging.

4thTech enables Solana to power the following protocols, de-apps, clients; (1) FOURwaL (i.e. 4thTech wallet that enables Web3 communication); (2) FOURid (i.e. 4thTech digital identity protocol that connects wallets when data is exchanged and serves as the public key exchange point between users); (3) FOURdx (i.e. open-source data exchange protocol, that enables E2EE, immutable and verifiable wallet-to-wallet dMail); (4) FOURns (i.e. open-source verification dNotary protocol that uses file checksum to check for potential data changes during the dMail data exchange), and; (5) FOURim (i.e. open-source on-chain E2EE dChat).

🔗 FOURdx Smart Contract on Solana TestNet: Link (opens new window)
🔗 FOURim Smart Contract on Solana DevNet: Link (opens new window)

# Moonbase TestNet — dID, dMail, dNotary

Moonbase is the first Moonbeam TestNet. It aims to provide developers with a place to start experimenting and building on Moonbeam in a shared environment. Since Moonbeam will be deployed as a parachain on Kusama and Polkadot, the is built to be able to reflect production configuration. For this reason, TestNet needed to be a parachain-based configuration rather than a Substrate development setup.

4thTech enables Moonbase to power the following protocols, de-apps, clients; (1) FOURwaL (i.e. multi-chain wallet); (2) FOURid protocol (i.e. on-chain identity); (3) FOURdx protocol (i.e. open-source W2W dMail & data file exchange), and; (4) FOURns protocol (i.e. data file verification & notarisation).

🔗 FOURdx Smart Contract on Moonbase TestNet: Link (opens new window)

# Staging Storage

Very similar to production, Staging storage different itself only in on-chain storage, where it saves the needed protocol data on TestNets instead of on MainNets. 4 databases are forming in the 4thTech Staging system;

  1. MySQL database is used to store; (1) user nicknames; (2) platform settings; (3) user wallets, and; (4) RSA public key for data encryption. Data exchange within the MySQL database is protected with an HTTPS connection and a firewall. In the case of a user request, it is possible to delete any user-related data to comply with GDPR;
  2. data file cloud repository is used for the temporary 7-days storage of encrypted data files that are exchanged between wallets in the dMail process. The decryption of the data files is possible only with a private key of the user. 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;
  3. local storage is used to store; (1) FOURwaL private keys; (2) dChat short messages, and; (3) user-initiated backup of conversations, data files and reports. The security of local storage is in the user's domain;
  4. blockchain (i.e. Kovan, SI-Chain, Edgeware TestNet, Solana TestNet & Moonbase TestNet) is used to store; (1) a link to the encrypted metadata file and timestamp (i.e. dMail); (2) encrypted message, timestamp and sender address (i.e. dChat). The overall security of the blockchain network depends on its decentralization, while access security depends on the user's private key safety measures.

# FOURid Protocol

Problem Statement

Unlike Web2 where our identities are disclosed and locked by the intermediaries, the decentralised Web3 on-chain identities (i.e. dID) need no third party, are portable and completely anonymous until and if the users decide to tie them to the off-chain identity. Web3 identities are born with the creation of a wallet account that represents the user’s decentralised identifier. Users can interact with permissionless Web3 on-chain systems using the same wallet account without revealing their physical identifiers like phone numbers or email addresses. Wallet KPI core infrastructure enables anonymous identity as a default. The FOURid protocol connects wallets when data is exchanged. It serves as the public key exchange point between users. The data sender needs a public key of the receiver. At the same time, the FOURid provides wallet address verification of an individual or an organisation by creating a link between an X.509 user’s online identity and blockchain wallet address.

FOURid

The protocol connects wallets when data is exchanged. It serves as the public key exchange point between users. The data sender needs a public key of the receiver. At the same time, the FOURid provides wallet address verification of an individual or an organisation by creating a link between an X.509 user’s online identity and blockchain wallet address.

4thTech’s Digital Identity Protocol connects entities, organizations, and individuals in a decentralized internet. It connects wallets when data is exchanged and serves as the public key exchange point between users (i.e. sender needs a public key of the receiver). With its native design, the FOURid identified data and its owner while enabling true Web3 dID. It can be used also to assign digital cryptography-based identity certificates, such as X.509 to different entities such as individuals or organizations. To clarify further, the FOURid provides wallet address verification of an individual or an organisation by creating a link between an X.509 user’s online identity and blockchain wallet address.

Note

💡 The FOURid framework is compatible with all the Ethereum based addresses, additionally it supports Polkadot Substrates & Solana.

FOURid enables a self-sovereign framework of data (i.e. data files and metadata) authorisation and ownership representation. All ID processes are fully automated and decentralized by their design, thereby enabling users to full control and ownership of any data that may be connected with them. Attached with a specific blockchain wallet address the data can now be verified, while the X.509 digital certificate standard provides the off-chain connection with individuals and organizations.

# Protocol capabilities

With the capability of:

  • wallet connection during the data exchange process;
  • serving as the public key exchange point between users;
  • connecting the X.509 standard digital certificate, the FOURid ensures the integrity and traceability in a decentralised ecosystem.

# FOURid advantages

  • blockchain used as a trust mechanism;
  • multi-chain deployment;
  • compatibility with all the Ethereum, Polkadot and Solana based addresses;
  • private and public-chain integration;
  • X.509 digital certificate standard integration;
  • possibility of custom identity certificate integration.

# The X.509 digital certificate standard

X.509 standard digital certificate can be used for data encryption, notarization of signed data, digital signature, digital identity verification and timestamp. With various European Union certificate publications, the X.509 standard is widely used and as such appropriate for blockchain digital identity integration. The X.509 Public Key Infrastructure is also approved by eIDAS (i.e. electronic IDentification, Authentication and Trust Services).

Note

💡 As X.509 digital certificate standard is widely supported across Europe, the solution can be easily adapted to all counties using the same certificate standard. Small differences in the installation and verification process may vary.

# X.509 connection process can be divided into four sections

  • the user selects the X.509 standard qualified digital certificate, associated with individual or organisation;
  • simple KYC form is completed with certificate holder name, last name and tax number;
  • FOURid mechanism prepares and sends WSDL request in a SOAP envelope via HTTP POST protocol to the government managed automated service (i.e. the issuer of the X.509 certificate), which replies with the verification. If the user's tax number corresponds with the qualified digital certificate serial number, the user is successfully verified;
  • A link is created by the FOURid between the user's X.509 digital certificate and its 4thTech wallet address.

# FOURdx Protocol

Problem / Solution

Securing your digital communications should be your highest priority when going online. There are just way too many threats to trust any company with your private data. Blockchain always offered the promise of enabling private, immutable W2W communication, while retaining data and identity ownership, it is by design the perfect privacy tool. Privacy by design was our guiding approach when building 4thTech. That simply means that we put the consideration of 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 4thTech.

We are building multi-chain dMail framework that is Ethereum, Polkadot and Solana interoperable and enables Web3 data exchange that is private, secure, censorship-resistant, and immutable. Our tech enables W2W communication where users are able to share files, and media, through the wallet, in the form of dMail attachments.

FOURdx

FOURdx open-source protocol leverages trust sourced from the blockchain and enables E2EE, immutable wallet-to-wallet dMail. The dMail (i.e. decentralized email) framework is built on public or DLT blockchains, enabling organizations and individuals to collaborate and exchange data in a secure and decentralised manner. The protocol records only links to encrypted JSON metadata files and checksum of the encrypted JSON metadata file on the blockchain, which safeguards the rights of individuals to confidentiality and privacy, while complying with GDPR.

FOURdx

4thTech’s dMail can also be defined as a decentralized network framework that supports text, data file or media exchange between wallet addresses of supported blockchains (i.e. Ethereum, Tolar, Edgeware, Solana and Moonbeam). Supported by a modern intuitive UI-platform and thanks to multi-chain support, 4thTech dMail is accessible and affordable to all users.

Note

💡 The FOURdx protocol is compatible with all the Ethereum based networks, additionally it supports Polkadot Substrates & Solana.

# GDPR Compliant Application

As a result of extensive three years of legal and procedural GDPR research, the 4thTech dMail can be recognised as a GDPR compliant application as no personal data is stored on-chain but resides off-chain. The protocol records links to encrypted files and hashes of the encrypted content on the blockchain.

# dMail Advantages

  • Wallet onboarding, no email or phone number required
  • End-to-end AES encryption
  • Spoofing resistant with no ads, no tracking or data mining
  • Ethereum, Polkadot & Solana interoperable
  • Data file source authenticity & data dNotary integrity feature
  • Digital data & documents audibility
  • Digital data & documents delivery timestamp feature
  • Local, cloud or decentralised storage e-archiving options
  • 4thTech GUI, SDK & white-labelling
  • MetaMask support (i.e. coming)

# Architecture & dMail Process

  1. A JSON metadata file is created that includes dMail sender subject, content, attachment name, attachment URL, calculated hash (i.e., checksum) of data file content and Client B address.
  2. In the form of JSON metadata file, dMail sent from Client Wallet A gets encrypted with a public key of the receiver Client B.
  3. JSON metadata file URL & checksum are sent to Ethereum, Tolar, Edgeware or Solana FOURdx Smart Contract.
  4. Received Client B dMail is decrypted with Client B private key.
  5. Attachments in the form of media & data files from Client A are encrypted with the public key of Client B.
  6. Encrypted attachments files are sent to either 4thTech temporary GDPR compliant cloud storage or permanent decentralized storage (i.e. in development)
  7. Received Client B attachments files are decrypted with Client B's private key.

# Media & Data Attachments

Attachment media & data are stored in the 7-day temporary repository (i.e. currently limited to 20 MB file size). The dMail recipient is provided with the "link" of the saved location JSON metadata file. The JSON metadata file that includes the link is sent to the blockchain, and the dMail recipient can download the data file and decrypt it with his private key saved in the browser's 4thTech wallet (FOURwaL).

Note

💡 The current data exchange file size is limited to 20MB. All exchanged files are deleted after 7 days so please do not forget to download the files upon exchange.

FOURdx

# dMail Data Exchange Process - simplified

  • the digital data are stored in the repository (currently limited to 20 MB file size);
  • the user is provided with the "link" of the saved location;
  • the link of the JSON metadata file that includes transaction details and its checksum is stored on the blockchain;
  • the recipient can download the data file and decrypt it with his private key saved in the browser's 4thTech wallet (FOURwaL).

# dMail Data Exchange Process - Advanced

A so-called envelope is created, which is an object that contains additional data needed for dMail that we want to send. This envelope object is later on converted to JSON string encrypted with receiver RSA public key and saved as a file. This file is in our documentation called JSON metadata file.

# dMail JSON metadata package

JSON metadata file structure includes:

  • dMail sender title;
  • dMail subject;
  • dMail content;
  • link to the encrypted data file;
  • calculated hash (i.e., checksum) of data file content.

Note

💡 In the examples below we use some of our libraries which we have prepared to simplify our job in our projects. Here we won't go into details about those libraries, but we will just explain what the used methods do.

  1. Prepare an envelope

At this step, we prepare the envelope object.

const envelope: Envelope = await prepareEnvelope();

Retrieve the public key

First, we need a receiver RSA public key which is used for encrypting data. Those data can later decrypt only the receiver with his private key.

// Retrieve a receiver RSA public key
const recipientPublicKey = await storageService.retrievePublicKey(
    formData.recipient.account.address,
);

Prepare attachments

Note

💡 For all attachments, we calculate the SHA-256 checksum. Then we encrypt all the attachments with the receiver RSA public key. And at the end, we upload those attachments to a file storage.

Our post-service library takes care of all the necessary steps and for every attachment return name, URL, and checksum.

return {
    document: {
        // ...
        attachments: await postService.prepareAttachments(
            formData.document.attachments,
            recipientPublicKey,
        ),
    },
    // ...
};

1.1. Checksum calculation

crypto.createHash('sha256').update(data).digest('hex')

1.2. File encryption

// Symmetric encrypt
const symKey = crypto.randomBytes(32);
const iv = crypto.randomBytes(16);
const cipher = crypto.createCipheriv('aes-256-cbc', symKey, iv);

const symEncrypted = Buffer.concat([cipher.update(fileData), cipher.final()]).toString(
    'base64',
);

// Asymmetric encrypt - encrypt just symmetric key & iv
const key = new NodeRSA();
key.importKey(publicKey, 'pkcs8-public');

const symPrefix = `${symKey.toString('base64')}:${iv.toString('base64')}`;
const encrypted = key.encrypt(symPrefix, 'base64');

// Join asymmetric and symmetric part
const data = Buffer.from(`${encrypted}:${symEncrypted}`);

1.3. File upload

await new StorageService().uploadFile(encryptedFile.file)

Envelope example

Below is an example of an envelope converted to JSON string.

{
  "document":{
    "subject":"Test subject",
    "content":"Test content...",
    "attachments":[
      {
        "name":"Screenshot 2021-01-25 at 23.48.41.png",
        "url":"https://www.the4thpillar.com/storage/documents/9237dc3008f1f9be6ca76656eedbcbb26070100b32e21.png",
        "checksum":"026ce0abf35fc9c28b98eaa4639680920bbd2ac550045b3810171f18ce14a43f"
      },
      {
        "name":"Screenshot 2020-02-18 at 17.22.17.png",
        "url":"https://www.the4thpillar.com/storage/documents/803c46f0e579d3726d08dbade4c70ca36070100b5ff8b.png",
        "checksum":"e970c5da38c8a8a747ca14f8efc74d0c5b22fa07a185d75a4f9e9871900bfab0"
      }
    ]
  },
  "recipient":{
    "account":{
      "address":"5FPEZd1bUNLVpLAzTc2Sx3i3bvbxVDzezu18sDsLHDVSMqWd"
    },
    "name":""
  },
  "sender":{
    "account":{
      "address":"5GUBxVyG1dKEuPw3VVD2tRADptViYsxi2TRD6V5cA3cnj4pa",
      "type":"DOT"
    },
    "name":"John Doe"
  }
}
  1. Upload envelope

At this step, we upload the envelope to file storage as a JSON metadata file.

// Upload envelope
const envelopePath = await postService.uploadEnvelope(envelope, recipientPublicKey);

Our post-service library takes care of all the necessary steps:

  • convert envelope object to a JSON string
  • encrypt it
  • upload to a file storage
  • return envelope path which contains checksum and URL of a JSON metadata file
// EnvelopePath type
export type EnvelopePath = {
    checksum: string;
    url: string;
};
  1. Save to blockchain

At this step, we store JSON metadata file URL and checksum to blockchain.

Our blockchain-service library takes care of all the necessary steps:

  • detect target chain
  • delegate job to a target chain service which executes all the necessary steps to store data on chain
  • return transaction details which contain transaction hash and explorer URL where we can see transaction details
// Save data to blockcahin
const txDetails: TransactionDetails = await blockchainService.sendDocument(
    envelope.sender.account,
    envelope.recipient.account.address,
    envelopePath,
);

# Solana Technical - Advanced

All data on the Solana blockchain is saved in the PDA accounts. PDA accounts are owned by the FOURdx program (smart contract). FOURdx uses two different types of accounts:

  1. dMail receiver account holds media & data files counter data
  2. dMail media & data files account holds sender, data - JSON metadata URL + checksum, timestamp

Initialization of data file exchange between two wallets consists of::

  • creating a receiver account;
  • creating a data file account.

# The FOURdx smart contracts in production

Platform Contract address Link
Ethereum 0x82cebDEabB79FdFaB70649834ddD85f42b6B9464 Link (opens new window)
Ethereum Kovan 0xa334fe6279Fb2BaEC093bB083426cadA1017d4E4 Link (opens new window)
SI-Chain (HashNet testnet) 5452790f993b65608c4bb85a318193f8ebb77a753f601280f8 Link (opens new window)
Edgeware jM7MuqQNvUdg67hjf8g3WqB2VYEfWpojUsBpdsVT9uPBePU Link (opens new window)
Solana DevNet 9fdByGW3FymQEwWYHuA9ZXdEQPsiLa3DwpjgF8pCyhWc Link (opens new window)
Solana MainNet 9fdByGW3FymQEwWYHuA9ZXdEQPsiLa3DwpjgF8pCyhWc Link (opens new window)
Moonbase TestNet 0xAF18f8330e712169ad4A596A3468F4C0Bd0D1A5C Link (opens new window)

# Intelectual Licence & Code

The FOURdx software program is accessible in the following repository: github (opens new window). Except specific files and/or parts of the files which bear a different mention, this software program is licensed under the EUPL-1.2 or latter. You can obtain a copy of the license (opens new window)

# FOURns Protocol

Explainer

Notarisation can be described as a fraud prevention process that enables data file (e.g. document) authenticity and guarantees that the data file has not been changed in the course of a transaction between parties. Usually, the physical notary acts as an intermediary and provides the needed trust factor between parties. 4thTech dNotary can be also described as a digital notary of the decentralized world and with its main solution enables sensitive data files time-stamp and origin verification using blockchain as a "trust" source.

FOURns

As a by-product of FOURdx Protocol, the FOURns can leverage the power of blockchain to facilitate source and time confirmation for any data files exchanged within the 4thTech ecosystem.

FOURns

FOURns uses checksum to check for potential data changes during the FOURdx data exchange. If one byte of the exchanged data changes, the checksum changes and invalidates the transmission. There are several checksums calculated and stored to assure integrity. Checksum stored on the blockchain is validating JSON metadata which includes all the details of the transaction. If the checksum of the JSON metadata is validated then the service is also checking the integrity of the digital file(s) within the transaction. If the validation of the digital file(s) is confirmed then the receiver can download data files with the confidence that no one has manipulated them.

Checksum validation = calculating checksum of stored JSON metadata file and digital file(s) and comparing the result with saved values

# Service capability

  • storing and timestamping digital data files;
  • providing the file checksum verification of the JSON metadata file (checksum is stored on blockchain);
  • providing the file checksum verification of the all data files listed in JSON metadata file (checksum of each file is available in JSON meta file);
  • providing access and review of the received data file details.

Note

💡 A checksum is to prevent accidental changes. If one byte changes, the checksum changes.

# Advantages

  • immutable and permissionless blockchain used as a "trust" network;
  • bypasses the intermediary, a third person in the data file (i.e. document) notarisation process;
  • multi-chain support enables multiple interoperability options;
  • private and public blockchain support;
  • digital data files and documents audibility;
  • advanced encryption standard (i.e. AES), with a combination of RSA encryption algorithms;
  • notarisation with data file source authenticity and integrity feature;
  • delivery timestamp feature;
  • local or decentralised cloud e-archiving options (i.e. planned to be developed).

# Data Verification Process - Simplified

  • user account creation within the FOURwaL;
  • user account verification using 4thTech dID within the UI-platform (option)
  • on-chain checksum and timestamp verification of the received data file, using 4thTech dNotary within the 4thTech UI-platform.

# FOURim Protocol

Problem / Solution

Securing your digital communications should be your highest priority when going online. There are just way too many threats to trust any company with your private data. Blockchain always offered the promise of enabling private, immutable W2W communication, while retaining data and identity ownership, it is by design the perfect privacy tool. Privacy by design was our guiding approach when building 4thTech. That simply means that we put the consideration of 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 4thTech.

We are building multi-chain dChat framework that is Ethereum, Polkadot and Solana interoperable and enables on-chain messaging that is private, secure, censorship-resistant, and immutable. Our tech enables both W2W communication as well as E2EE group chat with an additional component of curated community chat groups. Users are also able to share files, and media, through the wallet, in the form of dChat attachments.

FOURim

The FOURim Protocol currently leverages the Solana blockchain to serve as an immutable ledger exchanging E2EE on-chain messages from FOURwaL wallet SOL address A to FOURwaL wallet SOL address B. To enable Ethereum interoperability, the EVM smart contracts are in development.

UI

The FOURim protocol connects to the Solana blockchain node using JSON-RPC protocol. Solana serves as an immutable Layer 1 blockchain ledger exchanging short encrypted messages from FOURwaL SOL wallet address A to FOURwaL SOL wallet address B. The 4thTech dID connects both the wallet of the message sender and the wallet of the message receiver and serves as the public key exchange point between both users (sender needs a public key of the receiver). To achieve the security of decentralization, the messages are not stored on a company centralised servers but are temporarily stored on the Solana blockchain itself and deleted after 7-days. Solana programs (i.e. smart contracts) are used to facilitate two unique requirements:

  • saving dChat instant messages from the sender;
  • retrieving dChat instant messages from receivers.

# dChat Features

  • Onboarding with no email or phone number required
  • End-to-end AES encryption
  • 100% on-chain
  • Group chat & curated group chats (i.e. coming)
  • Token and NFT message transactions
  • Sending media & data files
  • NFT Profiles & Emojis
  • No tracking, no data mining, no ads
  • 4thTech GUI, SDK & white-labelling
  • MetaMask support (i.e. coming)

# User Control

With FOURim Protocol, the dChat users gain control over their messages, the messages are end-to-end encrypted and stored on the blockchain. Messages are not stored on a company server! Every message is signed with the receiver’s public key. Your wallet address serves as your on-chain identity. When the 4thTech UI-platform reaches full decentralization, it will not matter if the project is here or not, all control will be in the user’s hands. There are no ads, no tracking or data mining and never will be!

# E2EE (i.e. end-to-end encryption)

FOURim dChat Protocol utilises RSA encryption to secure immutable blockchain message exchange. The dChat messages are end-to-end encrypted with the asymmetric algorithm (i.e., RSA), which is used to encrypt the message with the public key of the receiver. This design does not allow an attacker to infer relationships between segments of the encrypted message. To speed up the message loading process, caching was enabled to prevent repeatedly loading all data from a blockchain that was already retrieved in the past.

Encryption of instant messages example:

// Retrieve a receiver RSA public key
const recipientPublicKey = await storageService.retrievePublicKey(
	formData.recipient.account.address,
);

// Asymmetric encrypt - encrypt message
const key = new NodeRSA();
key.importKey(publicKey, 'pkcs8-public');

const encryptedMessage = key.encrypt(message, 'base64');

// Save data to blockcahin
const txDetails: TransactionDetails = await blockchainService.sendInstantMessage(
	sender.account,
	recipient.account.address,
	encryptedMessage,
);

# Pre-transaction dChat message snapshot

Due to a short send message delay on behalf of the encryption and network transaction execution, a pre-transaction message snapshot is created, that displays the send a message in light colour before the colour changes to darker which represents the final on-chain message execution. All data on the Solana blockchain is saved in the PDA accounts. PDA accounts are owned by the FOURim program (smart contract).

# Architecture & dChat Process

  1. dChat message from Client A gets encrypted with public key
  2. dChat message is send to Solana FOURim Protocol Program
  3. dChat message is temporary stored on-chain (i.e. 7-days)
  4. dChat message of Client B is decrypted with private key
  5. Media & data files from Client A are encrypted with public key
  6. Encrypted media & data files are send to decentralized storage (i.e. in development)
  7. Media & data files of Client B are decrypted with private key

FOURim technical diagram

# FOURim Protocol - Solana Technical

All data on the Solana blockchain is saved in the PDA accounts. PDA accounts are owned by the FOURim Protocol program (i.e. smart contract). FOURim Protocol uses five different types of accounts:

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

Initialization of conversation between two wallets consists of:

  • creating a user account for sender and receiver;
  • creating a conversation account;
  • creating two user conversation accounts, one for the sender and the second for the receiver;
  • creating a message account;
  • creating 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.

🔗 FOURim Protocol Program: link (opens new window)

7-day Note

💡 Messages are temporary stored on-chain for 7-days, after 7-days the messages are deleted. Please backup your conversations regularly if neaded.

# Main components

  • 4thTech Chromium and Firefox add-on wallet (i.e. FOURwaL) with added Solana blockchain support;
  • 4thTech dID (i.e. FOURid) which serves as a public key exchange point between both users;
  • 4thTech UI-platform;
  • FOUR token, a multi-blockchain asset that enables the user with the right to stake and access, while providing services fee discounts and activating additional feature inside the 4thTech UI-platform.

# The FOURim smart contracts in production

Platform Contract address Link
Solana DevNet Hk5f9Xw9PdaQ9GEg8TPVFusojLA9otDpUkziXw1hAVE5 Link (opens new window)
Solana MainNet Hk5f9Xw9PdaQ9GEg8TPVFusojLA9otDpUkziXw1hAVE5 Link (opens new window)

# Solana Speed & Pricing

According to Solana, the average transaction confirmation is 0.89s, with up to 50.000 TPS capacity and an average transaction (i.e., TX) price of 0.00025$ (21.12.2021). After significant testing on DevNet (opens new window) and MainNet (opens new window), we have come to the conclusion that the send or receive message speed depends on the message length, encryption (decryption) and transaction finality as it varies between 1 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. Hopefully, the execution time will improve with further network developments and protocol tweaks. Further testing will be done to produce more accurate results. Currently, only Solana TX cost is being charged in $SOL with a possibility of a small protocol service fee to be added in the future.

Overall there are currently three cost variants to be considered in the messaging process:

  1. Initialization of a conversation between two wallets usually takes more time to be established as five accounts need to be created (we are adding a progress window in future updates). Testing produced the following TX cost: 0,006845503 SOL “Hi 😄”

  2. When the conversation is established between two wallets, sending and receiving messages takes less time averaging between 1 and 5 seconds. Testing sending a short message produced the following TX cost: 0,000039503 SOL “ooo 😃”

  3. The TX cost depends on message length. Testing sending a longer message produced the following TX cost: 0,00006219 SOL “Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry’s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.”

Note

💡 Results were measured on 21.12.2021 with SOL price at 190$.

# The FOURim license & code

The FOURim software program is accessible in the following repository: github (opens new window) Except specific files which bear a different mention, this software program is licensed under the EUPL-1.2 or latter. You can obtain a copy of the license (opens new window)

# Enterprise Access Point

Further development will be focused on the deployment of an Enterprise Access Point, which is a key to connectivity between existing enterprise systems and 4thTech blockchain solutions. To connect to existing enterprise server backend systems, a high-end blockchain-enabled Access Point (i.e. AP) is needed. Govern by an Application Program Interface (i.e. API), the Access Point will serve as a connection point between existing enterprise IT infrastructure (i.e. ERP) and blockchain network. 4thTech AP will be designed according to enterprise needs, in the same role, it will act as an enterprise blockchain gateway and wallet, a connecting point and a bridge between both worlds.

# AP key features and functionality

  • blockchain data file exchange as AP key function;
  • serves as blockchain enterprise wallet;
  • generates and saves RSA key pairs (i.e. public and private keys), that decrypts received data files and metadata;
  • holds encrypted private keys;
  • compatible with Ethereum, HashNet, Polkadot and Solana public and private chains;
  • enables various data repository options;
  • enables blockchain digital identity verification over 4thTech web services;
  • enables hardware modules as an option provide additional cybersecurity.

# Access Point Processes

So how will the AP send the data?

  1. data file is sent from an organisation backend system (i.e. ERP);
  2. ERP send a request via API to the Access Point;
  3. Access Point accesses the Public Key Infrastructure (i.e. PKI) to obtain RSA public keys of the recipient;
  4. Access Point calculates data file checksum;
  5. Access Point encrypts the send data file with the RSA public key;
  6. Access Point saves the encrypted data file in the storage repository (storage repository is defined by the organisation);
  7. Access Point uses the blockchain wallet private key to sign the transaction, which is relayed to the blockchain. The send data file checksum, time-stamp and link are saved to the blockchain.

How will the AP manage the data receiving?

  1. Access Point monitor all-new blockchain blocks for newly received data files;
  2. upon arrival Access Point decrypts the received data files;
  3. Access Point validates the received data using the file checksum (notarisation process);
  4. API request.

# Services FEEs

With the FOUR STAKING deployment, 4thTech will start to charge services fee margin in cryptographic tokens to execute data exchange from wallet to wallet. The total public-chain service fee is based on:

  • chosen public blockchain network TX (i.e. transaction) cost;
  • added 4thTech service fee margin.
  1. In the case of dChat, public-blockchain network TX cost is based on two TX. The first TX saves the link to the metadata file and checksum of the metadata file to the SC as the second TX sends the transaction fee in the native token (i.e. ETH, EDG, TOL, SOL) to the solution fee taker address.

  2. 4thTech services fee margins are added and are defined in FIAT but converted in ETH, EGD, TOL or SOL based on the market exchange rate;

  3. The overall dMail or dChat TX GAS_PRICE FEE depends on the public-blockchain network selected.

  4. # FEE Calculation Overview if using FOUR Staking

First SC TX + Second TX = Total public-blockchain network TX_GAS cost

Public-blockchain SC TX_GAS cost + 4thTech service FEE_MARGIN surcharge - the FOUR staking enabled discounts = Total user dMail/dChat_TX fee cost

# Explainers

FEE_MARGIN: the TX surcharge added for 4thTech dMail or dChat service

FEE_ADDITION_FACTOR: DISCOUNT factor added if FOUR_STAKING is enabled

# FOUR STAKING DISCOUNT tiers

Tiers

Tier 1: 14 days FOUR STAKING: 10.000 FOUR = 10% DISCOUNT on 4thTech services FEE_MARGIN surcharge

Tier 2: 30 days FOUR STAKING: 20.000 FOUR = 15% DISCOUNT on 4thTech services FEE_MARGIN surcharge

Tier 3: 180 days FOUR STAKING: 50.000 FOUR = 50% DISCOUNT on 4thTech services FEE_MARGIN surcharge + FULL dMail & dChat FEATURE ACTIVATION

# FOUR Staking Use-case

Let’s assume that:

public blockchain TX COST = 0.03$

dChat services FEE_MARGIN = 5$

TOTAL USER COST = 5,03$

FOUR_STAKING DISCOUNT = 50% (if FOUR is STAKED at the highest tier)

TOTAL USER COST USING FOUR_STAKING = 2,53$ (settled in native the token of the chosen supported public blockchain)

# FOUR Staking Process

FOUR_STAKING will be enabled within the platform in the coming TS update. After choosing the STAKING tier, the wallet FOUR balance must be sufficient. With a single click, the funds are staked at a STAKING_SC address. As FOUR is an ERC-20, BEP-20 & POS token,the user can choose which standard to use. After the SC_TX execution, the funds are staked at the STAKING_SC address and the dMail & dChat FEE_MARGIN DISCOUNTs are enabled immediately. After the staking period, the FOUR staked funds can be claimed back. After the FOUR funds are claimed back the 4thTech TX FEE_DISCOUNTs becomes unavailable.

Advantages:

  • user-friendly: Intuitive, user-friendly platform design guides you through the staking process with a single click;
  • your wallet, your control: FOURwaL is developed according to the latest security standards. Wallet private keys are encrypted with your chosen password. You and you alone are in total control of the wallets assets;
  • with staking to 50% discounts: FOUR_STAKING will enable users to receive up to 50% DISCOUNT on 4thTech services FEE_MARGIN while settling with native blockchain tokens (i.e. ETH, EDG…) of their public-blockchain choice. (i.e. Ethereum, Substrate…).