A small utility server to exchange data and messages between clients. Comes complete with E2E public key encryption

Overview

Logo

Zenotta Intercom

Pipeline Status

A small utility server to exchange arbitrary data between clients. Comes complete with E2E public key encryption

Official documentation »

Table of Contents
  1. About The Project
  2. Getting Started
  3. How it Works

About The Project

This utility server aims to ease the exchange of arbitrary data between clients. For Zenotta's blockchain, you can use this intercom server in order to facilitate receipt-based transactions between parties.

..

Getting Started

📚 Prerequisites

In order to run this server as a community provider, or simply to use it yourself, you'll need to have Docker installed (minimum tested v20.10.12) and be comfortable working with the command line.

If you'd like to develop on this repo, you'll have the following additional requirements:

  • NodeJs (tested at v14.16.0)
  • Yarn (tested at v1.22.10)

..

(back to top)

..

🔧 Installation

With Docker installed and running, you can clone this repo and get everything installed with the following:

# SSH clone
git clone [email protected]:zenotta/zenotta-intercom.git

# Navigate to the repo
cd zenotta-intercom

# Install dependencies
npm install

# Bundle server
npm run build

# Build Docker image
docker build -t intercom .

(back to top)

..

🏎️ Running

To use the server as is, you can simply run the following in the root folder of the repo:

docker-compose up -d

or, if you are able to run bash scripts:

cd zenotta-intercom

sh exec_docker.sh

Docker will orchestrate both the server itself and the Redis instance, after which you can make calls to your server at port 3002. Data saved to the Redis instance is kept within a Docker volume.

To run the server in a development environment, run the following command:

npm install

npm run dev

or with Yarn:

yarn install

yarn run dev

(back to top)

..

How it Works

Nomenclature: "Alice" and "Bob" represent unique public key addresses.

Data Exchange

The server functions on a very basic set of rules. Clients exchange data between each other through the use of public key addresses. If Alice wants to exchange data with Bob, she would place a Redis field value containing the data being exchanged under a Redis key value representing Bob's public key address. The next time Bob fetches data from the server using his public key address, he would find that Alice has exchanged data to him.

An Example
{
    "c9f97...2d872": {
        "timestamp": 1647525607766,
        "value": {
            "DRUID0x5d382e4ab": {
                "senderAsset": "Token",
                "senderAmount": 10,
                "senderAddress": "bd696...0e80c",
                "receiverAsset": "Receipt",
                "receiverAmount": 1,
                "receiverAddress": "c9f97...2d872",
                "fromAddr": "bd696...0e80c",
                "status": "pending"
            }
        }
    }
}

In this example, data for a receipt-based payment was exchanged to Bob (bd696...0e80c) from Alice (c9f97...2d872).

Bob would retrieve all data exchanged to him through proving that he owns the address bd696...0e80c by cryptographically signing for it. This address represents a key value on the Redis server.

