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:
- the witnesses are elected by ENG stakeholders
- the approval power is based on number of ENG staked
- up to 30 votes per Steem account
- 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
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)