• Stars
    star
    159
  • Rank 235,916 (Top 5 %)
  • Language
    JavaScript
  • License
    GNU General Publi...
  • Created over 2 years ago
  • Updated 9 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

New Internet

Hyper Service Transfer Protocol on Networks

HSTP - Hyper Service Transfer Protocol on Computer Networks

The protocol aims to develop a application layer abstraction for the Hyper Service Transfer Protocol.

HSTP is a recursion as nature of HSTP. This protocol implements itself as a interface. On every internet connected device, there is a HSTP instance. That's why the adoption is not needed. HSTP already running top of the internet. We have just now achieved to explain the protocol over protocols on heterogeneous networks. That's why do not compare with web2, web3 or vice versa.

Abstract

HSTP is a application representation interface for heterogeneous networks.

HSTP interface enforces to implement a set of methods to be able to communicate with other nodes in the network. Thus serves, clients, and other nodes can communicate with each other with trust based, end to end encrypted way. By the time the node resolution is based on fastest path resolution algorithm I wrote.

Protocol 4 Babies 🍼 <- 👀 <- 👶:

Story time!

  • Baby crying! 👶
  • Needs milk! 🍼
  • Mommy has a problem.
  • Father has a problem.
  • Let's fix this!

A small overview

Think about, we're in the situation of one mother and one father lives a happy life. They had a baby! Suddenly, the mother needed to drink pills regularly to cure a disase. The pill is a poison for the baby. The baby is crying and the mother calls father because he is the only trusted person to help the baby. But the father sometime can not stay at home, he needs to do something to feed the baby. Father heard one milkman has fresh and high quality milks for low price. Father decides to try to talk the milkman, milkman deliver the milk to the father, father carry the milk to the mother. Mother give the milk to the baby. Baby is happy now and the baby sleeps, mother see the baby is happy.

The family never buy the milk from outside, this is the first time they buy milk for the baby: (Mom do not know the number of milkman, milkman do not know the home address)

As steps:

0)  - Baby wants to drink milk.
1)  - Baby cries to the mom.
3)  - Mom see the baby is crying.
4)     - Mom checks the fridge. Mom sees the milk is empty. (Mother is only trusting the Father)
5)        - Mom calls the father.
6)        - Father calls the milkman.
7)        - Milkman delivers the milk to father.
8)        - Father delivers the milk to mom.
9)  - Mom gives the milk to the baby.
10) - Baby drinks the milk.
11) - Baby is happy.
12) - Baby sleeps.
13) - Mother see the baby is happy and sleeps.
14) - In order to be able to contact the milkman again, the mother asks the father to tell her that she wants the milkman to save the address of the house and the mobile phone of the mother.
15)     - Mother calls the father.
16)     - Father calls the milkman.
17)     - Milkman saves the address of the house and the mobile phone of the mother.

Oops, tomorrow baby wakes up and cries again,
0) - Baby wants to drink milk.
1) - Baby cries to the mom.
2) - Mom see the baby is crying.
3)    - Mom checks the fridge. Mom sees the milk is empty. (Mother is trusting the Father had right decision in the first place by giving the address to the milkman, and the milkman had right decision in the first place by saving the address of the house and the mobile phone of the mother.)
4)    - Mother calls the milkman (Mother is trusting the Father's decision only)
5)    - Milkman delivers the milk to mom.
6) - Mom gives the milk to the baby.
7) - Baby drinks the milk.
8) - Baby is happy.
9) - Baby sleeps.
10) - Mother see the baby is happy and sleeps.
11) - Mother is happy and the mother trust the milkman now.

this document you're reading is a manifest for the internet people to connecting the other people by trusting the service serve the client and the trust only can be maintainable by providing good services. trust is the key, but not enough for survive. the service has to be reliable, consistent, cheap. unless the people will decide to not ask from you again.

So, it's easy right? It's so simple to understand, who are those people in the story?

  • Baby is a client.
  • Mom is a client.
  • Father is a client.
  • Milkman is a server.

also,

  • Baby could be a server in [TIME].
  • Mom is a server for baby.
  • Father is a server for mom.
  • Milkman is a server for father.
  • Milkman is a server for mom.

Baby is in trusted hands. Nothing to worry about. They love you, you will understand when you grow up and have a child.

// Technical step explanation soon, but not that hard as you see.

What is a HSTP?

