create account

Announcing steem-state - Build Any DApp on Steem! by shredz7

View this thread on: hive.blogpeakd.comecency.com
· @shredz7 · (edited)
$50.01
Announcing steem-state - Build Any DApp on Steem!
A framework for creating arbitrary soft-consensus-based DApps on Steem! Build any DApp, from tokens to games.

![](https://steemitimages.com/p/3W72119s5BjWMGm4Xa2MvD5AT2bJsSA8F9WeC71v1s1fKfGkK9mMKuc3LcvF4KigbWg9UsrpENy2vPnRmG8ycCNPiMXfiADKLPkgAdPhCk89VwKTtjJwEv?format=match&mode=fit)
*Repository: https://github.com/nicholas-2/steem-state* 

`steem-state` is an npm package that allows developers to build DApps using the Steem blockchain.  

The Steem blockchain is one of the fastest and most performant blockchains in existence and also has over 60,000 active users each day, with free and fast transactions. `steem-state` makes it incredibly easy to create decentralized apps on the Steem blockchain using soft consensus.

### What is soft consensus?

Most, if not all, blockchains focused on the creation of DApps today such as Ethereum are based around the idea of smart contracts. DApps running using smart contracts have their transactions verified by each node in the network. But this method is not the only way; not every node in the network has to verify every transaction for each DApp even if it doesn’t apply to them. When a transaction is not verified by every node in the network, but only the ones who use the DApp that the transaction applies to verify that transaction, soft-consensus occurs.

To use an analogy, the most adopted internet data transfer protocols (such as UDP) don’t try to do anything special with the data that is being sent. These protocols  let the two users who are communicating verify, authenticate, etc their own data. Not everyone on the internet authenticates and verifies every data packet; it’s just not feasible.Similarly, not everyone on a blockchain has to verify and authenticate every data packet. Ethereum is trying to introduce unneeded complexity to the problem of creating DApps by requiring that every user has to verify every transaction in every DApp, and it’s already hitting a scalabililty barrier partly because of it.

Anything that a smart contract can do can be done with soft-consensus, and soft-consensus can actually do much more. A soft consensus DApp is easy to hard fork without forking the main chain it runs on, and it has easy support for virtual operations (when a DApp creates a transaction that will execute after a certain amount of time), which Ethereum and most smart contract blockchains do not have, and will be implemented into the `steem-state` package in v2.0.0.

`steem-state` uses the `custom_json` operation type to create soft-consensus transactions. You can read more at the [dev portal](https://developers.steem.io) by searching up `custom_json`.

### `steem-state`

`steem-state` is a framework that allows developers to define events that occur on a certain transaction type, e.g. displaying data to the user or updating the internal state (such as the balance of the user). Using `steem-state`, one can create any possible DApp on the Steem blockchain, from tokens to games!

It can be installed by using `npm install steem-state` in any existing npm project.

### Roadmap

In the future, version 2.0.0 will be released (currently in v1.0.7), which will include support for virtual transactions in DApps.

### Tutorial

The best way to understand this is by trying out a tutorial, which can be found in the README on [github](https://github.com/nicholas-2/steem-state). It will walk you through creating a fully decentralized messaging app on the Steem blockchain in 28 lines of code.

### Contributing

If you have an interest in helping develop virtual transactions for v2.0.0, simply email me at nicholas2591@gmail.com or contact me in the steem-devs discord at @Shredz7. But the best way to contribute right now is to create tutorials for the project! Email me at nicholas2591@gmail.com if you create a tutorial, because I will be glad to resteem it and post it on the repository wiki. This doesn’t really fit into Utopian.io’s actual contributing section, but a great way to contribute is to spread the word and build DApps using this package!

*If you have any questions, feel free to comment on this post or email me at nicholas2591@gmail.com*
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 28 others
properties (23)
authorshredz7
permlinkannouncing-steem-state-build-any-dapp-on-steem
categoryutopian-io
json_metadata{"tags":["utopian-io","development","steem","blockchain","steemit"],"users":["shredz7"],"image":["https://steemitimages.com/p/3W72119s5BjWMGm4Xa2MvD5AT2bJsSA8F9WeC71v1s1fKfGkK9mMKuc3LcvF4KigbWg9UsrpENy2vPnRmG8ycCNPiMXfiADKLPkgAdPhCk89VwKTtjJwEv?format=match&mode=fit"],"links":["https://github.com/nicholas-2/steem-state","https://developers.steem.io"],"app":"steemit/0.1","format":"markdown"}
created2018-12-11 02:12:30
last_update2018-12-11 02:14:27
depth0
children16
last_payout2018-12-18 02:12:30
cashout_time1969-12-31 23:59:59
total_payout_value37.772 HBD
curator_payout_value12.242 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length4,146
author_reputation7,922,356,058,897
root_title"Announcing steem-state - Build Any DApp on Steem!"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd0
post_id76,664,634
net_rshares83,576,859,555,519
author_curate_reward""
vote details (92)
@apshamilton ·
$0.12
Great initiative. Its very important to always ask the questions for any application:
1. What exactly needs to be decentralised and what doesn't?
2. How much does it need to be decentralised.
👍  , , ,
properties (23)
authorapshamilton
permlinkre-shredz7-20181211t11611795z
categoryutopian-io
json_metadata{"tags":["utopian-io","development","steem","blockchain","steemit"],"app":"esteem/2.0.2-surfer","format":"markdown+html","community":"esteem.app"}
created2018-12-11 09:06:12
last_update2018-12-11 09:06:12
depth1
children1
last_payout2018-12-18 09:06:12
cashout_time1969-12-31 23:59:59
total_payout_value0.089 HBD
curator_payout_value0.032 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length191
author_reputation214,010,912,760,441
root_title"Announcing steem-state - Build Any DApp on Steem!"
beneficiaries
0.
accountesteemapp
weight1,000
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id76,677,196
net_rshares220,448,794,218
author_curate_reward""
vote details (4)
@shredz7 ·
$0.10
For this application, we can allow for any level of decentralization; in the tutorials we demonstrate full decentralization but DApps like SteemMonsters use the same methods with less decentralization. It is important to choose the right amount of decentralization and therefore using `steem-state` may not be perfect for all DApps (ones who choose to be more on the centralized side).
👍  ,
properties (23)
authorshredz7
permlinkre-apshamilton-re-shredz7-20181211t11611795z-20181211t131246109z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"app":"steemit/0.1"}
created2018-12-11 13:12:48
last_update2018-12-11 13:12:48
depth2
children0
last_payout2018-12-18 13:12:48
cashout_time1969-12-31 23:59:59
total_payout_value0.078 HBD
curator_payout_value0.026 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length385
author_reputation7,922,356,058,897
root_title"Announcing steem-state - Build Any DApp on Steem!"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd0
post_id76,685,813
net_rshares173,125,985,504
author_curate_reward""
vote details (2)
@crypto.piotr ·
Great initiative @shredz7

The steem chain has a lot of potential to exploit and thanks to this independent developers will be able to carry out their projects.

All the best, Piort.
👍  
properties (23)
authorcrypto.piotr
permlinkre-shredz7-announcing-steem-state-build-any-dapp-on-steem-20181217t225653176z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"users":["shredz7"],"app":"steemit/0.1"}
created2018-12-18 00:10:27
last_update2018-12-18 00:10:27
depth1
children2
last_payout2018-12-25 00:10:27
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length182
author_reputation27,396,789,428,606
root_title"Announcing steem-state - Build Any DApp on Steem!"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id76,990,037
net_rshares11,805,287,653
author_curate_reward""
vote details (1)
@shredz7 ·
Yes, I’ve already had multiple developers talk to me about building DApps using steem-state such as @dlux-io, which has already publicly announced their super interesting incentivization coin which might also open up the doors to even more potential for DApps running on Steem (the ability to create transactions).

I’m very excited about the future of steem-state and the Steem blockchain as a whole and would love to see Steem apps use the new potential allotted by steem-state!

I’m glad you’re interested in this technology. If you have any questions (Or suggestions for interesting DApps that could run on this for that matter), please reply!
👍  
properties (23)
authorshredz7
permlinkre-cryptopiotr-re-shredz7-announcing-steem-state-build-any-dapp-on-steem-20181218t150042624z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"users":["dlux-io"],"app":"steemit/0.1"}
created2018-12-18 15:00:42
last_update2018-12-18 15:00:42
depth2
children1
last_payout2018-12-25 15:00:42
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length647
author_reputation7,922,356,058,897
root_title"Announcing steem-state - Build Any DApp on Steem!"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd0
post_id77,020,694
net_rshares13,112,305,136
author_curate_reward""
vote details (1)
@crypto.piotr ·
Dear @shredz7

