Coder Social home page Coder Social logo

chrove_protocol's Introduction

Chrove_protocol

To anonymously order an internet proxy without creditcard, paypal, alipay, some code is written. User just need to pay cryptocurrency, and proxy provider can deliver service to user even user never register account. It works. Not only proxy, many service can benefit from cryptocurrency. User never need to leave personal information. Service provider remove creditcard fraud.

process

setup

  • Vendor setup server and insert server URL into smart contract
  • User install client

query

  • User open client to read smart contract, found some URL
  • Client visit /price.json of all URLs and list them all to user
  • User select one of service
  • Client show service introduction, price, and payment method of service

pay and visit

  • User pay cryptocurrency to payment address, writing client's ID into payment memo. Same as bitcoin, client's ID is double hash256 of client's public RSA key.
  • Server found purhase record from blockchain, insert purchase record into local storage.
  • Client generate request before visit server. Request contains action, it's public key, and double hash256 of client's public key. Sign it and encrypt it using server's public key.
  • Client send request to server
  • Server decrypt request by it's private key, verify signature by client's public key, accept request, query purchase record with hash of key, found service informaton. Then server sign the service information, and encrypt the information with client's public key

Chrove service market

As vendor, you may feel hard to let people know your service, you can pay some popular smart contract holders to list your service.

A smart contract holder can list and add service in his smart contract. The smart contract become a market.

The first smart contract is on EOS blockchain, the address is deadbeefduck.

Design principle

Chrove is based on open and verified technologys: HTTP, JSON, JWT, JWK, JWE, and RSA. Chrove don’t force vendor run SSL because it is easy to anonymously run a server, but it is tricky to register a domain and apply a SSL certification even there’s awesome Let’s Encrypt.

Chrove encrypt information by peer’s public key on plain text HTTP protocol. It is strong enough now.

User client suppport Chrove:

Chrove proxy client in Google chrome browser extension

Server client support

Chrove proxy server

protocol

Chrove server need to provide a web service and provide two api.

GET /price.json

Client visit the api without parameter

This api tell client the service content and price, and how to pay.

The response content is in json format.

the process to generate the content

payload_to_client = {'ContractAddress':'deadbeefduck', 'Price':{"symbol": "EOS", "amount": "1","unit":"per Day"}, 
'PublicKey':JWK_of_server_public, 'PublicKeyEnc':JWK_of_server_public_enc, "ts":timestamp_in_seconds, 
"brandinfo":{"Logo":"http://www.bbb.zzz/logo.pn",
"title":"flying ghost","description":"a very quickly proxy"}
}

Signed timestamp with server's public key.(This could be weakness of whole system)

signed_by_server = JWS(timestamp_in_seconds_in_string, private_key_server)

Put them together and send to http client

result_to_client = { 
                                "content": payload_to_client,
                                "ts_signature": signed_by_server}
                        }

GET /cert.info

Client need to prepare http request with a parameter called code, value should be A compact JWE string.

  1. calculate kid
kid_of_client_public_key = base58_encoding(SHA256(SHA256(public_key_client["n"]))

An example of kid_of_client_public_key can be 'HareBAjopJi7GabM5HEX1VWsTHEmu8cFfAQFfSpbMsvT'

  1. generate client signature
my_signature = JWS(string(current_time_stamp_in_seconds), private_key_client)
  1. content to server before encrypt
clear_payload_to_server = {"key":JWK(public_key_client), "signature": my_signature, "request":"my_subscribe"}
  1. encrypt content with server's public key
encrypted_payload_server = JWE(clear_payload_to_server, public_key_server)

parameter to http url should be http:xxx.yy/cert.info?code=encrypted_payload_server

Server will decrypt the request by it's private key, then verify the signature. Then server will hash the RSA public key and use the result as key to match purchase record, because client will pay server and write hash in memo. If server find matching redord, server will use the api to tell customer the service information.

 ss_cert_list = [{"type": "ss", "server_name":"hello", "config":{"address": "1.1.1.1", "port": 1984, "method": "aes-cfb-256", "key": "romanholidy3947"}},
{"type": "socks5", "server_name":"world", "config":{"address": "2.2.1.1", "port": 11984, "username": "tomhanks", "password": "pass23hljhsdf"}},
{"type": "https", "server_name":"fish", "config":{"address": "3.3.3.3", "port": 14455, "username": "tomcruse", "password": "pass5767lskljdf"}}
]

generate signature

signed_payload = JWS(ts_server, server_private_key)

Encrypt result to client

response_of_server_signed = {'service_type':'proxy', 'service_content':{"server_list": ss_cert_list}, "ts": ts_server, "signature_str_ts": signed_payload})
response_http = JWE(response_of_server_signed, public_key_client)

chrove_protocol's People

Contributors

0xbluemoon avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.