Does STEEM need Smart Contracts?

in #steem7 years ago (edited)

Screen Shot 2018-06-20 at 15.22.26.png

Image was taken of the official Steem website. Text was edited


STEEM is one of the greatest blockchains in the world.

  • It has a high-block frequency (every 3s) that is needed for fast transactions.

  • It has no fees on transactions - besides bandwidth.

  • It has an incredible ecosystem of dapps built around and on top of it. (dtube, dlive, utopian, steemmonsters, smartsteem etc).

  • It utilizes delegated proof of stakes - where 20 witnesses and over 150 backup witnesses who are voted in by the stake-holders, are producing blocks & keep the consensus for the blockchain in check.

  • And most importantly: it has an incredible community which makes it easy to kickstart new projects. Simply create a great post - promote & advertise it with services like Smartsteem.com and nearly everyone that is active on STEEM will be able to see it.


Now, on top of that - there will be SMTs (Smart Media Tokens) available soon (similar to Ethereum's ERC20 tokens), which will allow anyone to create & fundraise (via ICO) their own token that works like STEEM, but can be set up with different parameters. For example: dtube can have their own dtube-SMT or 3rd party blogs & communities can monetise their content with its own SMT.

While I personally really like the idea of SMTs and believe that they will increase the value of STEEM - I do think that there is still something missing in STEEM.

Smart Contracts

When I first became really interested and one could say even obsessed with cryptocurrencies & blockchain-technology in August '17 - one of the major points that fascinated me, were Smart Contracts.

A Smart Contract is basically code that is 1.) running on the blockchain, 2.) executed when a specific function is called, 3.) which does something when specified circumstances are met and in addition to 4.) being visible for all participants.

And as a result - people are able to trust that this smart-contract actually does what it promises. So when a smart-contract is supposed to trade SBD for STEEM when the ratio is 1:1 - and a review of the code confirms that, you can be 100% sure that whoever utilizes that smart-contract, will trade your SBD for STEEM, as soon as the ratio is 1:1.

Now, other code which is not implemented as a smart-contract on an open-source blockchain, doesn't give that guarantee. Whoever maintains the program which has the code implemented could change it around - and you'd never really know.

I hope you can understand me now, when I say: Smart Contracts are incredible and super important.

And luckily, Smart Contracts are already available on STEEM.

Smart Contracts are already on STEEM

In the case of STEEM - the convert SBD to STEEM function is basically a smart contract. This contract will convert a specified amount of SBD after 3 Days into STEEM based on USD.

The contract currently looks like this: Code on Github

For someone like me who doesn't have a lot of knowledge in c++, the code is difficult to read but even more difficult to write.

So while STEEM currently has the ability for smart contracts - they have to be written in c++ in addition to being added to the Steem-repository, which is not good enough for app developers.

Why does STEEM need Smart Contracts?

You may wonder know: why do we need Smart Contracts on STEEM for app-developers?

Well, the answers to that is actually quite simple - but there are multiple reasons.

STEEM is an amazing blockchain (as explained in the beginning), but there are many other blockchains who are great as well. Some lack in areas that STEEM is better at and some are better in areas that STEEM lacks in. And some areas - STEEM doesn't even cover: for example 3rd-Party Smart Contracts.

This creates a scenario where app-developers might really prefer to build the app on STEEM, but aren't able to due to missing Smart Contracts and thus choose another plattform (like EOS or Ethereum).

