-
Notifications
You must be signed in to change notification settings - Fork 6
Thinking in Portals (or... Soft Consensus): A Guide to Building DApps on Steem using steem state
This is a placeholder for a longer article I will write in the future. Below are a list of things to keep in mind while building soft-consensus DApps using steem-state
.
-
Make your project open-source! If only you have the source to the node and are able to run it, is it really in any way decentralized? Generally, make sure that everybody who wants to can do everything you can do in your DApp, like being able to run a node. This is the one point where SteemMonsters has a big fault; their node is not open source (and no, steemmonsters python bot script does not count as a full node).
-
Use unique prefixes! A collision between two prefixes can generally cause problems as two different formats will be created with the same transaction id, so both DApps will think the others’ transactions are their own. If the below guideline is not done correctly, this can also cause crashing and errors in the DApps.
-
Handle invalid operations without crashing! Invalid transactions will be created, either by malicious attackers, or simply by some sort of broken code. Your nodes should be able to handle invalid transactions without crashing and causing even bigger problems.
-
Never use floating points! Floating point numbers are calculated differently on different computers, and therefore can result in a loss of consensus. Only ever use integers for numbers (in javascript, since there is no integer variable, simply check for every number in a transaction being an integer). More generally, make sure everything is deterministic so that consensus is reached (e.g. can't use something like math.random()).
Like I said, more will be added in the future and each of these points will be elaborated on.
If you have any questions, suggestions, problems, or want advice about incorporating soft-consensus into your project, email me at [email protected].