Understanding RSK-Bitcoin's Smart contract platform

in #bitcoin6 years ago (edited)

image.png

A lot of people assume that Bitcoin can't do smart contracts. People just say Bitcoin can't compete with Ethereum and is an aging titan. Well with RSK that is gone!

You might be saying, won't Bitcoin's smart contract have high fees and need a HF? Well you would be wrong.

First you have to understand how smart contracts in Bitcoin will be done.

They won't be done on a main chain instead it will be done on a sidechain.

A sidechain is separate chain that connect with the main chain. Thus allowing bitcoin to have an ethereum like system without clogging up the main chain.

RSK is a Bitcoin Sidechain — a separate blockchain that carries a "separate token" but is able to exchange tokens back and forth with the main Bitcoin blockchain. Users can move bitcoin to the RSK chain, make use of the converted bitcoin, and then eventually move their tokens back, as bitcoin, to the main blockchain by a 2waypeg(aka making decentralized bitcoin backed tokens) . Summing this paragraph off-RSk uses a traceable and verifiable process to peg bitcoin 1:1 on a sidechain

Here how they peg bitcoin to smart bitcoin. Remember 1 smart bitcoin=1 bitcoin

The 2-Way peg is a method to transfer BTC into SBTC and vice-versa. In practice, when BTC are exchanged for SBTC, no currency is “transferred” between blockchains. There is no single transaction that does the job. This is because Bitcoin cannot verify the authenticity of balances on another blockchain. When a user intends to convert BTC to SBTC, some BTC are locked in Bitcoin and the same amount of SBTC is unlocked in RSK. When SBTC needs to be converted back into BTC, the SBTC get locked again in RSK and the same amount of BTC are unlocked in the Bitcoin blockchain. A security protocol ensures that the same Bitcoins cannot be unlocked on both blockchains at the same time.

Here how the peg works right now :
When a Bitcoin user wants to use the 2-Way Peg, he sends a transaction to a multisig wallet whose funds are secured by the Federation. The same public key associated with the source bitcoins in this transaction is used on the RSK chain to store the Smart Bitcoins. This means that the private key that controlled the Bitcoins in the Bitcoin blockchain can be used to control an account on the RSK chain. Although both public and private keys are similar, each blockchain encodes the address in a different format. This means that the addresses on both blockchains are different.

Is there a problem with sidechains? There has to be a flaw to any platform,right?

Well you would be half right. There is a flaw that can be easily fixed.
Anyway let talk about it!

The big problem with side chains right now is it kinda somewhat centralized.

This somewhat centralized force is called the RSK Federation.
The RSK platform will be launched with a Federation of well-known and respected community members (blockchain companies with high security standards). Each member is identified by a public key for the block checkpoint signature scheme. The Federation is able to add or remove members using an on-chain voting system. The conditions to become a Federation member (known as Federation Member Requirements or FMR) establish basic security policies and legal requirements that all members must meet.

The Federation will provide several services to the network. Some of them will be available at launch and other will be added later. Each member can choose to provide any of the following services:

  • Two-way peg with Bitcoin
  • Checkpointing services

The member of the RSK Federation are:
Bitcointoyou, Bitex, Bitfinex, bitFlyer, Bitgo, Bitoasis, Bitpay, Bitso, Bits of Gold, Bitstamp, Blockchain, Blockchain Intelligence Group, Blocktrail, BTCC, BitKan, JAXX, SurBTC, CoinBR, Huobi, OKCoin, Paycase,Unocoin, and Xapo and more coming soon!

They are pretty trustworthy names. However Bitcoin is based on the pricicapal-don't trust-verify!

The RSK Federation job as a Checkpoint service is the most simplest to fix!
By default, clients stop using federated checkpoints when RSK hashing power is over 66% of the maximum BTC hashing difficulty observed in the main chain and the fees paid in a block are higher or equal to the average reward of a Bitcoin block. However, any user can re-configure this local policy back for security reasons.

Luckily , 90% has agreed to merge mine RSK :)

However the pegging is the hardest part. Previously, when I wrote my other RSK posts you would needed special opcodes or extensibility to validate SPV proofs to be added in as a hard-fork. And Hard Forks are really hard for Bitcoin to do....
Recently I found an alternative that can be done as a softfork.

There are diff types of side chains but the most common way is drive chains.

In the case of a drivechain, which is a simplified version of a sidechain, you need to conduct only softfork and have 1 opcode modified. This opcode allows miners to decide whether release funds in the drivechain or not every time they mine a new block.

However, the bad news is that there is an increased possibility for sabotage and perhaps theft. Groups of miners working together can 51% attack a sidechain that they mine, in order to steal any bitcoins that are locked into it. This would, however, only hurt the value of coins on that sidechain, not the original bitcoins. While this is a genuine concern, it is one that Sztorc sees as very close to the same problem bitcoin itself already has, and he claims to have figured out how to minimize the threat, through a process where miners vote to keep things honest.
Basically Miners can 51% Bitcoin but why would they? They would lose money!!! Same reason as RSK.