Now, let me give you guys an example of an app, which is actually already on STEEM but would require Smart Contracts on STEEM to run even better and to be actually a decentralised app (as of right now - it's pretty much a hybrid).

Steem Monsters

We all know the genius idea of @yabappmatt and @aggroed: Steem Monsters.

It's a fun & addicting game in addition to being an incredible smart business model.

However, it is not a true decentralised game and for now, not a true alternative to Crypto Kitties.

Why? Well. Crypto Kitties utilized smart-contracts on Ethereum. Which means: all important logic regarding to Crypto Kitties were on the blockchain, implemented as smart contracts.

When somebody bought a Crypto-Kitty from another user, the smart-contract on Ethereum made sure that the owner was actually changed to the new user, as everything related to Crypto-Kitties were on the blockchain.

But it's totally different with Steem Monsters.

The whole logic with Steem Monsters: what happens when you send a transfer to @steemmonsters to buy a pack, the generation of the pack, the gifting and sending of cards - everything happens off-chain, in another database.

While all actions are broadcasted to the blockchain via custom_jsons afterwards, a separate database is needed to keep track of everything.

And that is dangerous.

A blockchain is an immutable database

A blockchain is simply said just an immutable database - which means: the blockchain-database is protected from malicious users trying to change data - e.g. giving myself an extra 1000 Steempower by changing a number.

In a normal database, whoever has access to that database, can login and change or replace data - and then use that data afterwards.

For example: If i would have access to Steem Monsters's database or server - I could simply maliciously change the data in that database - nobody would know and the program would use that data for future transactions until it would sync again with the blockchain.

I'm not sure how much destruction this would cause, since I don't know the source-code, but I hope you understand the problem I'm trying to explain.

Steem Monsters as Smart Contracts

Now, if STEEM had the capability of utilizing smart-contracts from app-developers, every card could be a smart contract and that smart-contract would have different variables: unique-code, owner, name etc.

Example

When a user (X) would want to sell a card to somebody else (XX) - another smart contract could be implemented that creates an open trade, which will change owner from X to XX when a custom amount of SBD/STEEM - in this case: 50 SBD were send to X with CUSTOM BUY MEMO.

With this method - Steem Monsters would be truly decentralised and the digital ownership of cards were safe, but right now - that's sadly not the case.

STEEM needs Smart Contracts

While I'm very much aware of the fact that the priority of Steemit Inc is currently on SMTs, Communities etc. - which is important, I do think that Smart Contracts for app-developers are crucial for the success of STEEM.

I'm currently working on a decentralised game on top of STEEM and the current framework - without custom Smart Contracts - is not a enough for something which can overshadow Crypto Kitties.

Even Custom_JSONS are not enough without any way to filter based on the results.

Example:

Lets say there are accounts in the game and I want to make sure that every account is unique. I would need to broadcast a custom_json for the account_creation, but without any direct search query (incl getting the STEEM account_history and filtering for the custom parameter account_name and variable - which isn't scalable for a million accounts game) - I would have no way of being 100% sure that the name is truly unique.

I would need to rely on an external database to keep track of all data. And that is not secure nor decentralised.

And now?

My hope is that Steemit Inc sees the importance of Smart Contracts and how a plugin/module for custom Smart Contracts would benefit STEEM - so they can put dev-hours in it. (@ned, @goldibex, @sneak, @andrarchy)

However, as they're currently very busy with SMTs & communities - we, as a decentralised community - are currently on our own.

While I'm not a c++ programmer, I do have a background in c# and an interest of looking into it. But creating such an important module requires experience - mucho experience.

So maybe there are experienced c++ programmers under us, who are seeing the importance of custom Smart Contracts as well.

And if there are: let us know!

Feedback is most welcome

What do you think about these thoughts?

Do you believe that custom Smart Contracts are crucial for STEEM?

Please let me know in the comments below!

Wolf


Sort:  

I didn't know much of this but I'm now much enlightened, your explanation is easy to understand.

I think is should it be added because besides the advantage it gives us(steem) over competitors it also brings more transparency to the system and nothing beats that in a business model like this.

I'm not personally against them ideologically, but the article kind of proves why we shouldn't do them. As you note, the really important smart contracts get audited and then coded into the blockchain, and as you also note, applications like steemmonsters (and d.tube and dlive.io etc.) exist without them. "But more decentralization must be better" is not a compelling argument to me. If it was, I wouldn't be involved in a DPoS chain. As with every decision we make it comes down to developer resources and scalability. There's a reason why we have more transactions per day then every other blockchain combined and are capable of supporting those txs. While some might think that Smart Contracts are unrelated to scaling ... nothing is unrelated to scaling.

Some of us have maintained from the beginning that Smart Contracts are overvalued, and that Bots+Private keys can get you to all the same places. And if your application really needs Smart Contracts, then there are plenty of protocols out there for you. We are an application-specific protocol. We are the best protocol by far for organizing and incentivizing content. This "simple" design is key to scaling. General purpose protocols are far more difficult to scale, especially when they are open source.

I've yet to see a compelling counter argument and the staggering lack of scalable Smart Contract blockchains as well as serious applications on such protocols is not something that should be ignored. Ethereum blew my mind when it was announced and was a serious trigger for me getting involved in the space (after Bitcoin), but that was because I wanted to see DApps. From where we're standing today Steem remains the only blockchain with real DApps and it did that without "Smart Contracts." Or rather, it did it because it has the right Smart Contracts built into it.

I think this is a good conversation to be having (it's not the first time it's been had) but for me personally, I don't think we should even be thinking about Smart Contracts until Communities and SMTs are out there and then we can reevaluate.

I have to agree with @andrarchy here. Steem + smart contracts would just be a worse EOS. Steem is an application-specific blockchain. It's like an ASIC miner vs a GPU miner - GPU miners (Ethereum/EOS/etc) can be made to do anything, but they will never be as good or efficient at the one specific task of an ASIC miner (Steem).

Yes, it means that Steem Monsters cannot be a truly decentralized application (though it can be come surprisingly close using the methods currently available), but it also means that it will be the overwhelming best option for services trying to monetize/reward content publishers online in a decentralized manner.

I think this can be summed up with a quote (I don't remember who said it):

Do one thing and do it well

Great points, the ASIC miner analogy is perfect.

Not totally sure who originally said "Do one thing and do it well", but I believe that's the UNIX philosophy / mantra, isn't it?

Loading...

I agree, I hope that after SMT the devs should work on smart contract that is easy to code with built-in editor and compiler for testing and deployment.

Start with steemmonster and extend it to a general purpose digital content marketplace , smart contracts will light a fire for marketplace model sites off of STEEM blockchain.

Some of the possible apps:
https://steemit.com/teamaustralia/@itstime/5-steem-dapps-that-should-happen-asap

Amazing and good job Nice concept and idea is great. Thanks for this new update.

To the question in your title, my Magic 8-Ball says:

Without a doubt

Hi! I'm a bot, and this answer was posted automatically. Check this post out for more information.

Steem needs airdrops as well just like EOS :)

Great post and nice ideas . Surely will SMTs succeed the steem when it is already successful . I know how to code in c++. I also have gained an idea for your post . I will suggest and share my idea here soon ..

Love to see you keep developing new projects man, I guess the success from Smartsteem allows you to have more freedom and time to work on things that you really interested in. Great inspiration from you!

Would it be possible to write smart contracts in Javascpript for exemple or they have to be written in c++?

Thats absolutely right with the Steem Monsters. For me, the Monster cards a nice and lot of work is behind for it, but the real owner is not changing as you say too. For me, it is right now only a nice picture, not more. Sorry for the developers of it, but it truly need to improve that way with steemit. After this is done, it open for lot of developers a new door. Ideas can be made and we will see for shure an rising steemit too.

Congrats! This post is featured on today's Steemit News in Chinese, by Joy.


@justyy is a programmer who dominates C++ I recommend

And as a result - people are able to trust that this
smart-contract actually does what it promises.
-- @therealwolf

Sorry, what about the famous maker-DAO problem that prompted a fork on Ethereum?

Your logic about not being able to find the custom jsons are flawed. According to you, they may not be indexed by the RPC nodes but they are still a blockchain. When a crypto-wallet like Litecoin-Core or Bitcoin-Core updates the balance, it doesn't query a balance from the other nodes. It monitors operations involving addresses or public keys and updates if there is a transaction. This is pretty much what wallet software has to do.

In Steem it is even easier because of the public RPC nodes everywhere. A light client could use public RPC nodes to call get_account_history in order to maintain state.

The rules has to be enforced by a third party. I was wondering which smart contract platform they were using. I didn't imagine they would use Steem. You might be able to drive a nail with a screwdriver but it is not the right tool, and making the screwdriver's handle heavier is not the solution.

Sorry, what about the famous maker-DAO problem that prompted a fork on Ethereum?

I guess I should have been more precise: "And as a result - people are able to trust that this
smart-contract in a state without bugs actually does what it promises."

In Steem it is even easier because of the public RPC nodes everywhere. A light client could use public RPC nodes to call get_account_history in order to maintain state.

get_account_history fetches up to 10000 objects. Let's imagine there are 1 million accounts on a game - this is not a scalable way.

I think I will be able to do something like this.

YOU JUST GOT UPVOTED

Congratulations,
you just received a 25.92% upvote from @steemhq - Community Bot!

Wanna join and receive free upvotes yourself?
Vote for steemhq.witness on Steemit or directly on SteemConnect and join the Community Witness.

This service was brought to you by SteemHQ.com

Too bad I missed this post @therealwolf... I've been working on a project that brings Smart Contracts to the Steem blockchain, but instead of running on Steem directly they run on a sidechain (which is basically a blockchain coupled to a database). The Steem blockchain is still the orchestrator of this tool as to interact with the smart contracts (deploy or execute) you need to post specific operations on Steem. In the end you get a permissioned database (because it uses the same level of authority as Steem) and decentralized (because the sidechain is just a NodeJS app that parses the Steem blockchain to perform actions, app that can be run by anyone as it is open source).

The introduction post: https://busy.org/@harpagon/steem-smart-contracts-the-sidechain-that-brings-the-power-of-smart-contracts-to-the-steem-blockchain
The GitHub repo: https://github.com/harpagon210/steemsmartcontracts