httpe protocol

lee preimesberger edited this page May 27, 2015 · 3 revisions

the Census Protocol Foundation

A blockchain distributed application for transferring digital goods

Definition for Elliptical Encryption over HTTP (httpe://)

Sangita Prajapati Document Revision 0.01

Introduction

The Census Protocol uses a peer to peer protocol which ensures encrypted and signed communications between nodes on the network. Each active mining node on the network is required to have a unique wallet address and public/private key, which is partially required to prevent malformed and malicious transactions from spamming the network (this was an attack used on the Bitcoin network in 2013 which slowed transactions to a crawl) through the ability to blacklist a malicious or badly performing node. The node directory is a public listing that is replicated to all miners as part of the transaction list.

This connection method requires at the least that each block of data sent be signed with the public key of the sender, and that optionally each block of data also be encrypted with the public key of the receiver using Elliptic Curve encryption (curve_secp256k1).

Connection Handshake

There is no need for a handshake, as the nodes already know the keys of each other. The public key of each node and its address (generated through a one-way hash) is stored locally in the working set of the server and is available in the blockchain. A node may be queried for this information by using the /api/v1/wallet/:id GET REST call as well.

Shrouding

Data is sent as usual, but each packet is shrouded in an additional level of packaging. The original packet, as defined in the White Paper and inside the JSON validators, is MIME encoded (this prevents resorting of the data and expensing data processing before signatures can be checked) regardless of whether is is encrypted or not.

The original data is added to a data entry inside the JSON. Additional fields are signature, encryption (the method used, or ‘none’), and the source.

Take for example this packet:

{ "_id" : ObjectId("554e9967453b6def44f3e5e6"), "owner" : "", "loc" : [ 29.7448219999999992, -95.3850790000000046 ], "resale_allowed" : true, "item_type" : "item", "txid" : "200a4d64-07bf-44fa-a115-cb6a1e50eb1a", "source" : "1Goo8Lf1sVEa12npNziCncVGDEoDuw1yEL", "version" : 1, "tips" : 10, "retail" : 2000, "block_in" : "c831c804-0757-4d48-b446-4428fdbfa142", "tokens" : 2000, "max_markup" : 2500, "data" : "Murderhole!11! Album Release Party", "maps_url" : "https://www.google.com/maps/place/Numbers+Night+Club/@29.7446961,-95.3847438,21z/data=!4m2!3m1!1s0x8640bf66680c70c3:0x1d20e8cca35c60b3", "target" : "1Goo8Lf1sVEa12npNziCncVGDEoDuw1yEL", "created" : 1431214438771.0000000000000000, "venue" : "Numbers Night Club, 300 Westheimer Road", "for_sale" : false, "__v" : 0, "expiration" : 1431574438771.0000000000000000, "signature" : "G99lkf+kTMuWDUFjJUIL3zL5kEHjpBeC+0D3ty1M2hvIEgyX3iDZeoc369FOJ9dVvXP+JQ8LnHM43uQ65FiHdxk=" }

When sent over httpe - this might appear as:

{ “source”:”1Goo8Lf1sVEa12npNziCncVGDEoDuw1yEL”, “encryption”:”none”, "signature" : "G2uE73RZEF85/6SRkMHVTAcQ2SXYaQ3h0d5yMEtMowKhhDDmJOD7AygSUr1dTyKXTFmZqypdq+c/GNX6poQLJV8=" data:”ewogICAgIl9pZCIgOiBPYmplY3RJZCgiNTU0ZTk5Njc0NTNiNmRlZjQ0ZjNlNWU2IiksCiAgICAi b3duZXIiIDogIiIsCiAgICAibG9jIiA6IFsgCiAgICAgICAgMjkuNzQ0ODIxOTk5OTk5OTk5Miwg CiAgICAgICAgLTk1LjM4NTA3OTAwMDAwMDAwNDYKICAgIF0sCiAgICAicmVzYWxlX2FsbG93ZWQi IDogdHJ1ZSwKICAgICJpdGVtX3R5cGUiIDogIml0ZW0iLAogICAgInR4aWQiIDogIjIwMGE0ZDY0 LTA3YmYtNDRmYS1hMTE1LWNiNmExZTUwZWIxYSIsCiAgICAic291cmNlIiA6ICIxR29vOExmMXNW RWExMm5wTnppQ25jVkdERW9EdXcxeUVMIiwKICAgICJ2ZXJzaW9uIiA6IDEsCiAgICAidGlwcyIg OiAxMCwKICAgICJyZXRhaWwiIDogMjAwMCwKICAgICJibG9ja19pbiIgOiAiYzgzMWM4MDQtMDc1 Ny00ZDQ4LWI0NDYtNDQyOGZkYmZhMTQyIiwKICAgICJ0b2tlbnMiIDogMjAwMCwKICAgICJtYXhf bWFya3VwIiA6IDI1MDAsCiAgICAiZGF0YSIgOiAiTXVyZGVyaG9sZSExMSEgIEFsYnVtIFJlbGVh c2UgUGFydHkiLAogICAgIm1hcHNfdXJsIiA6ICJodHRwczovL3d3dy5nb29nbGUuY29tL21hcHMv cGxhY2UvTnVtYmVycytOaWdodCtDbHViL0AyOS43NDQ2OTYxLC05NS4zODQ3NDM4LDIxei9kYXRh PSE0bTIhM20xITFzMHg4NjQwYmY2NjY4MGM3MGMzOjB4MWQyMGU4Y2NhMzVjNjBiMyIsCiAgICAi dGFyZ2V0IiA6ICIxR29vOExmMXNWRWExMm5wTnppQ25jVkdERW9EdXcxeUVMIiwKICAgICJjcmVh dGVkIiA6IDE0MzEyMTQ0Mzg3NzEuMDAwMDAwMDAwMDAwMDAwMCwKICAgICJ2ZW51ZSIgOiAiTnVt YmVycyBOaWdodCBDbHViLCAzMDAgV2VzdGhlaW1lciBSb2FkIiwKICAgICJmb3Jfc2FsZSIgOiBm YWxzZSwKICAgICJfX3YiIDogMCwKICAgICJleHBpcmF0aW9uIiA6IDE0MzE1NzQ0Mzg3NzEuMDAw MDAwMDAwMDAwMDAwMCwKICAgICJzaWduYXR1cmUiIDogIkc5OWxrZitrVE11V0RVRmpKVUlMM3pM NWtFSGpwQmVDKzBEM3R5MU0yaHZJRWd5WDNpRFplb2MzNjlGT0o5ZFZ2WFArSlE4TG5ITTQzdVE2 NUZpSGR4az0iCgoKfQo=” }

Uses

This is used exclusively today in the peer to peer communication where blocks are sent from node to node through the /api/v1/item/feed/:id and the /api/v1/block/feed/:id - but this be used for any peer to peer communication.

  • Secure web browsing
  • ad-hoc peer to peer networking and VPNs
  • Secure web or phone wallets
Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.