Read more of this soft fork here: https://bravenewcoin.com/news/can-drivechain-make-bitcoin-sidechains-a-reality/

So RSK just needs a soft fork which the Bitcoin community and Core devs "agreed" to add when Bitcoin main scalability problems are gone plus the soft forks needs testing.


Ok now we got how RSK works. How well does it process TXs and how does it plan on scaling?

RSK achieves 100-300 transactions per second on chain and confirms most payments in less than 20 seconds, while leveraging Bitcoin's proof of work security(merged mining).

Rootstock lowers it block time be using the DECOR + GHOST protocol to reduce the block interval to an average of 10 seconds, which is lower than the current Ethereum block with an average block interval of 16 seconds.

To increase scalability the Lumino Transaction Compression Protocol (LTCP), RSK will be able to process up to 2000 tps on chain! LTCP is also RSK version of Segwit. As such RSK version of the LN is Lumino Network. A combination of Raden and LN. Once the Lumino Network is deployed over RSK, it will allow up to 20k-100K+ tps off-chain taking Bitcoin to Visa processing levels(if it like the LN it would have infinite scaling).

Instead of forcing users to move contracts to a particular orphaned data partition, the Rootstock platform enables smart contracts to dynamically update specified addresses dynamically. Therefore, the entire node by dividing the transaction set to parallel transaction verification. This is a way to improve CPU resource consumption and make scalability easier for many data-processing cores at each Rootstock node.

Based on many articles RSK also plans on adding blockchain sharding techniques.

Unsure if this is likely to happen but here is my post if RSK did add it. That post might be outdated!
https://steemit.com/bitcoin/@sames/how-rsk-is-going-to-use-sharding

Another scalability feature is to make a sidechain to a sidechain(RSK) for micropayments and other Dapps.

Basically lessening the load on the main chain. Not needed yet but will be interesting to see.


Another feature to inc decentralization is to reward full nodes which many smart contracts platforms don't.
RSK proposes to share smart contracts fees with RSK full nodes as well as bitcoin full nodes.
If you run both RSK and bitcoin full nodes, you will be rewarded twice. This is the first time ever a second layer solution is contributing to the decentralization of the bitcoin network. It will give users new economic incentives to run full nodes and add value to the network as a whole. They are going to develop BIP for full nodes’ reward this year.

RSK is an interesting development in the Bitcoin world. I want to see some Dapps built on this really soon. Yes RSK is in mainnet but the tools to using it safely is not out yet. Testing is still ongoing but it will be out for everyone soon!!!

In fact if you want to test it out:

https://ambassadors.rsk.co/
They'll give you some SBTC to test Dapps on it :)

Also RSK not the only Sidechain out. Liquid is another sidechain but built for exchanges.

Read about it here: https://steemit.com/bitcoin/@sames/the-liquid-network-bitcoin-s-solution-for-exchanges

Sources:
https://steemit.com/bitcoin/@sames/bitcoin-s-ethereum-killer-rsk-co
https://bravenewcoin.com/news/rsk-federation-finds-support-from-24-leading-bitcoin-industry-companies/
https://bravenewcoin.com/news/can-drivechain-make-bitcoin-sidechains-a-reality/
https://www.coincache.net/2017/12/27/rootstock-rsk-can-bitcoin/
https://btcmanager.com/rsk-federation-tempts-major-bitcoin-companies/
https://btcmanager.com/rsk-bitcoin-based-smart-contract-platform-now-secured-by-1-in-10-miners/
https://bitcoinexchangeguide.com/rsk/

Sort:  

Congratulations @sames! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :

Award for the number of comments received

Click on the badge to view your Board of Honor.
If you no longer want to receive notifications, reply to this comment with the word STOP

Do not miss the last post from @steemitboard:

SteemitBoard Ranking update - Resteem and Resteemed added

Support SteemitBoard's project! Vote for its witness and get one more award!

Hi @sames!

Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your UA account score is currently 4.411 which ranks you at #2129 across all Steem accounts.
Your rank has dropped 22 places in the last three days (old rank 2107).

In our last Algorithmic Curation Round, consisting of 260 contributions, your post is ranked at #212.

Evaluation of your UA score:
  • Some people are already following you, keep going!
  • The readers appreciate your great work!
  • Try to work on user engagement: the more people that interact with you via the comments, the higher your UA score!

Feel free to join our @steem-ua Discord server

Hi, @sames!

You just got a 7.25% upvote from SteemPlus!
To get higher upvotes, earn more SteemPlus Points (SPP). On your Steemit wallet, check your SPP balance and click on "How to earn SPP?" to find out all the ways to earn.
If you're not using SteemPlus yet, please check our last posts in here to see the many ways in which SteemPlus can improve your Steem experience on Steemit and Busy.

Coin Marketplace

STEEM 0.30
TRX 0.12
JST 0.032
BTC 60609.50
ETH 3014.13
USDT 1.00
SBD 3.90