HSTP is a interface, which is a set of methods that must be implemented by the application layer. The interface is used to communicate with other nodes in the network. The interface is designed to be used in a heterogeneous network.

What is a HSTP node?

HSTP shall be implemented on any layer of network connected devices/environment.

HSTP node could be a TCP server, HTTP server, static file or contract in any chain. One HSTP node is able to call any other HSTP node. Thus the nodes can call each other freely, they can check their system status, and they can communicate with each other.

What kind of abstraction layer for networks?

HSTP is already implemented on language level, by people for people. English is mostly adopted language around the Earth. JavaScript could be known also mostly adopted language for browser environments. Solidity is for EVM-based chains, hyperbees for TCP based networks, etc.

HSTP interface shall be applied between any HSTP connected devices/networks.

  • [Universe] talks to [Universe] via [HSTP]
    • [Kind] universe talks over world.
      • [World] Earth talks with sound frequencies and HSTP.
        • [Country] X sound frequencies on Xish and HSTP.
          • [Community] CommunityX Xish on CommunityXish.
        • [Country] Y talks Yish and HSTP.
        • [Country] Z talks Zish and HSTP.
      • [World] Mars talks with radio frequencies.
        • [Bacteria] UUU-1 talks UUU-1ish and HSTP.
          • Info: UUU-1 can call, universe/kind/world/Earth/X/CommunityX/query
      • [World] Jupiter talks with light frequencies and do not implements HSTP.
        • Info: If the Earth wants to talk with Jupiter, we can add one HSTP to Jupiter proxy on universe.
    • [Kind] universe talks over atoms and HSTP.
      • [Atoms] ... and HSTP.
        • ... and HSTP.
          • [Y] ... and HSTP.
            • Info: [Y] can talk with universe/kind/world/Mars/Bacteria/UUU-1/query
      • [Atoms] ... and HSTP.
        • ... and HSTP.
          • [Y] ... and HSTP.
            • Info: [Y] can talk with universe/kind/world/Mars/Bacteria/UUU-1/query Info: Kind universe can talk with Mars, and Mars also can talk with Kind universe.

What is the purpose of HSTP?

Infinitive scaling options: Any TCP connected device can talk with any other TCP connected device over HSTP. That means any web browser is serve of another HSTP node, and any web browser can call any other web browser.

Uniform application representation interface: HSTP is a uniform interface, which is a set of methods that must be implemented by the application layer.

Heterogeneous networks: Any participant of network is allowing to share the resources with other participants of the network. The resources can be CPU, memory, storage, network, etc.

Conjucation of web versions Since the blockchain technologies calling as web3, people started discussing about the differanciates between the web's. Comparing is a behaviour for incremental numeric system education's mindset. Which one is better: none of them. We have to build systems could talk in one uniform protocol, underneath services could be anything. HSTP is aiming for that.

What are the components of HSTP?

Registry interface Registry interface designed for using on TCP layer, to be able to register top level tld nodes in the network. The first implementation of HSTP TCP relay will resolve hstp/

The registry has two parts of the interface:

  • Register method, which is used to register a new node in the network.
  • Resolve method, which is used to resolve a node in the network.

Registry implementation needs two HSTP node,

  1. Hyperbees
  • Heterogen networks will resolve the registry of RPC, TCP, HTTP, HSTP etc.
  1. Registry.sol on any EVM based chain. (Ethereum, Binance Smart Chain, Polygon, etc.)
  • Registry.sol will resolve the registry of HSTP nodes. That can be relayed over another networks.

Router interface

For demonstration purposes, we will use the following solidity example:

// SPDX-License-Identifier: GNU-3.0-or-later
pragma solidity ^0.8.0;

import "./HSTP.sol";
import "./ERC165.sol";

enum Operation {
    Query,
    Mutation
}

struct Response {
    uint256 status;
    string body;
}

struct Registry {
    HSTP resolver;
}

