A Cursory Overview of How Vaporchains Work

In this blog we briefly cover how Vaporchains are created and how they are mined. I am sharing my thoughts on how this protocol currently works to receive feedback and answer some questions y’all might have. This protocol is still in its infancy stage so anything stated here could change with time.

What is Vaporchain?

#Vaporchain is a protocol that runs on Steem where anyone can create, transfer and trade tokens all in a decentralized and trustless manner.

How Do I Create a Vaporchain?

Vaporchains are created by sending a command to @null via a transfer memo.

Example:

!vapor vapor vaporchain-test 0 28483711 20 5000 42053336 50 8 0

Memo ArgumentDefinition
!vaporRequired for detecting Vaporchain commands
vaporVaporchain name
vaporchain-testCreator of the Vaporchain (Sender of Memo)
0Current Vapor Block (Genesis)
28483711Future Steem Block when Vaporchain Activates
20Vaporchain Block Size (Steem blocks per Vapor Block)
5000Miner Reward
42053336Miner Reward Change Every X Blocks
50Miner Deflation %
8Math Precision (Important for calculating numbers)
0Pre-mine Amount for Creator

If the command is valid, arguments 2-11 are then sha256 together, as well as some reference information, and a Consensus is reached.

Example of reference information:
Ref = block_idx_opx_txid (of the Genesis Transfer)
Ref = 28483249_1_0_7dde15d719b9792b2cdd6969137676fde5b09510

Genesis Consensus is Reached As So:

sha256(“vapor,vaporchain-test,0,28483711,20,5000,42053336,50,8,0,ref”)
Answer: fb9111699d58562ffd519a9b091a16352ad61af9afdfe6b504164dee47206dae

What Is A Vapor Block?

Vapor Blocks store all transactions corresponding to token creation and transfers to that particular Vaporchain. A Vapor Block requires a certain number of Steem Blocks (aka Block Size) to be valid. The Vaporchain above, for example, will require 20 Steem blocks before the first Vapor Block can be created. Once the Vaporblock completes, bids can be sent to NULL to try and “mine” it. As so,

!vapor vapor vaporchain-test 1 0087a8d9c6cdb5519ef9370107fed771d89f35486f962970718e10d6c8d82832

Memo ArgumentDefinition
!vaporRequired for detecting Vaporchain commands
vaporVaporchain name
vaporchain-testCreator of the Vaporchain
1Head Block Number
0087a8d9c...block_id of Head Block

Mining Rewards

The highest bidder when the Vapor block is concluding will be the winner and earn mining rewards. Bids sent too late will be ignored.

How Consensus Is Reached For Each Vapor Block

Each Vapor Block must sha256 the following 3 things to find its block_id:

  1. Previous block_id
  2. All Steem Block_IDs (SID) that occurred during Vapor Block
  3. All Vapor Transactions (VTX) that occurred during Vapor Block

If Vapor transactions are null
block_id = sha256(“previous sid1,sid2,sid3...”)

If Vapor transactions are not null
block_id = sha256(“previous sid1,sid2,sid3... vtx1 vtx2 vtx3”)

Below are 3 Vapor Blocks formatted in JSON. The first two have 0 Vapor transactions while the third includes a mining reward to the highest bidder.


Vapor Block 1:{
"previous": "fb9111699d58562ffd519a9b091a16352ad61af9afdfe6b504164dee47206dae",
"sids": [
"01b2a07f219659269dc77b474550844bd8c5f5e6",
"01b2a080df850b093b40effa9d2f764bc92b54e8",
"01b2a081c35877b0c5c738418181145792920c13",
"01b2a0822db18eb1c78c0e049d426379f44c5e69",
"01b2a08305c54eb19b708a17b4373e9640715f16",
"01b2a0849cf8babcbb2fc676bd744a8d4633f692",
"01b2a085bbee90c928b9def87b3acef1c9db940d",
"01b2a086ad761a319a060fc71e7f22644808bd33",
"01b2a08779635a4d2a3595d8729eba932f98c2ac",
"01b2a08811a660f4f21bc50c4365ad93bad30026",
"01b2a089f604b306129ff068df79d98ac749257d",
"01b2a08a0932dd9111d0635fea09cf1bb01a1e41",
"01b2a08b1e1d2ef46a85ca66846d7dd0bba1c76a",
"01b2a08cd629c7b784e62891515818eed7577caa",
"01b2a08dd81b7a6275842a31ebc55415a32ddb19",
"01b2a08e2aa61a1a3346d5d540081d8fc1e80250",
"01b2a08f892b5c61e5706fbfdbcde66c1edb8f73",
"01b2a090a2d8f6eea01f55a6c5eb837eaf30c7e7",
"01b2a0916f27f7019bf61495a01ca2c26a36d121",
"01b2a092b87d9a7037bc27eb7a52dc096328858e"
],
"vtxs": [],
"block_id": "0087a8d9c6cdb5519ef9370107fed771d89f35486f962970718e10d6c8d82832"
}

