Steem Smart Contracts: a few words regarding the consensus layer


Hi there,

I've been working on this for quite a few months now, i changed several times the architecture of this layer and started over quite a few times because you know... it's not something that you do eveyrday, it requires trials and errors...
The consensus layer of Steem Smart Contracts (SSC) is based on the DPoS system, it is hybrid in a way it is using a P2P layer and the Steem blockchain to verify the integrity of the data. Here are a few words on what this consensus layer looks like:

Witnesses election:

  • the witnesses are elected by ENG stakeholders
  • the approval power is based on number of ENG staked
  • up to 30 votes per Steem account

Rounds:

  • 1 round = 21 slots
  • slots attribution:
    • the top 20 witnesses receive automatically a slot
    • 1 backup witness is randomly picked
    • once 21 witnesses have been found, they are randomly shuffled
  • the last witness of the round is in charge of verifying it

Round verification process:

  • when all the blocks composing a round have been parsed from the Steem blockchain, the witness in charge of verifying the round sends what is called the "round hash" (it is a hash that "summarizes" all the hashes of the blocks) to the other witnesses that are part of the round in a P2P fashion
  • when 17 signatures are received, a custom_json including these signatures is broadcasted to the Steem blockchain, it is then caught by the nodes and run though a smart contract that verifies the signatures of the witnesses
  • the blocks that were part of the round are marked as "verified"
  • the witness that was in charge of verifying the round is rewarded for helping securing the network with ENG tokens (as stake)

Requirements to be a witness:

  • a machine with 8Gb of RAM and around 20Gb of storage (even though the storage needed for now is under 4Gb)
  • a Steem account with 200 Steem Power or more to broadcast the custom_json to the Steem blockchain

Testnet:

While the code is pretty stable on my local network I need to test it out over the "internet"...
I plan on starting a testnet in the next few days/weeks, it will only have 5 witnesses (so the Steem Power requirements would be around 1000 SP). Feel free to ping me on discord (Harpagon#4087) if you're interested in participating in the testnet.

The code of the consensus layer is available at https://github.com/harpagon210/steemsmartcontracts/tree/witnesses
(the witness reward system is not in place yet)


Comments 14


To listen to the audio version of this article click on the play image.

Brought to you by @tts. If you find it useful please consider upvoting this reply.

31.10.2019 20:41
0

Thank you for the update. Quick question: ENG can only be mined from Engine miners. So what is the incentive to be a witness here?

01.11.2019 00:23
0

Witnesses are going to be rewarded with ENG as well. Newly minted ENG will be staked to the witness account every time this witness validates a round.

01.11.2019 14:28
1

Last question. Do EMFOUR stakeholders i.e. me :) get any voting rights? I would like this to be the case obviously. Thank you for your time and work.

01.11.2019 16:20
0

not directly, you'll need to stake the ENG your earn from your EMFOURs

01.11.2019 16:35
0

je viens de remarquer Louis de Funès. Cool.

01.11.2019 19:03
1

This is really cool and @intrepidsurfer showed me this on steem-engine.com discord so thanks for that!

heres some mroe ideas for this:

We could have have witness style voting FOR TOKENS themselves s ..imagine that too. imagine u had like 30 20 ro even 10 or een just top 5 votes you could give out to just 5 or 10 coins on steem engine, and we gotto see everyones votes, stake weighetd from how much ENG you have

ALSO ENg EOS eosdac votinga nd proposals!

I would LOVE to flesh out the ENg tribe @beggars or is that @holger80 [Witness] who has ENG? I would love a ENg tribe so we can reserve it for just steem engine relateds stuff development stuff like cadawg and blockchainstudio would post there,like a Utopian but for ENg and steem engine stuff
@intrepidsurfer well this is a discord not a tribe, but yeah it could be si what im saying and aggroed knows that. probablyd oenst want to make things too compicated but ive thought about it and we wouldnt have any issue except for teh simple matter of a ENg reward pool now thats what he has to decide on and i feel that a VERY small reward pool even 100,000 ENG is fine, mroe can be added later if voted in. i just want a place to post about ENG . Now a 1 million ENG pool out of 4 Million total supply 3.8 million circulating it seems perfect too. imagine all that ENG u could get for posts about steem engine, or claim for proposals, using the eosdac system which woudl work cuz of the pegged system

01.11.2019 01:37
0
01.11.2019 01:39
1

@organduo !steem2email

Posted using Partiko iOS

01.11.2019 13:00
0

Emailed 👌


Powered by witness untersatz!

01.11.2019 13:00
0

@harpagon I think my SSC witness is running now. Chain has restored from file and is now syncing (I believe).

image.png

image.png

Is this config ok?

{
    "chainId": "mainnet1",
    "rpcNodePort": 5000,
    "databaseURL": "mongodb://localhost:27017",
    "databaseName": "ssc",
    "dataDirectory": "./data/",
    "databaseFileName": "database.db",
    "blocksLogFilePath": "./blocks.log",
    "autosaveInterval": 1800000,
    "javascriptVMTimeout": 10000,
    "streamNodes": [
        "https://api.steemit.com",
        "https://rpc.buildteam.io",
        "https://rpc.steemviz.com",
        "https://steemd.minnowsupportproject.org"
    ],
    "startSteemBlock": 37454693,
    "genesisSteemBlock": 29862600
}
03.11.2019 03:07
0