It's also great to see how responsive you are. Steemit need more people like you.

Thank you.

cheers, Piotr
👍  
properties (23)
authorcrypto.piotr
permlinkre-shredz7-re-cryptopiotr-re-shredz7-announcing-steem-state-build-any-dapp-on-steem-20181219t033500493z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"users":["shredz7"],"app":"steemit/0.1"}
created2018-12-19 03:35:24
last_update2018-12-19 03:35:24
depth3
children0
last_payout2018-12-26 03:35:24
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length123
author_reputation27,396,789,428,606
root_title"Announcing steem-state - Build Any DApp on Steem!"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id77,046,603
net_rshares11,794,529,735
author_curate_reward""
vote details (1)
@dlux-io ·
$0.03
Hi! 
It's great to hear more people are working on these issues. We would love to help and contribute. We have a dApp platform built at dlux.io that is also in a prototype stage. We were discussing earlier today implementing incentivized decentralized relays and IPFS nodes to store state signed by keys and paid through fees. We already have AR/VR running in our containers. Find us on discord at https://discord.gg/Beeb38j
👍  , ,
properties (23)
authordlux-io
permlinkre-shredz7-announcing-steem-state-build-any-dapp-on-steem-20181211t081136317z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"community":"steempeak","app":"steempeak"}
created2018-12-11 08:11:36
last_update2018-12-11 08:11:36
depth1
children1
last_payout2018-12-18 08:11:36
cashout_time1969-12-31 23:59:59
total_payout_value0.026 HBD
curator_payout_value0.008 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length424
author_reputation119,095,558,103,977
root_title"Announcing steem-state - Build Any DApp on Steem!"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id76,675,602
net_rshares58,488,035,806
author_curate_reward""
vote details (3)
@shredz7 ·
Great! I’m also trying to create a way to synchronise state for `steem-state`. I’ll hop on the discord and read more about your DApp platform!
👍  
properties (23)
authorshredz7
permlinkre-dlux-io-re-shredz7-announcing-steem-state-build-any-dapp-on-steem-20181211t153407705z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"app":"steemit/0.1"}
created2018-12-11 15:34:09
last_update2018-12-11 15:34:09
depth2
children0
last_payout2018-12-18 15:34:09
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length142
author_reputation7,922,356,058,897
root_title"Announcing steem-state - Build Any DApp on Steem!"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd0
post_id76,692,328
net_rshares0
author_curate_reward""
vote details (1)
@emrebeyler ·
$9.82
Great project.

