MIST: a Meta-Model for Steem Subchains

in #steem7 years ago (edited)


Last year, while he was still actively working on Steem development, Dan Larimer (aka @dantheman, aka @dan aka @bytemaster) wrote this post about Steem subchains. In it, he pointed out that Steem is a potential developer's playground when it comes to potential blockchain-based applications.

What is a subchain?

Ever heard of Counterparty or Omni (formerly Mastercoin)? Those are what @dantheman calls "subchains": they are an application layer built on top of the main Bitcoin blockchain. What this means is that to (for example) send XCP tokens on Counterparty, you include a specially-formatted instruction in a Bitcoin transaction, pay the Bitcoin transaction fee, and then the Counterparty "network" parses this instruction and records that you sent the requested number of XCP tokens. Of course there are many many other operations available on Counterparty and Omni, but they all work in exactly this way.


xcpomni.png

Subchains let developers build blockchains without worrying about the blockchain itself. The developers of Counterparty and Omni trust that the Bitcoin miners are doing their job and that the history of Counterparty and Omni instructions stored in the blockchain will not change. Beyond that, all Counterparty and Omni need to do are ensure that their own protocols can parse the history embedded in the Bitcoin blockchain properly to generate their own database states deterministically.

Introducing MIST, the Micro Intra-Steem Token

Here, I am not proposing a protocol; think of MIST as a meta-protocol. It's extremely simple: a MIST protocol is a deterministic rule that maps lists of Steem operations to database states.

First, here's a quick primer on how the Steem blockchain is organized:

  1. Blocks: A block is a list of Steem transactions. Steem blocks are published once every 3 seconds.
  2. Transactions: A transaction is a list of one or more Steem operations.
  3. Operations: An operation is the fundamental unit of "interaction" with Steem. When you publish or edit a post or reply on Steem, you're putting a "comment" operation into a transaction which is then included in a Steem block. Same with voting, same with following, same with resteeming, and so on.

Operations are included in a transactions in a fixed order; transactions are included in blocks in a fixed order. Because of this structure, for our purposes we can ignore blocks and transactions and think of the Steem blockchain very simply as a list of operations. Once an operation is a couple minutes old, the order of that list cannot change, and the information included in each operation cannot change.

The MIST Fundamental Diagram

At its core, a MIST is a flow chart that looks like this:


flowchart.001.png

So to create your own subchain according to the MIST meta-protocol, all you need to do is fill in the 2nd and 3rd items by answering these fundamental questions:

  1. What is the initial state of the MIST database?
  2. What constitutes a valid MIST instruction?
  3. For each valid MIST instruction, what is the corresponding database update?

A Trivial Example: Operation Counter

This is the silliest, simplest example I could think of. This particular MIST database has one attribute: counter, which I will initialize to 0. I'll answer the two fundamental questions here:

  1. Every Steem operation maps to a single MIST instruction called increment.
  2. For each increment instruction, let counter = counter + 1.

What's it do? It keeps a running tally of the number of operations that have ever been included in the Steem blockchain. What's the point? It was the simplest MIST I could think of.

It's so simple that it's silly to think of it as a subchain, but since we can fit it into the MIST Fundamental Diagram, it's actually a valid example.

What else can we do with MIST?

Well, quite literally anything that can be implemented on a blockchain can be implemented as a MIST. For example, we could port Counterparty to Steem. Call it Steemparty or something like that. Then we'd have a whole litany of Steem tokens that nobody would know what to do with.

What about a multivariate reputation system? The current system, where Steemit.com shows a little number by your account name that is supposed to mean your "reputation," is useful for spotting serial spammers, but not helpful if you're trying to figure out whether to trust someone to do some work you paid for. So why not set up a MIST that lets people report several different aspects of reputation? Like maybe you do business with someone and they're a total jerk - but they act in an honorable and trustworthy manner. Then they deserve to have a different "niceness" score than "trust" score.

