New Ethereum talks, every Monday. The week's conference uploads by event, in your inbox.

Loading player…

How to Earn Money Building on Soroban by Tyler Van Der Hoeven

Ethereum DenverMon, Oct 9, 2023, 12:00 AM

How to Earn Money Building on Soroban Tyler van der Hoeven Ecosystem Engineer Stellar Development Foundation Tyler van der Hoeven directs ecosystem engineering at the Stellar Development Foundation. From creating industry leading educational and funding initiatives to pioneering NFT experiments Tyler has deep interest and experience enabling success and fostering innovation in modern decentralized finance. https://twitter.com/tyvdh

Transcript

my name is Tyler vanderhoven I'm an ecosystem engineer at the Stellar development foundation my job is kind of this top of funnel to build educational programs initiatives to onboard developers into into stellar 's been around for a long time since about 2013. it's one of the older l1s most of you probably have never heard of it though or Evolution's never written code for it right uh traditionally non-turing complete there's only about 22 operations you can do on on classic stellar but within the last year we've started adding smart contract functionality on tabos Delta we've kind of taken our time waited a little while try to learn from the industry things that have worked what hasn't worked to really make sure that the smart contract protocol that we build this Turing complete programmable money has the best chance for success and that's what I want to get into today kind of your opportunity as a developer engineer maybe somebody is building a design firm or development firm interested in getting into web3 we've got got a lot of money to give away for this adoption this onboarding into sarobon so what exactly is sorobon soroban is a touring complete smart contract protocol they're adding alongside the seller blockchain so it's not a new blockchain it's kind of extending the functionality of what we're calling classic stellar so all of the assets all of the value usdc the stocks and bonds all of these real world assets immediately become available on top of this new smart contract protocol cerebon so we're still in testnet uh we'll be launching on mainnet later this year so what I'm proposing to those in the audience is really to see an opportunity to build on a new smart contract protocol Santa help work on developing it getting it exactly the way that you're you would like it things that may frustrate you and other smart contract protocols having the opportunity to form something new so we have a hundred million dollars and right now we've got these three primary opportunities for getting involved the first is if you're new to Russ is a rust wasm based smart contract protocol so if you're new to that this top one here fast cheap and out of control so we want all of our smart contracts to be right great place to learn rust learn how to build on top of a smart contract to really think like a smart contract developer building contracts that are fast that are cheap that are very innovative out of control as I like to call it we also have sorobonathon which is this uh program platform for those that maybe aren't going to be entrepreneurs they're not going to start a company but they're very interested in developing uh like proof of Concepts white papers open source uh apps but maybe they don't want to carry it on maybe they're just experimenting maybe they want to do a comparative analysis between uh wasm and the evm or some of the other wasm based chains just kind of your opportunity to play and then last but definitely not least is the seller Community Fund where you have the opportunity to actually launch something that maybe Will Survive and last a little while this is a grant program of upwards of 150 000 kind of No Strings Attached just build something ship it keep it alive see how it goes this is the website for fast cheap and out of control one that you'll want to write down if you're new to rust new to wasm this is a fun programming challenge if you're an engineer it's quite challenging but it is a lot of fun next one sorobana Sora bonathon that's the website for that and then also the uh the Stellar Community Fund so hopefully you're interested but you might like to see a little bit of code my my goal here is not to impress you necessarily with our smart contract protocol I'd like to get you in interested willing to open up a the documentation to play around maybe write your first smart contract um but let's be honest smart contracts aren't new we're not doing anything terribly outrageous I want you to get in there and decide if you like what we're building but I'm going to walk through some of the code and some of the unique decisions that we've made as we've been building it and if you remember nothing else from the talk make sure you remember sorobon.stellar.org this is our documentation site and we'll go ahead and get into uh some code here with uh with a simple hello world application again this is it's all going to be written in Rust one of the nice things is that if you learn sorobon rust you're learning just rust there's nothing fancy there's no weird crates going on if you learn Russ through soroban you can take that rust and take it anywhere any job that involves rust it's rust on the back end rust on the front end rust in your tests it's just rust this is a basic hello world contract very very small compact I mean let's be honest it's a hello world it's not that crazy one thing you'll notice if you've written Russ before is we're excluding the standard Library this allows our contracts to be very very small by default you're only going to be importing those things that you absolutely need it's a very intentional design decision that we make We Care a little bit less about everyone on the planet being able to write smart contracts and more that every smart contract that gets deployed is small it's cheap it's secure those are the things that we're focused on again we're late to the game on Smart contract protocols so we're going to get it right here's a test just a rest test nothing on this is happening necessarily on chain you can do all of your development all of your testing because our actual uh protocol on the back end that actually runs these smart contracts because it's also written in Rust you can load up this environment this environment variable here on line eight is the actual sorobon environment so you can run tests as if it was running directly on chain you can backfill the environment with any kind of state that you want account systems again rust on the contracts and rusts in the test as well building out those contracts you just build it with cargo same you would with any other rust type program we compile it down to a wasm binary that you can then deploy as your as your actual contract so that's all very cool um well let's kind of move Beyond just a hello world example and move into uh some cross-contract calls we just built that contract that we did before and this is how you would import that interface into another test you can see this isn't even another contract it's just another uh another test so as if your tester your you can write these uh these contract demos as you as you would just right inside of a test very simple to experiment with you can pull in other wasm files other binaries other cross-contract calls pull that into your contract and then call it just like you would any other import again this is an example of if we pulled in that hello world as a cross-contract call so that's cool um but it's still hello world you can see if we run that test just just a rust test do all kinds of uh complex unit tests or integration testing the next thing I'd like to do though is actually do some token Imports remember I mentioned that this isn't a new blockchain right we're not bootstrapping liquidity we're pulling all of the stuff that we have in in Stellar straight into a smart contract protocol so let's do that real quick right Stellar's native token is xlm and we have this sorobon token spec which is a a smart contract that's actually uh native to the sarobon Stellar side which will allow us to import any asset that's in Stellar directly into our smart contract protocol sarobon so you can see we we just import that as a token interface and then down here in our new faucet function we can make use of that token interface down on line 26 where we're going to do a transfer off of that token client we pass in some arguments from address to address and an amount there on 18 19 and 20. so that's that's a very small little function but allows us to do a very powerful thing where we're making use of assets that are directly on the Stellar side you can see there's the uh there's the import for that token interface it's a very similar interface to an erc20 interface there's that faucet function again you can notice something interesting on line eight but we're doing a require auth it's one of the there's quite a few of these unique and interesting things that sorobon is doing and one of them is kind of Reinventing rethinking how authentication Works inside of smart contracts where we don't just borrow from whoever signed the contract and submitted it you can actually do explicit multi-sig or do authentication off of the arguments the address arguments that are coming in from your actual function so in this case we're going to require auth from the from address you could also require authentication from the to address and kind of compose these relatively complex authentication mechanics without having to borrow from the signature system from the contract that was actually submitted which is quite interesting and unique not much else is happening in this particular contract we're just exporting an argument of the new balances between [Music] um those two uh addresses the from and the two address here's our test just another rust test looks very similar to what we did before spin up some demo addresses down on line 15 we'll give them some some native amount some native currency to pass back and forth so that when uh when we call that faucet function down on line 20 we actually have some of those native currency to pass back and forth that's cool but it's still not happening on chain this is just happening in a rust test so the next thing we really want to do is build this build this function out and then deploy it onto our our test Network so that we can actually see this happen all on chain with our our sorbon CLI so we build that next we're going to open up our CLI we're going to generate some addresses there at the at the top and then right there in the middle we're going to get the public keys of those addresses and then the last three because this is actually um bridging is it we're kind of between classic stellar and the soroban side we need to actually fund these addresses on the Stellar side an account does not exist as an account until it actually is is funded and on chain so we're going to need to do that on the Stellar side so that we have some value to actually move from the seller side and show it over on the on the sorbon side so that's what's happening here with these curl requests is we're calling what's called friendbot which is kind of like a faucet which will give us um 10 000 xlm on each of those accounts as we call them so later on when you see a large number a large balance um Stellar has seven decimal points so that's where that's going to come from we're only going to be moving 10 of the smallest amount in the soroban side well you'll notice that we're not going to be doing any wrapping we're not going to be any exporting or importing of assets if you have it on the Stellar side it shows up on the soroban side we're going to add a network to our configuration is one of the nice things with the sorobond CLI is you can kind of create these identities and networks just makes working with the CLI a little bit easier say we're setting up our RPC and our passphrase for the what we're calling our future network all right so then we take our sort of on CLI and we deploy this this contract that we built and we get at the very bottom that's our contract address now we're going to invoke it we're going to first invoke the function the hello function which took in the argument of the two string and we get out the output hello world but that's not what we're trying to do we're trying to do the um the faucet function so exact same contract ID and now we're going to pass it in the from address that we we called or we built up the two address we're going to send 10 from soroban and you'll notice down at the bottom those really large numbers and then at the on the right hand side you can see the 10 then the minus 90 over on the left hand side the large number is is because of that future net that we called to get the the 10 million of the smallest amount that's seven decimal but then that 10 on the soroban side was moved and you'll notice again we're calling this on the sorobon side the smart contract protocol we didn't have to do any wrapping or exporting it doesn't exist either on Stellar or on sorobon it exists on both simultaneously because again this isn't a new chain we're getting access to all of the assets that are on the Stellar side for free uh immediately on the soroban side but again this this blows my mind that you can have a chain that has so many assets it's being used for real world use cases it's always kind of been locked you you haven't been able to do whatever you want because we didn't have Turing complete smart contracts but now we do and now we're just looking that up we're doing another curl request this is looking up on the Stellar side that that balance of the the two address and you can see there the decimal point there on the on the far right side that was those 10 Micro units that we passed over from the soroban side so both on the soroban and the Stellar side the balance is the same all right fantastic well I'm we could definitely get into a lot more I'm very excited personally um I've been building on blockchain since early 2017.

and uh to be able to have a stable real world chain it's been around for so long but didn't have that Turing complete functionality to now have that I'm very excited and so I'd like to direct you again to these these three different opportunities whether you're a builder or you have Builder friends or you're looking for an opportunity you've got an idea and you want to band together you've got these three different opportunities to learn kind of experiment and then also to build startups or uh or full-fledged experiments again the thing I'd really like to leave you with is that sorobond that's still it or this will be our documentation this is going to be our router to all of the other opportunities documentation the fast Jeep and out of control sorobanathon and the Stellar Community Fund so make sure to write that down go poke around with it play we've got a great Discord Community to answer questions it's really a a wonderful opportunity if you've ever been frustrated building on Smart contract protocols before you have an opportunity to not build a new one necessarily right this isn't a new blockchain but to get access to a lot of really valuable assets and now add Turing complete smart contract functionality on top of it thanks so much

Automatic transcript — names and jargon may be misspelled.