// HSTP/Router.sol
abstract contract Router is ERC165 {
    event Log(address indexed sender, Operation operation, bytes payload);
    event Register(address indexed sender, Registry registry);
    mapping(string => Registry) public routes;

    function reply(string memory name, Operation _operation, bytes memory payload) public virtual payable returns(Response memory response) {
        emit Log(msg.sender, _operation, payload);
        // Traverse upwards and downwards of the tree.
        // Tries to find the closest path for given operation.
        // If the route is registered on HSTP node, reply from children node.
        // If the node do not have the route on this node, ask for parent.
        if (routes[name]) {
            if (_operation == Operation.Query) {
                return this.query(payload);
            } else if (_operation == Operation.Mutation) {
                return this.mutation(payload);
            }
        }
        return super.reply(name, _operation, payload);
    }

    function query(string memory name, bytes memory payload) public view returns (Response memory) {
        return routes[name].resolver.query(payload);
    }

    function mutation(string memory name, bytes memory payload) public payable returns (Response memory) {
        return routes[name].resolver.mutation(payload);
    }

    function register(string memory name, HSTP node) public {
        Registry memory registry = Registry({
            resolver: node
        });
        emit Register(msg.sender, registry);
        routes[name] = registry;
    }

    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(HSTP).interfaceId;
    }
}

HSTP interface

// SPDX-License-Identifier: GNU-3.0-or-later
pragma solidity ^0.8.0;

import "./Router.sol";

// Stateless Hyper Service Transfer Protocol for on-chain services.
// Will implement: EIP-4337 when it's on final stage.
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-4337.md
abstract contract HSTP is Router {
    constructor(string memory name) {
        register(name, this);
    }

    function query(bytes memory payload)
        public
        view
        virtual
        returns (Response memory);

    function mutation(bytes memory payload)
        public
        payable
        virtual
        returns (Response memory);
}

Example HSTP Node

HSTP node has access to call parent router by super.reply(name, operation, payload) method. HSTP node can also call children nodes by calling this.query(payload) or this.mutation(payload) methods.

A HSTP node can be a smart contract, or a web browser, or a TCP connected device.

Node has full capability of adding more HSTP nodes to the network or itself as sub services.

      HSTP  HSTP
    /    \   /  \
  HSTP   HSTP  HSTP
        /    \
      HSTP  HSTP
    /       /
    HSTP   HSTP
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;

import "hstp/HSTP.sol";

// Stateless Hyper Service Transfer Protocol for on-chain services.
contract Todo is HSTP("Todo") {

    struct ITodo {
        string todo;
    }
    
    function addTodo(ITodo memory request) public payable returns(Response memory response) {
        response.body = request.todo;
        return response;
    }

    // Override for HSTP.
    function query(bytes memory payload)
        public
        view
        virtual
        override
        returns (Response memory) {}

    function mutation(bytes memory payload)
        public
        payable
        virtual
        override
        returns (Response memory) {
            (ITodo memory request) = abi.decode(payload, (ITodo));
            return this.addTodo(request);
        }
}

Proposal

Ethereum proposal is draft now, but the protocol has referance implementation Todo.sol.

Awesome web services running top of HSTP

Full list here

Hello world

You can test the HSTP and try on remix now.

How to play with the protocol?

  • Copy the source code below to the https://remix.ethereum.org/
  • Deploy on any EVM based chain.
  • Call the functions and try different network topologies on HSTP.
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;

import "hstp/HSTP.sol";

// Stateless Hyper Service Transfer Protocol for on-chain services.
contract Todo is HSTP("Todo") {

    struct TodoRequest {
        string todo;
    }
    
    function addTodo(TodoRequest memory request) public payable returns(Response memory response) {
        response.body = request.todo;
        return response;
    }

    // Override for HSTP.
    function query(bytes memory payload)
        public
        view
        virtual
        override
        returns (Response memory) {}

    function mutation(bytes memory payload)
        public
        payable
        virtual
        override
        returns (Response memory) {
            (TodoRequest memory todoRequest) = abi.decode(payload, (TodoRequest));
            return this.addTodo(todoRequest);
        }
}

Contribute:

Developer level contribution

  • Write a todo application with HSTP, deploy with remix and test it.
  • Draw example architecture of HSTP (serviceless architecture).

Core level contribution

  • Implement TCP layer HSTP interface on hyperbees, [Universe]
    • hyperbees and HSTP will be the first implementation of HSTP.
    • That will covers the universe phrase of networks. That will bring us full decentralized web on HSTP.
  • Implement RPC layer HSTP interface on Solidity [Web3]
  • Implement complex serviceless architecture on HSTP interface with Solidity [Web3]
  • Implement HTTP layer HSTP interface on JavaScript [Web]

Inspirations:

License