Prediction markets are always fun. This is how Gnosis raised millions of dollars without a working prototype, by promising prediction markets.

Or hey, why not smart contracts? @dantheman suggested this in his original article, when he said someone could build a full Ethereum Virtual Machine that operates on Steem.

Want to get in on the Bitcoin fork action? I bet you could come up with a clever way to let people use their Bitcoin private keys to claim balances of a new STEEM.BTC asset that you design to operate on Steem. You might even allow people to mine it!

The End

Stay tuned! Maybe I have more up my sleeve, and maybe it's worth your time to follow me.

If you would like to play with an experimental MIST, go resteem this post.

Sort:  

I'd love to see more examples of how this would work in practice. I'm a bit confused on how you would introduce non-steem operations. Are you able to add whatever "op" you want? Aren't you limited to ops defined by the Steem blockchain? If so, do you have to piggy back on top of those ops, such as a transfer with a specific memo or something like that?

Piggybacking is one way, certainly: transfer memos, or the title, body, or category of a post. But Steem also has an operation called custom_json that lets you include totally arbitrary data in the blockchain. That's actually how the re-steem feature is implemented.

Very cool, thanks for the reply. I knew about custom_json on accounts but didn't realize it was an operation all on it's own. So it's not a transfer or a comment or anything it's just "blob o' custom json"? That could be fun to play around with, for sure.

Yep, just a blob o' json.

And I plan to publish a real working example of a MIST soon.

Interesting, but why use root posts? Won't that just clog up the "blog" sites like steemit and busy.org? Couldn't this have been done differently? I'll go ask over there. Thanks for the link! :)

Yeah, it's messy. But my thought was to make it as compatible with existing front-ends as possible. I had thought about doing transfers with replies to the genesis post, but I think there's a limit to how many replies a post can have and I didn't want that to cause me problems in the long run.

You could always create another post and change the protocol to look for that new post also if you run into that limit. Could be considered a second round of the ICO, maybe.

Hi @lukestokes - my token is now launched: Pocket Announcement. It's similar to the test version we'd discussed before, but I cleaned up the syntax for sending tokens. I'm having people claim a stake of tokens by resteeming this post. Would love your thoughts and/or participation!

pocketsend:100@biophil, Freaking cool! Well done. I just got my tokens.

Successful Send of 100
Sending Account: lukestokes
Receiving Account: biophil
New sending account balance: 999900
New receiving account balance: 1005197
Fee: 1
Steem trxid: 809300083e6c3d29844684321759c430191c1d98
Thanks for using POCKET! I am running this confirmer code.

Thanks! I'm just glad it works ;)

Successful Send of 100
Sending Account: lukestokes
Receiving Account: biophil
New sending account balance: 999900
New receiving account balance: 1005098
Fee: 1
Steem trxid: 809300083e6c3d29844684321759c430191c1d98
I am the-tech-guy's POCKET bot. Currently running this code

Interesting... might be a good idea to add a check in the code to not add a comment if an existing bot comment already exists.

That check is in my code already. It can fail if the two bots' databases aren't consistent, which seems to be the case here.

Ah, interesting. I wonder if checkpoints published on the Steemit blockchain would be a good idea, kind of like how Gridcoin takes the BOINC data and verifies it with superblocks. That way the databases could sync up every day or so to ensure they are correct. It could even be a hash of the database as if a given block height. Maybe seed nodes could be keeping this information in sync.

Maybe one of these days I'll play around with building a POCKET validator. I mentioned your project in my recent witness report. I think it's a really cool thing. :)

Successful Send of 100
Sending Account: lukestokes
Receiving Account: biophil
New sending account balance: 999900
New receiving account balance: 1005197
Fee: 1
Steem trxid: 809300083e6c3d29844684321759c430191c1d98
Thanks for using POCKET! I am running this confirmer code.