Custom JSONS are great. There are so much possibilities to implement great ideas.

- I know this is an early state but unit tests with a good code coverage would be good. If I was a dApp owner, I would like to see the project includes tests.

- Sometimes, RPC nodes have hiccups and return [funny things](https://github.com/steemit/steem-js/issues/377). Not sure dsteem handles that internally, but having retry mechanisms on that kind of unexpected responses may help not to miss any custom json.

- Also, thinking about a feature which makes this also a notification bus to send certain events to registered endpoints. This would help running the steem-state in a black box, and push events to other apps. (any type of language may benefit with that way.)

***

Your contribution has been evaluated according to [Utopian policies and guidelines](https://join.utopian.io/guidelines), as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, [click here](https://review.utopian.io/result/3/2-2-2-2-2-1-2-).

---- 
Need help? Write a ticket on https://support.utopian.io/. 
Chat with us on [Discord](https://discord.gg/uTyJkNm). 
[[utopian-moderator]](https://join.utopian.io/)
👍  , , , , , , , , , ,
properties (23)
authoremrebeyler
permlinkre-shredz7-announcing-steem-state-build-any-dapp-on-steem-20181212t200035500z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"links":["https://github.com/steemit/steem-js/issues/377","https://join.utopian.io/guidelines","https://review.utopian.io/result/3/2-2-2-2-2-1-2-","https://support.utopian.io/","https://discord.gg/uTyJkNm","https://join.utopian.io/"],"app":"steemit/0.1"}
created2018-12-12 20:00:36
last_update2018-12-12 20:00:36
depth1
children2
last_payout2018-12-19 20:00:36
cashout_time1969-12-31 23:59:59
total_payout_value7.450 HBD
curator_payout_value2.374 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,276
author_reputation448,535,049,068,622
root_title"Announcing steem-state - Build Any DApp on Steem!"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id76,752,182
net_rshares16,553,313,399,718
author_curate_reward""
vote details (11)
@shredz7 ·
Thanks for your recommendations!
properties (22)
authorshredz7
permlinkre-emrebeyler-re-shredz7-announcing-steem-state-build-any-dapp-on-steem-20181213t025406671z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"app":"steemit/0.1"}
created2018-12-13 02:54:06
last_update2018-12-13 02:54:06
depth2
children0
last_payout2018-12-20 02:54:06
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length32
author_reputation7,922,356,058,897
root_title"Announcing steem-state - Build Any DApp on Steem!"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd0
post_id76,764,815
net_rshares0
@utopian-io ·
Thank you for your review, @emrebeyler! Keep up the good work!
properties (22)
authorutopian-io
permlinkre-re-shredz7-announcing-steem-state-build-any-dapp-on-steem-20181212t200035500z-20181214t221556z
categoryutopian-io
json_metadata"{"app": "beem/0.20.9"}"
created2018-12-14 22:15:57
last_update2018-12-14 22:15:57
depth2
children0
last_payout2018-12-21 22:15:57
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length62
author_reputation152,955,367,999,756
root_title"Announcing steem-state - Build Any DApp on Steem!"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id76,850,349
net_rshares0
@steem-ua ·
#### Hi @shredz7!

Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your post is eligible for our upvote, thanks to our collaboration with @utopian-io!
**Feel free to join our [@steem-ua Discord server](https://discord.gg/KpBNYGz)**
properties (22)
authorsteem-ua
permlinkre-announcing-steem-state-build-any-dapp-on-steem-20181212t202002z
categoryutopian-io
json_metadata"{"app": "beem/0.20.14"}"
created2018-12-12 20:20:06
last_update2018-12-12 20:20:06
depth1
children0
last_payout2018-12-19 20:20:06
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length286
author_reputation23,214,230,978,060
root_title"Announcing steem-state - Build Any DApp on Steem!"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id76,752,750
net_rshares0
@steevebot ·
$0.10
This story was recommended by Steeve to its users and upvoted by one or more of them.

Check @steeveapp to learn more about Steeve, an AI-powered Steem interface.
👍  ,
properties (23)
authorsteevebot
permlinkre-shredz7-announcing-steem-state-build-any-dapp-on-steem-vote-beneficiaries
categoryutopian-io
json_metadata{"tags":["utopian-io"],"app":"steeve/0.1","format":"markdown"}
created2018-12-12 23:01:09
last_update2018-12-12 23:01:09
depth1
children0
last_payout2018-12-19 23:01:09
cashout_time1969-12-31 23:59:59
total_payout_value0.074 HBD
curator_payout_value0.024 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length164
author_reputation1,016,697,284,644
root_title"Announcing steem-state - Build Any DApp on Steem!"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id76,758,043
net_rshares165,905,203,390
author_curate_reward""
vote details (2)
@therealwolf · (edited)
Interesting, I like where this is going. Just a few thoughts:

- use blockchainmode (latest/irreversible) as parameter
- for dApps it's important that blocks aren't skipped. How do you make sure that this doesn't happen? And where is the current processed block-number saved? (How am I getting it back as user of the package?)
- when I used streaming with dsteem it was somewhat unstable - having the option to use something like STEEMSQL would be interesting. (I've written some code for that in node-js recently, so if you need some help with it, let me know)
- there will be apps that are using `required_auths` - this needs to be included as well.
👍  ,
properties (23)
authortherealwolf
permlinkre-shredz7-announcing-steem-state-build-any-dapp-on-steem-20181211t031158245z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"app":"steemit/0.1"}
created2018-12-11 03:11:57
last_update2018-12-11 03:12:33
depth1
children2
last_payout2018-12-18 03:11:57
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length651
author_reputation582,208,885,469,814
root_title"Announcing steem-state - Build Any DApp on Steem!"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id76,666,302
net_rshares5,624,511,454
author_curate_reward""
vote details (2)
@shredz7 · (edited)
Yes, this is still in the earlier stages as development. Using blockchainmode as a parameter is something that should be coming out this week. 

You can get the current processed block number by using `processor.getCurrentBlockNumber()`, yes that is very important to the package. There is a documentation which contains items like this on the github (plus, this is also mentioned in the token tutorial I posted alongside this announcement). I’m not sure how `steem-state` would react to when a witness skips signing a block— when this occurs, the block *number* is not skipped, correct? (If I’m right, then `steem-state` will have no trouble with skipped blocks).

STEEMSQL seems like a good idea, I’ll look into it.

Yes — I will look into that. Currently, the name of the user who ‘created’ a transaction is simply derived from `required_auths[0]`, so using `required_auths` is currently untested and is not likely to work (I don’t have much knowledge in those DApps, if you could enlighten me that would be great). That will definitely be something I will add in the future. 

Thanks for reading this article and providing feedback @therealwolf! I’ll get to work building the next versions and including some of your suggestions! Currently this is the MVP and has a lot more features to come (I mean, the package is only 150 lines of code).
👍  ,
properties (23)
authorshredz7
permlinkre-therealwolf-re-shredz7-announcing-steem-state-build-any-dapp-on-steem-20181211t033901669z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"app":"steemit/0.1","users":["therealwolf"]}
created2018-12-11 03:39:03
last_update2018-12-11 14:00:57
depth2
children0
last_payout2018-12-18 03:39:03
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,344
author_reputation7,922,356,058,897
root_title"Announcing steem-state - Build Any DApp on Steem!"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd0
post_id76,667,124
net_rshares689,280,693
author_curate_reward""
vote details (2)
@steempunks-live ·
been streaming services data for a year, no instabilities.
properties (22)
authorsteempunks-live
permlinkre-therealwolf-re-shredz7-announcing-steem-state-build-any-dapp-on-steem-20181216t162141878z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"app":"steemit/0.1"}
created2018-12-16 16:21:42
last_update2018-12-16 16:21:42
depth2
children0
last_payout2018-12-23 16:21:42
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length58
author_reputation1,383,039,024,263
root_title"Announcing steem-state - Build Any DApp on Steem!"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id76,925,865
net_rshares0
@utopian-io ·
Hey, @shredz7!

**Thanks for contributing on Utopian**.
We’re already looking forward to your next contribution!

**Get higher incentives and support Utopian.io!**
 Simply set @utopian.pay as a 5% (or higher) payout beneficiary on your contribution post (via [SteemPlus](https://chrome.google.com/webstore/detail/steemplus/mjbkjgcplmaneajhcbegoffkedeankaj?hl=en) or [Steeditor](https://steeditor.app)).

**Want to chat? Join us on Discord https://discord.gg/h52nFrV.**

<a href='https://steemconnect.com/sign/account-witness-vote?witness=utopian-io&approve=1'>Vote for Utopian Witness!</a>
properties (22)
authorutopian-io
permlinkre-announcing-steem-state-build-any-dapp-on-steem-20181213t075238z
categoryutopian-io
json_metadata"{"app": "beem/0.20.9"}"
created2018-12-13 07:52:39
last_update2018-12-13 07:52:39
depth1
children0
last_payout2018-12-20 07:52:39
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length589
author_reputation152,955,367,999,756
root_title"Announcing steem-state - Build Any DApp on Steem!"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id76,773,530
net_rshares0