GNU GENERAL PUBLIC LICENSE V3

Core Contributors

Sponsors

Author

Cagatay Cali

More Repositories

1

xss-listener

🕷️ XSS Listener is a penetration tool for easy to steal data with various XSS.
JavaScript
437
star
2

url-shortener

Shitty url shortener, emoji powered. 🌍✌🏼
JavaScript
161
star
3

lazy

Lazy, AI chatbot service.
JavaScript
150
star
4

awesome-brainfuck

🦄 Brainfuck is an esoteric programming language 🦄
Brainfuck
99
star
5

micro-fun

Micro frontends as Fun with Next.js & module federation
JavaScript
61
star
6

tick.chat

Chat via nearby persons. Instant, Secure, Anonymously. 🕶
JavaScript
60
star
7

university-news-notifier

📚 University news notifier
JavaScript
56
star
8

location-service

Location service ⚡ 
JavaScript
24
star
9

flex-protocol

[onchain] Decentralized payment links, enabled by smart contracts.
Solidity
17
star
10

nightmare-examples

Cool nightmarejs browser automation examples.
15
star
11

cagatay.dev

JavaScript ile Programlamaya Giriş Kitabı
14
star
12

pau-anket-doldur

:trollface: Pamukkale Üniversitesi Değerlendirme Anketi Otomatik Doldurma
HTML
13
star
13

veri-yapilari

Pamukkale Üniversitesi Veri Yapıları Ders Notları
12
star
14

l00g.in

l00g.in, ssh management cli tool.
JavaScript
11
star
15

micro-fun-example

Microfrontend fun example project
JavaScript
10
star
16

Record

NodeJS record website with recordrtc and socket.io
JavaScript
8
star
17

tiny

🌊
7
star
18

mind-controlled-x

Your new mind controlled X projects start point.
JavaScript
6
star
19

iPau

Pamukkale Üniversitesi Bakiye Sorgulama
JavaScript
6
star
20

location-client

Location service client ☁️
JavaScript
6
star
21

doc-to-pdf

Small cute document to pdf converter. Depends LibreOffice
JavaScript
6
star
22

case

Shopping cart implementation, OOP, TDD
HTML
6
star
23

fix-the-web

Make the web great again 👍
JavaScript
5
star
24

react-tutorial

Learn react step by step
JavaScript
5
star
25

nuxt-firebase-functions-ssr-example

[ WIP ] This repository shows us how to use firebase functions for nuxt.js server side rendering.
Vue
5
star
26

boss-stalker

This repo shows us, which language star's lot by my boss.
JavaScript
5
star
27

lazy-telegram

Have your own open-source ai chatbot powered lazy.ai.
JavaScript
5
star
28

openevent

5
star
29

pdf-to-gif

💼 This repository for generate GIF from PDF files 🎞
JavaScript
4
star
30

Tweety

CLI twitter search tool
JavaScript
4
star
31

vending

Money vending machine, tensorflow js
JavaScript
4
star
32

veri-iletisimi-bilgisayar-aglari-odev

Veri iletişimi ve bilgisayar ağları ödevi
JavaScript
4
star
33

cryptology-homework

For cryptology homework, code quality is mess, please don't judge me.
JavaScript
4
star
34

open-hackathon

Hackathon of Hackatons
4
star
35

tello-drone-controller

Ryze Tello Drone Controller API - Made for Tiny AI
JavaScript
4
star
36

dropbox-restricted-passwords-list

Dropbox Restricted Passwords List
3
star
37

did-you-mean

Google translate estimation algorithm as a service
JavaScript
3
star
38

aws-sms-send-demo

Aws sms sender without es6 - babel
JavaScript
3
star
39

font-level-encryption

Python
3
star
40

pau-ders-bot

Pamukkale Üniversitesi Ders Botu
JavaScript
3
star
41

parse-tampermonkey-script

Parse tampermonkey scripts
JavaScript
3
star
42

slogans.tick.chat

Cool tick.chat slogans in your app!
JavaScript
3
star
43

multithread-perfect-number-calculator

Java
3
star
44

lazy-express

Have your own open-source ai chatbot powered lazy.ai.
JavaScript
3
star
45

fastify-one-click-deploy

This repository shows us, how to deploy fastify in seconds.
JavaScript
3
star
46

SymfonyTurkceKitap

Symfony Türkçe Kitap
3
star
47