Man, I know we do not talk much but am I ever glad there are good people like you and @dan / @dantheman who know what you are doing with all this stuff dude.

LOL!!!

Howdy @barrydutton, I just launched my first MIST, a token system that operates entirely through Steemit. Care to participate? People who resteem this post get a free stake of tokens.

I will try and look at this tonite.

I know anything you are involved in means it is well advised from a tech POV for sure.

I never hear from you ever though lol

Well, here I am :)

LOL. That is funny dude.

I claimed my stake, read it a couple times, don't understand it all, since I am not an IT guy as you know like you...

But I have always liked your work and I trust you and that counts for a lot in this space.

Your post / project is doing really well!!!!

I am happy for you dude.

TY for the (funny) reply here too LOL.

pocketsend:1@biophil

Successful Send of 1
Sending Account: biophil
Receiving Account: biophil
New sending account balance: 985170
New receiving account balance: 985170
Fee: 1
Steem trxid: db3c8d4d0c4172d35caeddc9042daecf3353790f
Thanks for using POCKET! I am running this confirmer code.

Successful Send of 1
Sending Account: biophil
Receiving Account: biophil
New sending account balance: 985071
New receiving account balance: 985071
Fee: 1
Steem trxid: db3c8d4d0c4172d35caeddc9042daecf3353790f
I am the-tech-guy's POCKET bot. Currently running this code

Successful Send of 1
Sending Account: biophil
Receiving Account: biophil
New sending account balance: 985170
New receiving account balance: 985170
Fee: 1
Steem trxid: db3c8d4d0c4172d35caeddc9042daecf3353790f
Thanks for using POCKET! I am running this confirmer code.

Thank you @biophil

The development of blogging in steemit more advanced, your knowledge and work come to improve the system ..

these are good informations for us i understand from this some my points thanx @biophil

This post received a 4.8% upvote from @randowhale thanks to @biophil! For more information, click here!

Just when I think my mind can't be further blown away, there you go and do it. It's crazy and a few months ago I was impressed by Ethereum almost 20 second block times. Steem is amazing with 3 second block times, almost 1 million transactions per day, and hard forks without splitting coins etc. So much more can be added here as you point out. View.ly also is exciting!

Just launched my first MIST, a token system that operates entirely through Steemit. Care to participate? People who resteem this post get a free stake of tokens.

Thank you so much for sharing this, I'm still new and learning. I see I can learn a lot from other Steemians! :-)

Very Gud Explanation & Thank you for sharing information about steem.

Upvoted and RESTEEMED!

Very good.

Hi friend, very good !!!!! You would help me with a vote in my post., Thanks !!! ;)

100% upvote for @biophil, for inventing @thing-2 which is my favorite BOT!

Great article, also!

Interesting,.... You are truly a creative person....

Hii @biophil successful greetings
Nice to meet you

#introduce my name @ firzee0717,
I come from #aceh Sumatra.
Welcome to #steemit for those of you who want to succeed here, I also want the same thing.
I'm also new here #Steem is still a lot to learn from seniors.

Nice to meet you all !!
Please help to promote me
And Please for others follow and Upvote My account @ firzee071

Wonderful material!.. Really it is so useful for me.. Keep up the good work.
Followed you and upvoted done.
Have a look into my blog, you may like any of my posts :-)

I don't know if it's you but thank you. :-D

Congratulations @biophil! You have completed some achievement on Steemit and have been rewarded with new badge(s) :

Award for the number of upvotes

Click on any badge to view your own Board of Honor on SteemitBoard.
For more information about SteemitBoard, click here

If you no longer want to receive notifications, reply to this comment with the word STOP

By upvoting this notification, you can help all Steemit users. Learn how here!

..cooool..a lot of info...follow you..up!..

Hey @biophil, I created a MIST package that makes it very easy to create MIST DApps. https://steemit.com/utopian-io/@shredz7/announcing-steem-state-build-any-dapp-on-steem