SKALE Labs 🛠How to Deploy on SKALE and Learn About Some Cool NFT Features
ETHGlobal·Sun, Oct 9, 2022, 12:00 AM
Join Chadwick Strange of SKALE Labs for a workshop titled, "How to Deploy on SKALE and Learn About Some Cool NFT Features." This workshop is part of ETHNewYork 2022, a three-day in person hackathon that will feature hackers, mentors, enthusiasts, sponsors and speakers who are all gathering in New York June 24-26, 2022 to talk about the future of money, finance, the web, ownership, the way software works and the way power is distributed. We're excited about a new frontier. ---------------------------------------------------- Follow us: https://twitter.com/ETHGlobal​ Check us out: https://ethglobal.co​m Email us at: hello@ethglobal.com
Transcript
[Applause] [Music] good evening uh welcome to room one um you're in the right room thank you thank you [Music] you're in the right room if you're expecting to hear a talk about how to deploy on scale and some wicked cool features that we'll explain that's available on skill chains at this hackathon so let's get to it welcome to new york uh if you're native here it's awesome you're a visitor i love this city i really love the youth global events uh one of my last favorite hackathons was east amsterdam and a couple years ago eath new york in brooklyn so i'm so excited that we have such great weather and such a great venue so thank you youth global organizers for setting this up um really pumped about this weekend i love hackathons they're dear to my heart so i'm really excited to kick off this weekend for a lot of fun and building some cool stuff um by way of introductions my name is chadwick strange i'm head of product at scale uh i've been with scale since 2018. this is my third venture in the web3 space before this i was working in a completely different industry pharma and biotech and i got a reality check that i was in the wrong industry and found my passion in web 3 and it was at a hackathon in berkeley california where i basically subjected myself to much like yourselves trying to learn new things trying to build cool stuff was up late at night till like 2 a.m i'll never forget one of the sponsors that who was there like 2 a.m to 4 a.m helping our team trying to deploy a contract we worked really hard we had no sleep the next day we submitted the project did not work it partially worked um but people got it people got the vision people got the effort and uh our team won second place and that started my foray into this space that i'm super passionate about my last name is strange and uh i want to give a shout out to rob our social media manager who created this meme from doctor strange uh so the marvel studios dr strange multi-chain of madness and i'll go into multi-chain in a bit all right to set this up for the agenda for this session i'm going to first talk about skill network i'm going to give a high level overview kind of going deep in certain areas i'm sure some of you might have heard skill network um maybe you don't know anything about skill network so we'll start with a high level explaining what it is and then i'll go into detail about how to deploy on scale then i'll walk through some really cool features that are not only great for adapt developers but they're great to help out build out incredible dapps i'll walk through that i've got some video demos just to truncate the time so i'll scroll through that and i have a really awesome live demo at the end so praying to the wi-fi gods that i'll still have access and bandwidth to do this live but we'll see live demos are always tough um and then i know you all are here to build and there's not a lot of time to build you're thinking about ideas so i'm gonna actually walk through a cheat sheet about how best to position your team for success in building on scale and showing off scale on your project so i'll walk through how to really win what are the tips that i can give you to work really fast and to integrate in your dab and how can you position yourself best to win skill bounties all right let's get into it so what is the scale network network is the first multi-chain ethereum native scaling network there's a lot to unpack here let's start with ethereum native the entirety of scale network is architected and built on top of the ethereum main net and what does that mean the entire network nodes represented by these lovely dots on the left side of the screen run by validators these are skill network validators when they register with a network they're registering with skill manager on ethereum those are transactions that exist on the ethereum main net when you request a skill chain or do any network operations those are also transactions on ethereum mainnet and that's really important because the scale network uses the pooled security of ethereum validators to help support the network so as validators are joining as validators are providing or getting stake in delegation that's all secured by the ethereum validation layer um and then extended through the unique security features of scale network and so we have over a skill network has over 160 nodes currently connected to the production main net and as adapt developer when you request a skill chain and again that's a transaction that exists on ethereum um scale manager handles that transaction and says all right how do we provide a scalable blockchain for this app developer it will go into the the skill network will go into the node so we'll select 16 nodes at random and it will send an event to those nodes and tell those nodes hey build a or provision a scale chain and these nodes will spin up a dockerized container these containers are networked together and that basically encompasses the adapt specific blockchain that you use to deploy your dapps and have all your users or community transact with one of these nodes let's take a look at this i'll do this very briefly but a node again run by a skill network validator is a bare metal that runs skill node software at the core of this software is a python script that is listening and transacting with the ethereum mainnet it's listing for inbound messages about whether a skill chain has been requested the other part again that's the core the inner diamond the outer part of this hexagon kind of it's an abstraction representing the other available compute resources on this node and that's available to basically containerize or provide scale chains of various sizes and various numbers so a single node can support up to 16 individual skill chains that's a very powerful system and then as a shout out to some of our validators we're working with a lot of validators that also validate for a lot of other networks especially ethereum so these validators have been really great in helping support build out the skill network and help onboard skill network partners so you can think of scale network as a network of dap specific blockchains represented by these circles surrounding these nodes so any node can support multiple dap specific chains and these change are very special because they have very fast finality and that's due to the consensus and cryptography technology that skill network has combined they run very fast about up to 2000 transactions per second you can really throw very interesting contracts at this so it runs full state smart contracts it comes with a native file storage layer comes with a native random number generator endpoint that allows you to help develop contracts and have a really solid source of entropy and it comes with a native expandable bridge which is a really incredible bridge that allows tokens and messages to be exchanged or transacted with any skill chain and with any ethereum network chain and they're adapt specific because as adap if you're building a game or if you're building a marketplace you have the full resource capacity of this chain you're not sharing resource capacity with other chains we all know what happens on a single chain like ethereum if there's a huge game or airdrop gas fees go through the roof the chain slows down your dap slows down along with everyone else on scale this does not happen it's a containerized individualized dap specific resource that's dedicated to your dap your contracts and your community and this can be shared at least to you or maybe your project or even open to like a dao community to allow a dial members to be able to transact deploy contracts and build really interesting stuff on these chains with a multi-chain architecture with the mini dab specific chains that can be deployed on skill network we can kind of think or the network has evolved to create these new abstraction layers and they can be called scale hubs and dap specific chains at the bottom you can think of these dap specific chains as individual projects either running a game or running a metaverse a music streaming app whatever it is and each of these apps might need services for example for a game you might need a liquidity layer or some liquidity on-ramp uh if you're a metaverse you might need the resources of a marketplace well a marketplace can exist on its own separate chain and on your adapt specific chain you can connect to these hubs as service layers so if you're building a play to earn game you don't need to build a marketplace on your chain you can use a marketplace on another chain and be able to connect chains together using the native token bridge which allows very fast exchange of messages or tokens between any of these hubs so again as a play to earn game you can get liquidity from one of these hubs you can send your nfts to a nft marketplace and then sell them on the market so in this way these hubs provide services to multiple chains on the network this is an extremely powerful abstraction that is really interesting because the scale network partners have really galvanized around this and decided to build communities of liquidity hubs and nft marketplaces where it's sharing amongst multiple marketplaces and liquidity on-ramps all right so that was the introduction for scale network skill hubs the technology the nodes the dap specific chains what can you do on scale one of the key features is every single dapp specific chain provides gas free transactions with a free gas token called s fuel that's right when you deploy a contract when your users transact they don't need to worry about gas fees they don't need to worry about exchanging eth to get something done with s fuel again this is when you create a skill chain you're provisioned a huge amount of s fuel as a skill chain owner that you can allocate or provide out to your users so long as your users have s-fuel they can conduct transactions so this is also a unique way where you can control or basically uh provide a system where you can onboard your users and sort of modify or customize their onboarding behavior so as users come on for example maybe they create an account on your on the dap they can be provisioned s fuel as and then they conduct then they conduct conduct transactions after they conduct a transaction spend their s fuel they can be topped up through contracts or through faucets or through other mechanisms and the reason why there is a gas token is to prevent ddos attacks so no single user could just slam the chain with transactions and this way every single skill chain owner can customize the onboarding process and user behavior through their user journey skill chains come with a massive block gas limit 160 million this allows some really interesting design patterns that you can do with solidity contracts typically on other chains you would have to gas optimize your contract make sure it's not too expensive on scale since there is no value of gas you can really pack a lot into the logic of smart contracts and do some amazing things like combining machine learning models with smart contracts that would be completely cost prohibitive on any chain where gas is an actual economic value file storage every single chain comes with a native file storage layer so uh you could use other file storage systems but how nice it is if you're deploying an nft game or a marketplace and those visual assets or image assets or video assets exist on the same chain as those nfts and that that those files are redundantly stored across the multiple nodes that support your chain and i'll show a demo of this so again if you upload nft assets those images those jsons can be stored natively on the same chain that those contracts are deployed onto you can even use it to host statically generated websites and serve that over the web uh every single skill chain comes with a random number generator endpoint leveraging a key architectural technology of bls threshold signatures to drive the entropy for random number generation and i'll give a quick example of how this works and this is great because now you can use this to gamify things you can use this to maybe randomly select a tie vote for some dow proposal or you can use this to drive some unique aspects of maybe on-chain svgs and creating some unique uh minting properties of nfts and as well we have an ima bridge i'm not sure if enough time to go into this but let's see how we go so let me get to the first demo this is just a quick pre-recorded video of how to deploy a website on a skill chain oops one second oops let's try that again so i'm going to create a very simple project here um let me skip ahead a bit i'm going to pour it in environment variables which includes my skill chain owner address my private key as long as as well as the skill chain endpoint and i'm going to pull in the file storage.
js package which allows me to interact and do upload delete create directories with the file storage layer on the skill chain itself and then i'm going to create a folder that will host a really basic html website very simple html boilerplate i'll skip ahead i'll create some css and then i'll do is i'll create a file storage uh script for uploading so this is pulling in the file storage.js library it's going to hit the directory that i put those html and css files it's going to iterate over those files and file storage.js will take those files cut them up into chunks it will actually push that as transactions directly to the skill chain itself in the skill chain we'll see those transactions realize that they're for file storage construction and it'll recreate that file on a native file storage partition on each of the 16 nodes so that's what's happening right now at least in the video i'll skip ahead and i'll go to my browser and the other key thing is great you have a file that's stored on these nodes we also have there's also an nginx server on each of these nodes so now you can serve those assets over the web so in brave there there we go i've just served this static website by uploading files directly onto the skill chain itself so not only can you create assets that drive your nfts and have nfts reference assets on the skill chain you can create a whole website that's decentralized across your skill chain let me go back okay next we'll look at the rng endpoint i'll kind of hurry this up i actually won't go into the demo because this is pretty simple i'll go into how you get the information for the hackathon but this is our documentation portal under develop we have a bunch of tools here and right here using the rng endpoint i'm not going to go into details but you can look this up later but this function here this get random function basically calls a very special pre-compile contract that's deployed specifically on skill chains only and this grabs the glued threshold signatures that are used to sign every block onto the chain and it generates a hash of that and that's returned as a bytes32 hash that you can then use to generate your render number generator so it's very easy to implement you copy this paste it in you can as soon as you hit the skill chain you'll be able to create these random number generators or random numbers and we go back um i am a bridge i won't have time to show the entire video but again for docs right here on the main page ethereum to scale bridge this contains all the information to get started with transferring tokens between chains at this hackathon you'll be able to transfer tokens between rinkaby and scale as well as the two skill chains that are available for the hackathon so you can do scale to scale transfers of erc20 721 lem 55 and you can expand this to any arbitrary contract the other key thing about this bridge is it's very fast on production networks the finality between one chain to another chain is 18 seconds that's absolute finality there's no challenge period um it is it is final when that transaction happens it's very very fast and let's get to the on-chain svg demo i did this quite last minute this week so we'll see how we can get through this let's see i'll show you briefly the contract i created the reason i wanted to play with this is i love what people are doing with on-chain svg i think it's super cool and i think we just hit the tip of the iceberg of what can be done with on-chain svg so i've created a strange token and i've created this simple mint function so it's minting incrementally this is an erc721 i want to kind of show not on 1155 but actually minting multiple of these on a skill chain itself i'm creating an svg for the token uri i'm using the get random function so i'm using the randomness for every block to help modify the svg in place and here we go um here is my svg so i have this massive svg with three circles and the components of this circle are being randomized uh using the random number generator so an effort of time this is already deployed on a chain that's live right now so without further ado i am going to go ahead and mint this live i'm not going to do a thousand i've actually trimmed it back i'm just worried about the wi-fi well here we go so the the tokens already uh deployed onto the chain of the erc721 contract and now it's going to go through and just mint 100 of these and it's going to hit the skill chain and i have a block explorer here and it might not refresh as fast with the wi-fi you can see a bunch of transactions are hidden into the chain are being minted we have contract call if we go back here the mint is still happening boom just let this finish it's finished minting 100 on-chain svgs using the random number generator let's take a look at one of these let's see here so as you can see i'm using remix so i can easily use remix or any other web3 tooling for a skill chain and i'll pull up i think token 105 was the most recently created maybe 401 that makes yeah let me check injected web 3 let me refresh stuff i'm trying to read this from this monitor here it's not the easiest let's see and then one second and uh there we go i'll do let's see here there we go not sure why this is not pulling up i don't see that file on the screen anyhow if you come by later i'll show you this live but it will display in browser the on chain svg of three circles every single mint is slightly different and that's all done live on a skill chain itself i'm surprised i got that far in the demo with it without it breaking so without further ado let's continue on the journey there are many partners building on scale what things are currently building on scale lots of games brock ballers uh a lot of people love their stuff it's like an on-chain uh rpg uh live on scale we have a lot of other games that are going live or building currently on scale along with some amms decentralized exchanges as well as some interesting apps like a name service where you can buy a name service across multiple blockchains it's using make making use of file storage to actually store a mapping database of those names cross chain as well as a decentralized e-commerce and nft marketplaces so all across the board many applications to use and deploy on scale the cheat sheet the requirements to earn skill bounties at this hackathon is simple deploy on a skill chain my recommendation just to help everyone else out is to document scale use in your github dev post and in your presentation we love to just see how you're using scale and explain that in the presentation itself and in order just a suggestion in order of the ease of how easy it is to earn these bounties first thing deploying on scale super easy any project can do this just get an rpc endpoint i'll show you where they are it's the easiest thing to do the next thing of greater difficulty probably only take five minutes integrate an rng endpoint you copy that function put it into your contracts when you're deploying that on scale you'll be able to make use of that rng function in whatever you're building for various features the next tier of difficulty is file storage it's very easy there's a npm library that allows you to do these upload operations maybe you can host your entire presentation on the skill chain itself host all your nft assets who knows go crazy uh and then the next thing is the ima bridge we have a lot of sandboxes code samples uh js libraries uh it's a little bit more nuanced but we've had lots of people have a lot of fun building on the bridge and making some really cool stuff at hackathons so i encourage you to go all the way down this list but if you're prioritizing time this is what i'd say to go through um we have twenty thousand dollars in prizes to give out five thousand to a grand prize 8 000 to a metaverse gaming nft 2000 to a partner integration such as live peer at the graph and a pool prize of five thousand dollars shared amongst everyone who at least deploys onto a skill chain themselves uh so thank you you can scan this qr code this will get you all the information that you need for getting a skill chain itself and i'll show you what this page looks like this is the faucet hackathon page so you'll get all our docs here if you click this hackathon link right here this will give you a page that looks like this these are the two two skill chain endpoints that are available at this hackathon if you click this it will drop down you have your https websocket endpoints a file storage endpoint so you can hit this put this in the browser see and serve those files over the uh over the internet you have your chain id you can click this to add this network to your metamask there's a block explorer these two chains have ima natively deployed they're connected to rinkeby they're also these two chains are connected together so you can transact tokens between these two chains uh and then back to that prior page um there's a little bit of nuance about these chains at a hackathon on production there's a configuration that not only certain deployers can deploy contracts to the skill chain here anyone can deploy just to make it easier for the hackathon but every single user who deploys needs s fuel so this is a quick faucet how this works out of the one out of the two endpoints just copy paste the endpoint in here paste in your public key address hit the s field and you'll account will be allocated s fuel as well file storage you need to reserve space to upload certain files otherwise we people would dos the file storage layer so we have very similar s fuel a faucet to reserve space and there's some quick faqs and tips just below here if you have any questions find us at the booth we're here all night all hours we're often here very very late hours to help hackers so stop by engage with our team our booth is downstairs thank you very much for listening thank you
Automatic transcript — names and jargon may be misspelled.