is-allowed

JavaScript
3
star
48

RelaxEyes

These codes is perfect way to relieve my eyes when I am at the computer.
JavaScript
3
star
49

lineer-cebir

Pamukkale Üniversitesi Lineer Cebir Ders Notları
MATLAB
3
star
50

OyuncakAraba

NESNEYE YÖNELİK PROGRAMLAMA ÖDEV #2
C#
3
star
51

live

Yazılım geliştirmeyi, geliştiriciliği, araştırmayı ve öğrenmeyi beraber öğreniyoruz.
C
3
star
52

collaborative-filtering

JavaScript
3
star
53

dersim.webapp

JavaScript
3
star
54

d3pl0y

Deploy your nodejs project easily.
JavaScript
3
star
55

whats-the-user-doing.js

What you can do easily with a smartphones gyro sensors
JavaScript
3
star
56

kemal-heroku-example

Kemal is super simple web framework powered Crystal lang. These repo show's how to use with heroku.
Crystal
3
star
57

aws-ssr-app2

JavaScript
2
star
58

HackingFestApk

2
star
59

alfred-ssh

Use ssh like a pro!
JavaScript
2
star
60

SahibindenParser

simple sahibinden.com parser with nodejs
JavaScript
2
star
61

phone-number-fixer

phone number fixer, suggester
JavaScript
2
star
62

0n

0n, checks your awesome sites, when one of them going down 0n'll notify you.
JavaScript
2
star
63

micro-fun-rick-and-morty

JavaScript
2
star
64

Volumes-CLI

Control your ubuntu sound in terminal
JavaScript
2
star
65

simple-image-convolution-fft

Simple image blur by convolution with a Gaussian kernel
Jupyter Notebook
2
star
66

sayisal-cozumleme

Pamukkale üniversitesi sayısal çözümleme ders notları
2
star
67

medium-rss-parser

Medium rss and metadata parser
JavaScript
2
star
68

my-javascript-framework

HTML
2
star
69

getir-hackathon

2018 Semih Öztürk - Getir Hackathon Backend Task
JavaScript
2
star
70

webservice-quiz

JavaScript
1
star
71

video-downloader

Video downloader
JavaScript
1
star
72

hstp-docs

1
star
73

oshw

Java
1
star
74

serverless-aws-sms-send

JavaScript
1
star
75

CENG101-Project

homework
C
1
star
76

Symfony-Excel-Import

basic excel import
PHP
1
star
77

TagBasedChat

JavaScript
1
star
78

WivetArge

Wivet - Web Application's Crawler Benchmark
PHP
1
star
79

f.ck

JavaScript
1
star
80

md5-cli-tool

Md5 Encoder, Decoder self hosted in cli
JavaScript
1
star
81

cagataycaliapp

1
star
82

cagataycali

Software Engineer @trendyol
1
star
83

m4g1c

Like a fairy dust ha?
JavaScript
1
star
84

sorting-algorithms

This repository for educational purpose. Sorting algorithms implemented in c#.
C#
1
star
85

BlobProject

Symfony2 ile yazılmış basit instagram örneği
JavaScript
1
star
86

protocol-for-babies

The universe interface runs top on any network
1
star
87

check-my-site-bot

Checks your site every 1 minute, tells you if something goes wrong. When your sites gone on, bot will notify you.
JavaScript
1
star
88

Symfony2-EkleSilGuncelle

symfony2 ile ekle sil güncelle işlemleri
PHP
1
star
89

apple-price-rounder

Apple pricing rules are strict but we can code!
JavaScript
1
star
90

Youli

Youtube cli
JavaScript
1
star
91

firebase-nuxt-ssr

Vue
1
star
92

md5-server

Md5 Encoder, Decoder
CSS
1
star
93

gifi

JavaScript
1
star
94

QuickScanTwitterAccounts

This snippet allow quick scan twitter accounts
JavaScript
1
star
95

HackType

Type like as hacker dude
JavaScript
1
star
96

kata-boilerplate

Just plain JS codewars kata template
JavaScript
1
star
97

Symfony

SymfonyExercises
PHP
1
star
98

awesome-web3-services

1
star
99

NodeJS

just 4 fun
JavaScript
1
star
100

HesapMakinesi

NESNEYE YÖNELİK PROGRAMLAMA ÖDEV #1
C#
1
star