Posts

Virtual Smart Contract: Bringing Smart Contracts To Hive

avatar of @taskmaster4450
25
@taskmaster4450
·
·
0 views
·
5 min read

We recently got an announcement of the building of a smart chain system for Hive. This is an exciting step and one of a number of projects of this nature that is taking place.

Virtual Smart Contract (VSC) is a layer 2, sidechain, to Hive. This will provide smart contract capabilities while being tied to the main chain.

In this article we will dive into the particulars of the system.

Target Markets

The target markets of the system and what will be the focus of support are:

  • games
  • NFTs
  • multi-sig contract needs

Developers who are interested in these areas for their projects will find VSC to be able to provide decentralized smart contract needs.

Node System And Horizontal Scaling

The goal is to have each smart contract supported by 50 nodes. There will be multi-sig of nodes for each contract. This is a Javascript based VM, at least to start, as compared to EVMs utilizing Solidity. Eventually, the VM could be upgraded to include other languages such C++.

This is a separate node system from Hive. The transactions on VSC are run off chain and utilize IPFS for storage. Hive serves as the anchor chain with the IPFS hash being placed on chain as a custom JSON. Here is where the immutability of Hive is important. Once the hash is recorded, it will not be removed from the database.

Scaling can occur since not every node in VSC is required to run every contract. Nodes will determine which ones they want. It is likely that a smart contract could be designed and then a node system set up around that.

Here we see the ability to keep scaling both in number of nodes and contracts. Ethereum and the associated forks has all smart contracts running on each node. Adding more nodes doesn't scale directly since it is simply running a duplicate copy of the same data.

We can think of this in terms of vertical versus horizontal. With EVMs, all new contracts are stacked on top of the existing nodes. With VSC, news nodes can be added as more contracts are added.

How It Works

A user engages with a smart contract application. When a transaction takes place, the user pays a fee (more on this below). The validators process the transaction according to the contract. Once validated, it is put into IPFS and the hash posted to Hive.

The full settlement occurs when the Hive witnesses make the block the custom JSON is located in irreversible (on average 1.6 seconds).

This removes the heavy lifting from Hive and places it off-chain. Over time, a network of this nature can enhance the scalability of Hive as more is processed off-chain, leaving the most vital features to the blockchain.

Advantages

Most are somewhat familiar with the EVMs. There are some constraints to that while VSC brings advantages.

EVMs are a constrained environment in that memory is restricted which makes advanced functions difficult It also uses specific APIs.

VSC:

  • can offer a large database of records without much cost
  • query all databases providing robust search
  • create more complicated technology
  • streamline lower level protocols and provide standardization for things such as NFTs

In short, VSC can replace the back end operations for many projects helping to reduce costs and running them all through a smart contract.

Hive Backed Dollar (HBD)

VSC uses the Hive Backed Dollar (HBD) for all transaction fees. When a user engages with a smart contract, he or she has to pay a small amount of HBD. This is no different than paying ETH or BNB when using the contracts on those chains.

To start, the system will mirror that. It will be on a per transaction basis. The fees are the incentive mechanism for the node operators.

This is a major use case for HBD. To start, it means that each node and user will require a Hive account to interact. While the applications are free incorporate whatever sign up they want, the system requires a Hive account to make payment.

Of course, gets us back into the world of transaction fees which is "unHive-like".

Resource Credits And Hive Savings

On the road map is to development payment similar to resource credits. If this gets developed, the idea is to give people to option of paying on a per transaction basis or, for a discount, utilizing a RC-like feature.

With the latter, a user would stake HBD. Just like Hive, this would provide a certain amount of credits, i.e. activity. It would replenish each day, meaning transacting was not a direct expense. Users would stake HBD based upon individual needs.

The per transaction cost would be less using this option. A choice is given to the user how he or she would want to engage. For example, one might not use the system often, hence making a direct payment on one or two transactions could be a better option.

Here is where Hive's tokenomics can be applied. Staked coins cannot be used for payment. So how is this accomplished? The system simply places the HBD in savings, generating the 20% APR. This is used to pay the node operators. Perhaps there is a splitting, where a couple percent goes to those staking. The point here is the node operators could be paid from transaction fees and from the APR created from savings.

Hive Benefits

There are a number of benefits provided to Hive:

  • multi-sig smart contract available for developers to build games and apps
  • HBD as a medium of exchange for transactions
  • virtual machine capability that can replace back end operations
  • inexpensive nodes
  • possibly locking up a large amount of HBD to fund the nodes

Roadmap

  • build and test subsystems (going on right now)
  • build a basic model of network
  • build more advanced capabilities
  • tackle larger challenges such as multi-chain capability

A DHF proposal is going to be submitted, targeted for June or July. To provide that, a working model is required. That should spell out the time frame.

While it might have restricted functionality as compared to the roadmap, this system is slated to be operational before the end of the year. In fact, the target is to have major upgrades made and be live by Hivefest (roughly November).

For more information:

Discord server. @vsc.network @vaultec


If you found this article informative, please give an upvote and rehive.

gif by @doze

logo by @st8z

Posted Using LeoFinance Beta