Retrieval of all field values corresponding to the key (Bob's address), shows that we obtain an object structure with a parent object key value representing the address (Alice) from which the data is being exchanged. This object also contains a timestamp value to indicate when the data was exchanged.

When Bob responds by exchanging data back to Alice, the data that Alice has initially exchanged to Bob will be removed from the Redis server for sanitation purposes.

Available Routes

  • set_data: Sets data in the Redis instance and marks it for pending retrieval in the server
  • get_data: Gets pending data from the server

Security

This server supports basic authentication through the use of cryptographic signatures and also features an IP-based rate-limiting mechanism. Other minor features include request body structure verification, compression middleware, and a request body size limitation.

Memory Management

Since this server relies on Redis as an in-memory database, it is imperative that Redis entries are discarded when no longer deemed valuable.

The server aims to achieve this through the following:

  1. Redis keys are set to expire after a certain amount of time.
  2. Relevant Redis keys are checked for their expiration each time a request is processed on the server.
  3. Data exchange is unidirectional in nature: When Alice exchanges data with Bob, the data Alice has exchanged to Bob will be removed from Bob's Redis **key** entry once Bob responds by exchanging data back to Alice's corresponding address.
  4. Data exchange does not allow queuing: Only one set of data may be exchanged from Alice to Bob (or vice versa) at a time. If Alice should exchange different sets of data to Bob in quick succession, only the latest set data will be stored for Bob to retrieve.
You might also like...

A chat logs online saver for discord bots to save messages history & cleared messages online

A chat logs online saver for discord bots to save messages history & cleared messages online

Chat Logs NPM package that saves messages online to view it later Useful for bots where users can save messages history & cleared messages online Supp

Dec 28, 2022

Utility to show key-presses on your browser

Utility to show key-presses on your browser

Show-Keys Extension A Chrome Extension wrapper around @siddharthkp's script to show Key Press on a website. PS - A lot of websites block this function

Jul 9, 2022

A demo for E2E build piplelines in Design Systems using monorepo's and automation :zap:.

A demo for E2E build piplelines in Design Systems using monorepo's and automation :zap:.

Design System Pipelines demo What is it? A working demonstration for end-to-end build piplelines in Design Systems using Primer Primitives, Primer CSS

Oct 20, 2022

A testing focused Remix Stack, that integrates E2E & Unit testing with Playwright, Vitest, MSW and Testing Library. Driven by Prisma ORM. Deploys to Fly.io

A testing focused Remix Stack, that integrates E2E & Unit testing with Playwright, Vitest, MSW and Testing Library. Driven by Prisma ORM. Deploys to Fly.io

Live Demo · Twitter A testing focused Remix Stack, that integrates E2E & Unit testing with Playwright, Vitest, MSW and Testing Library. Driven by Pris

Oct 31, 2022

Next.js website for E2E

Prérequis git (obviously) node = 14 avec npm Sur MacOS ou Linux, je suggère fortement d'utiliser Node.js Version Manager afin de simplifier l'install

Feb 15, 2022

Metamask replacement for your E2E tests.

Headless Web3 Provider Metamask replacement for your E2E tests. Why "headless"? Because it doesn't have a visual interface, reject (or accept) transac

Dec 13, 2022

A web watermark SDK, support: custom watermark content and style, watermark encryption and decryption, watermark anomaly monitoring, etc.

A web watermark SDK, support: custom watermark content and style, watermark encryption and decryption, watermark anomaly monitoring, etc.

English | 简体中文 1. What is l-watermark? l-watermark is a web watermark SDK based on TS, which contains: Can cover more than scene watermarking method A

Dec 10, 2022

A Hackable Markdown Note Application for Programmers. Version control, AI completion, mind map, documents encryption, code snippet running, integrated terminal, chart embedding, HTML applets, plug-in, and macro replacement.

A Hackable Markdown Note Application for Programmers. Version control, AI completion, mind map, documents encryption, code snippet running, integrated terminal, chart embedding, HTML applets, plug-in, and macro replacement.

Yank Note A hackable markdown note application for programmers Download | Try it Online Not ecommended English | 中文说明 [toc]{level: [2]} Highlights

Dec 31, 2022

A fully cross-platform messenger app with End to End Encryption (E2EE).

A fully cross-platform messenger app with End to End Encryption (E2EE).

Smartsapp A fully cross-platform messenger app with End to End Encryption (E2EE). Demo NOTE: The features shown in the demo is not exhaustive. Only th

Aug 25, 2022
Releases(v0.0.9)
  • v0.0.9(Sep 21, 2022)

    First major release, including:

    • E2E Encryption for communication
    • Sharing on a public key infrastructure
    • P2P communication possible
    • Dockerfile as well as docker-compose for easy set up
    Source code(tar.gz)
    Source code(zip)
Owner
Zenotta AG
Zenotta AG
A TypeScript library for OPAQUE Asymmetric Password-Authenticated Key Exchange Protocol

opaque-ts This is a Typescript library for the Asymmetric Password-Authenticated Key Exchange (OPAQUE) protocol. Use Available at: @cloudflare/opaque-

Cloudflare 51 Dec 30, 2022
Next-gen mobile first analytics server (think Mixpanel, Google Analytics) with built-in encryption supporting HTTP2 and gRPC. Node.js, headless, API-only, horizontally scaleable.

Introduction to Awacs Next-gen behavior analysis server (think Mixpanel, Google Analytics) with built-in encryption supporting HTTP2 and gRPC. Node.js

Socketkit 52 Dec 19, 2022
A small javascript DOM manipulation library based on Jquery's syntax. Acts as a small utility library with the most common functions.

Quantdom JS Quantdom is a very small (about 600 bytes when ran through terser & gzipped) dom danipulation library that uuses a Jquery like syntax and

Sean McQuaid 7 Aug 16, 2022
✏️ A small jQuery extension to turn a static HTML table into an editable one. For quickly populating a small table with JSON data, letting the user modify it with validation, and then getting JSON data back out.

jquery-editable-table A small jQuery extension to turn an HTML table editable for fast data entry and validation Demo ?? https://jsfiddle.net/torrobin

Tor 7 Jul 31, 2022
A file-sharing app providing end-to-end encryption of data.

secsend secsend is a file-sharing app providing end-to-end encryption of data. It provides a web application and a command-line interface (CLI). demo.

Adrien Guinet 28 Dec 22, 2022
To keep online organized data and be able to add listeners in certain paths by socket.io and http clients

The purpose of this project is to create a state machine server to keep organized data and be able to add listeners with socket.io in specific paths and in addition to providing a possible form of messages between socket.io clients.

Manga 3 Mar 19, 2022
A frida script that can be used to find the public RSA key used in the native libakamaibmp.so shared library, seen in version 3.3.0 of Akamai BMP

Akamai BMP - RSA/AES Frida Hook This Frida script can be used to find the public RSA key used in the encryption process in Akamai BMP 3.3.0. Since ver

yog 31 Jan 8, 2023
Trustless BTC-ETH exchange.

# Silver Portal ⚠️ This is an experimental prototype for testnet use only. The basic idea Silver Portal lets you swap ether and bitcoin, trustlessly.

DC 24 Sep 2, 2022
A MITM cache between RPCs and a a dAPP. Useful to allow for better performance on a public RPC node

better-cosmos-rpcs A cheaper way to allow for public RPCs as a service WITHOUT scaling issues. No need to rate limit either. How it is done: User GET

Reece Williams 3 Nov 19, 2022