------
NO BIDS SENT
------


Vapor Block 2:{
"previous": "0087a8d9c6cdb5519ef9370107fed771d89f35486f962970718e10d6c8d82832",
"sids": [
"01b2a0938aceac6699c58c363e3046ffb5b53d25",
"01b2a0944fd3d106d159c7dcb3fddef990c5071c",
"01b2a0957e9a9be62663b5edace54c094cacf846",
"01b2a0967356936a97a3cadb23d50a0c26d32036",
"01b2a09716cfc467dce16a96254410c28fa62b33",
"01b2a098856740dc00d2a63a8f11865716cf1915",
"01b2a09917d4366dc40803dff0c9c4a456e91c9e",
"01b2a09a48843e70e46932a693a34719d891a9b6",
"01b2a09b0714b7879214696e71e0bbee9447b545",
"01b2a09cbeb4ec4bc2c389fbfb8af482fb3b87a0",
"01b2a09d000911c8998648335496467c0ceefa29",
"01b2a09e0f4e5d0828bd14241d7723ebcaf4d535",
"01b2a09f7615cbc73dbd4d9af39e66f1a8afee08",
"01b2a0a0a9b477f7c9c8f96b287ba7f0cfff84f8",
"01b2a0a17d28ae5a3919f62b2b53785820857abd",
"01b2a0a255e226e78879525075b9143b280286e3",
"01b2a0a3a44cec177dfffa1d5946d0648bc0435f",
"01b2a0a4c44506c1529135064597754119dfdce0",
"01b2a0a52b9cfbfc98497d79c9a2fbb41b300eb8",
"01b2a0a626e0af2e25fdcdc248a648bb6f0d89fb"
],
"vtxs": [],
"block_id": "a3a31f032bd1607b3c8434d14d0b2396eb0d0c4b52f3a54d3c6af8e34bda8184"
}

------
BID SENT
------

!vapor vapor vaporchain-test 2 a3a31f032bd1607b3c8434d14d0b2396eb0d0c4b52f3a54d3c6af8e34bda8184


Vapor Block 3:{
"previous": "a3a31f032bd1607b3c8434d14d0b2396eb0d0c4b52f3a54d3c6af8e34bda8184",
"sids": [
"01b2a0a7615a7fc7d6d6eaf7f0d5a4dbb69c713d",
"01b2a0a835ae2cc8a9407219198835f6bde88d63",
"01b2a0a903ca626891d43a9f2afa3a765a1544e1",
"01b2a0aa9ccc43047d07b9f449950dafad973a04",
"01b2a0ab5de417b4824938b314f5f259dbea422b",
"01b2a0acd381753bd93661d149d2c73e44b1e403",
"01b2a0ad5a4a9208f92c8b6634e4340d42619807",
"01b2a0ae27d6dcf07961baa468b3e4c5d571b973",
"01b2a0aff84d0ca7d8b71caf81fcb8293bafdef5",
"01b2a0b0bb6eda88fd7f5a003cf0f43317557060",
"01b2a0b15a4ff2107894ff807bde232053027d99",
"01b2a0b223adfdf8271c9ee57ff4bcbb3ba185ec", ←Includes winning Bid
"01b2a0b32eb2dd5706e6537a2b666feaea309636",
"01b2a0b4c6b8afe919cde64a214ee59e88e44f97",
"01b2a0b59b57a2f429694729b034510568030a36",
"01b2a0b6aabe799364a6545149e13df9f7827142",
"01b2a0b776ff12764013229ca67e1f6f38f1c6c0",
"01b2a0b891adbd666cc96b657e2a67ba8b066c6a",
"01b2a0b9163d5b90ebc3986e1b3c248231c695f1",
"01b2a0ba7243405d9e4b4f166fc9408e73521cc9"
],
"vtxs": [
"reward,fulltimegeek,5000.0,28483762_21_0_5ac31101d03144bd0ba09dbead10f46da57a4863"
],
"block_id": "e5e3b02256d32a9099b9d3dd2d72b0a696e07cc81921a49ccb7edc8915ceaac5"
}

In block 3 you can see an example of tokens being rewarded to a miner. The other two remaining types of Vapor Transactions (Transfer,Trade) will be shown in future posts.

H2
H3
H4
Upload from PC
Video gallery
3 columns
2 columns
1 column
66 Comments