A sneak peak at the VSC Smart Contract SDK

in #vsc2 months ago

image.png

A sneak peak at the VSC Smart Contract SDK

Greetings Hive Community! Given the VSC testnet is coming online very soon, we'd like to share some inside knowledge about the development tools we are building. A large part of VSC is the ability to build open & customizable smart contracts, to make this job easier, we've build a dedicated smart contract SDK which contains many common utilities & tools. Aside from our own smart contract library, did I mention you can create your own custom libraries as well? You absolutely can! More on that in the future!

While we are still a few weeks away from prime time of the testnet, we want to give you a bit of an overview of the SDK & what to generally expect.

Upon opening the SDK docs, you should immediately see something like this:

image.png

The above directory tree gives you a listing for all the various components and utilities the SDK has to offer. Some of which is very common tooling, for example Base64 encoding/decoding and hashing. However, there is also VSC specific functionality such as the db API and TxOutput. For the db API, it gives the ability for a smart contract to retrieve and save permanent state onto IPFS. This gives smart contracts plenty of offchain storage to work with. TxOutput on the other hand allows you to specify what your smart contract will return to the user aside from what the contract permanently stores. This can be things like whether the contract execution was successful or info about the operation itself.

All of this will be heavily documented through this documentation portal & various tutorials/exampels.

image.png

By using the left sidebar, you can also sub select a specific utility. Such as Base64.decode in the above screenshot. There is also a small example usage attached to help clarify usage and type definition.

Using the smart contract SDK is easy. Simply install it as an NPM library by running npm install @vsc.eco/sdk and import it as the following within your smart contract.

image.png

Please keep in mind this is an Assemblyscript library, and not typescript/JavaScript, it will only work with VSC Assemblyscript smart contracts.

While it's too early to detail everything that is in store for the SDK. We are planning to provide the following:

  • VSC specific APIs
  • Common data manipulation functions
  • Cryptographic functions such as hashing, asymmetric cryptography, math functions for creating & verifying zero knowledge proofs.
  • Bitcoin utilities for parsing and verifying Bitcoin data types
  • APIs for working with Hive accounts & on chain transactions
  • [placeholder] You suggest what we should work on next!

All of this is available at https://vsc-eco.github.io/sdk/. However, it's still not quite ready get for

Ending Notes

Finally, one of our main goals with this project has been to streamline & create high quality documentation to onboard developers & users alike. The SDK is only one part of this effort, we are also working on a contract template that will give developers a ready made kit for developing, testing, and deploying their smart contracts. If you have any further questions, drop them below and we will clarify as soon as possible.

For more information about VSC. Check out our website at https://vsc.eco

Sort:  

Exciting times! !WINE

This is awesome. Looking forward to what the community builds with it!

Hi. I'm a little bit out of the loop. How close are we to decentralised bitcoin holding on Hive?

Testnet is coming online soon, and shortly after we can complete the contract work for Bitcoin wrapping then after some testing we should be ready for launch!

I'm very happy to see things come together. My wish to see some Wasm DAPPs on HIVE that anyone can code in a program language they are familiar with. I know I will have to wait. We could first start selling ourselves as a better alternative to Lightning Network. Best of Luck!
!PIZZA
!LUV
!CTP

PIZZA!

$PIZZA slices delivered:
@vimukthi(1/5) tipped @vsc.network

!pimp
!pgm
!lolz


You must be killin' it out here!
@thgaming just slapped you with 1.000 PIMP, @vsc.network.
You earned 1.000 PIMP for the strong hand.
They're getting a workout and slapped 1/3 possible people today.

pimp_logo


Read about some PIMP Shit or Look for the PIMP District

Does refusing to go to the gym
count as resistance training?

Credit: marshmellowman
@vsc.network, I sent you an $LOLZ on behalf of thgaming

(1/10)
ENTER @WIN.HIVE'S DAILY DRAW AND WIN HIVE!