Why Ethereum matters for developers with Austin Griffith
ETHGlobal·Fri, Oct 9, 2020, 12:00 AM
Speaker
Why Ethereum matters for developers with Austin Griffith from the Ethereum Foundation
Transcript
good to go okay so hi I am Austin at aetherium so and it's just basically at Austin griffiths if you want to follow me on the social so what I'm focusing on is education and automotive new developers bringing in guys that are maybe web to savvy but maybe not web three savvy yet and kind of you all had the moment that brought you into aetherium that sort of goosebumps moment but it probably meant you had to dig through a white paper and get way deep into the rabbit hole before you know the goose bumps moment happened and you realized how powerful it was so my plan with eath build is how to have this educational workbench that I can use to sort of show people the way to the rabbit hole without having to go through white papers and stuff like that so ii thought build you can just oh i'm at local house right here let's see which one should i run on but just let's go to eat build so if you just go to eat that build there are there are a few lessons already that i'm working on and if you hit load it'll bring the lesson in for you but let's just kind of go through so you know the the i think the the the first building block of web 3 development is the hash function everybody in here knows what a hash function is i can say hello world over here i'm gonna get this nice deterministic string over there let's make this a little bigger too yeah so and and you know you know how a hash function works but explaining this to my dad or something like that it's gonna be a little different but i can say you know I can type hello world again we're gonna get that same hash right it's deterministic and also it's one directional if I were to give you this string and you had to figure out the other direction you would have to like brute force your way back on the on the hash and kind of arbitrary size too no matter how big this thing is over here that that resulting string is always what 64 characters I think yeah it ends up being yeah 66 with a 0x so so this is sort of to where I can kind of now so we know what a hash function is right and we can put an input but now let's set up a key pair so a private key is basically just 64 characters of hex right so I can plug that hash in here and I can create a key pair from hello world maybe right so this is actually going to produce an aetherium account right and no matter what I type in over here I'm gonna get an aetherium account over on the other side basically a private key and a public key and and we can even kind of play with this a little bit we can if you take the public key and you have get out of here and you hashed that so if I plug the oh boy if I plug the public key into here I'm gonna get a hash out of that and if we look at those last characters that's where your etherium address actually comes from you can see that these are kind of lined up there right you can see the c08 at the end of that hash so so basically we can generate a theorem accounts by just kind of banging away here right so what's up questions shout things out too there's there's no there's no real rules here so okay so I'm going to create let's see a hash function and a key pair and we'll set up a textbox so I can enter some kind of secret in there and I could just make this like a password if I wanted to but since we're all friends here I'm just gonna show it directly so so let's just come up with maybe just call it Waterloo or something like that right so there's the private key that we get from Waterloo we can address I can even make that a little bit more friendly wire up an address so what what can we do with the key pair right like the the essential piece of an elliptic curve key pair from 1983 is you can sign and recover messages and you can encrypt and decrypt information so let's let's just play with that just a little bit so let's bring in our private key and then let's hash some message like the is sticky with honey right so now we have a signature and as I type see if I change that to a Y so what I can do with this this key pair is I can sign a message and I can I can ship that message along with the the signature so let's then somewhere let's say let's say down below here is like a third party right so they they plug in my message they plug in my signature and they can cryptographically prove that that account so these two are equal so you have the ac3 680 36 so that they can cryptographically prove that I signed that message right and and all of this you guys have known this this stuff is like you know technology from 30 years ago the point of eath build is just getting it exposed to someone where they can play around with it they can kind of see well what happens when I change that Y what changes so you'll notice that this this account changes so if we plug in a different message we're still going to get an account right so I can take one signature and some other message and get a weird address that doesn't make sense right so you're always going to get an address out of there but what can we do with that so now if we can sign and we can recover messages then then we start talking about like well what if what if that message isn't just like an attestation to something but what if it's like I like Alice sends Bob five dollars right so then we can kind of start talking about what maybe a ledger would look like right so let me bring in a ledger here and I think I'm actually I have this this is kind of hard coded with this specific account there we go yeah so that the word test plugged into a hash plugged into a key pair you get this you get this address but what we can do with the ledger is start Oh Greg get out of here I should probably get rid of that did that show up up there two things trying to get me to go drink some whiskey or something come on come on okay so with a ledger we can we can actually start talking about what if these messages are transactions and I can kind of do something like let's let's create a - address - and this is a little this is like I'm just getting started building this stuff so some of this is a raaah the point of it is to be hopefully eventually very approachable for someone who wants to kind of understand the the basic building blocks leading up to what programmable money is or decentralized programmable money so let's see one two three I think it's that long right that I think that's an address we'll go with it and then we'll set up a from which will be this guy and we'll send like ten a value of like ten dollars there was just sort of like crafting this transaction oh it didn't value needs to have some quotes around it there we go that should parse anyways so so we're when I once I explain what a hash is and I explain what a key pair is I think the next thing is to explain how a ledger would work and even like maybe a a decentralize or a distributed ledger and then you can kind of start talking about different attack vectors and eventually why we would need to get to needing a blockchain let me see if I'm doing anybody see oh it's right here it's right here how about that exact it apart there we go okay so now I can add that transaction over here there we go okay so this kind of gives us this feel of we can grab my address here get the value of that there we go so now I can check the balance against the ledger so now we have different accounts we have transactions interacting over here then then like the and I haven't built this yet I'm still working on it the education around this then we start talking about like double spins we start talking about like how the network needs to be on all the time or you have to figure out a way to basically you get to all the problems of why blockchain and why we got to the Nakamoto commit consensus and all that but we can kind of play with this a little bit longer what do I have about 10 more minutes maybe I think so let's let's just kind of yeah let's just kind of get weird with this stuff and play around with it a little bit more so I'm always looking for feedback and I have eath build up right now so you can get in and play with it if you want but there's a ton of if you let's see I think it's right click yeah there's a ton of different components here so if we get in and we look at I should I think I made a list somewhere if we get in and look at the components that we have here there's some really fun ones in web 3 oh ok ok now I remember what I was gonna do this is back to localhost let's let's get out of actually one one one more demo on eath build I hooked up ipfs and I want to show you how you can save things so if you--if we set up a ipfs publish and we're just going to run on this channel and i set a a button to publish it okay and then i'm going to set up a subscriber that will subscribe to that same channel and then output the message so i can type in like hello world here and it's gonna publish its IP FS and then the subscriber comes back around but what I can do so all of this is happening in your browser you're not really going out anywhere except for two compiled contracts I needed the soul C compiler and I couldn't just dump it in because no just completely runs out of memory as I'm adding all these libraries in so da I'm starting to run like these third-party services just to compile things but I'll get to that in a second so what you can do though since this is all in your browser you can save this and it's actually the whole thing is compressed into that QR code so if I and anybody should be able to shoot that if I click that I'm going to get this exact thing so I could download this as a file it's just a compressed JSON file then I can load it in and I'm going to get all these boxes back and I'll load in some stuff earlier but see I've got that here so my phone is on the cellular network now I don't know if this is gonna this this is a shifty demo so I'm going to try to put hello Waterloo in here and hit did it go through it did yeah yeah so that went from my phone through old to like a peer-to-peer ipfs Network and published there on this machine through a different network so a lot of really book so so a lot of different like neat little networking things going on there okay now let's go to localhost and we can start getting a little weird with so at the happy hour tomorrow night we're going to have a what is it it's gonna be a stock market stock market buying so we're gonna have a burner wallet we're gonna have David's burner wallet and we're gonna have a stock market for the beers and the beers will be increased they'll increase in value on a bonding curve and then they'll cool off on a second curve and we'll be adjusting those curves like as people are buying so it's it should look like a stock market right so I have the contract here ready to go and what I want to do is kind of go through kind of the education behind how transactions work and deploying if we probably don't have enough time for that but let me just just dive right into this as fast as I can and see how far we get so let's see what we need first is probably let's just let's just send value first right so go back to our text and our hash and our key pair okay and plug that in here and let's see let's just do Waterloo that sounds good enough and so there is our address and what I want to do is probably get a QR code for that and I'm going to hit that with a burner wallet send it some money so what we'll do is I will oh man come on come on about five minutes probably I'm gonna have to shove a lot of stuff into five minutes seven minutes okay cool so I'm gonna send some money to that so how do we test the the balance of this key pair right so what we're gonna need is a web three balance and we'll push the address in and then it's asking us for what chain we want and so I'm going to do that on next I in this case so it will be what HTTP core right I think that's it right and that'll be our blockchain and then we can check this guy's balance and it's currently zero actually let's do dollars oh that won't work we need to go let's let's send this guy block first yeah okay so sending this dude a buck okay so now he has a dollar I should be able to check this there we go now we see that this guy has a balance but this is a classic classic blockchain development you've got to explain way and decimals and all sorts of stuff like that but eventually we get oh get out of here is this big enough maybe I should make this a little wider huh so eventually we will get there we go so there's our $1 so now this guy has a dollar now let's say this guy wants to send some funds right so what we'll do is we'll add in a QR reader and that will output to a transaction block and what I can do is hook that up to like the two address set up a value will have to go to way right but say I wanted to send 25 cents back to my phone let's see what do we need we need a private key ooh this can be hard to stretcher up there let's see hmm I think it's that one right there oh hey let's do this I totally said that up here good lord okay let's bring our blockchain over here and let's see so data gasps we don't we're not going to worry about any of that stuff but I think we're about ready so if I have this QR reader set up we need to toggle it and I'll show this guy my receive code uh-oh oh man I'm not doing anything wrong here that's gotta be it that's the one maybe it's already did it already go through maybe it just doesn't disappear here let's double-click this yo yeah it's already there okay so toggle this guy back again get him out of here okay so we've got our we've got our to account so what the there's there's kind of this gap right now between like I'm I'm explaining hashes and key pairs and a ledger and then all of a sudden we're sending transactions so there's I have within my curriculum a lot to fill in there to get to the point where we're sending transactions but I kind of want to just skip ahead and show you guys like so we can we can basically sign this transaction and then I can send it if I take the sign transaction and the blockchain I can send this thing along and so this is just gonna help me explain to people and and help them kind of understand very visually how this works and we should get a hash out of that if I send it there we go so now this dude probably is going to get that money back in a second okay so now so now we've kind of explained transactions we've kind of explained let's let's go a little bit different route here I'm just I'm just piling stuff on here but let's bring in a compiler and we'll compile the market contract that we'll be using tonight at the meetup or no tomorrow night tomorrow night we got a lot of work if it's tonight and we'll set up a file drop here okay and then that's going to compiled to bytecode and an ABI and so if I drop this market contract in here and hit the compile button there we go so now we get this cool byte code so if we wanted to deploy this contract we technically could take this transaction that we have set up here and we're gonna pull the two address out right so when you deploy a contract you're basically sending a transaction with no to address but this will be our data so we'll plug this bytecode into our data field and I think I need to have an unsub too now or maybe one well we'll see what happens here let's see if it's gonna let me do this so now if I sign that and I send that did not work I bet I bet it's either gas limit or things that like a new user you I'm gonna have to figure out clever ways to sort of educate them on this because it's there's a lot going on here oh no that that went right there's a transaction it's signed what happens when I send it all we're getting air oh the gas is too low okay so let's go back over to our gas and set that out like two million sign it again send it again let's see did that one go through yeah we got a hash okay so there there we just like deployed a contract so then what you could do is once you have the address of the contract since we're kind of out of time I'll just quickly dump in a contract here and what you'll do is you'll plug in an ABI and an address and your blockchain and now you'll have this over here so I could technically like query like the price of a beer right so if it was drink ID zero I could call against that and I get the price of the beer out on the other side or if it was more of a set function like I was doing a set owner I I could plug in an owner here and it's going to give me the ABI and coded version of that over here and then I would plug that back into a transaction so all these building blocks sort of plug together to do what what we're familiar doing kind of on the command line but I think it's gonna help me to sort of educate people and and hope bringing people into the space and give them this whoa that's really cool programmable money goosebumps moment today was a little less of that and more of just kind of me explaining how this stuff works but I would love feedback and it's available if that build so hit me up like I said I'm at at Austin Griffith on the socials any questions or anything Lina yeah yes please oh absolutely yeah it does feel like very elementary with like the prime prime color prime primary colors for sure yeah I would I would love to see something like this there right like this is meant to be kind of an educational workbench it at when I get when I get through it and I end up building some crazy stuff like let me load in I have this like badge dropper I built it it ends up looking like this very very complicated thing that that is doing all this crazy stuff but you know in the beginning it's like these really simple building blocks and it's I mean it's all public it's all open source everything's out there for anybody to use this but also I personally would like to evangelize it more and get into into places like that and make sure this is I'm not exactly sure like my three-year-olds gonna understand like a key pair but like maybe like sort of like email right like email wasn't we didn't know what email was until I came along like some of some of the technologies abstracted away and some of it becomes like very native to to our culture or whatever I think probably a key pair will be which is an interesting thing like understanding what a private public key pair is and some of the properties so maybe my three-year-old will we'll get into that and and so I hope to do that one day to have that kind of that stuff available and to also evangelize it to a level that it gets you know out there and people use it anybody else yeah I think you could so what you can do is you can dump this file now to just like a node.js file and run it without the GUI or anything like that so technically you could build adapt but I think this is more like building proof of concepts like hey what what could this thing look like can we wire it up and just get a feel for how it works so for me it's it's used for education but like I said yeah it does have some powerful pieces yeah right you kind of like it when you yeah yep totally totally yeah just having like a nice visual environment where you can kind of poke at things and you know what happens if I do this what happens if I do this yeah for sure anybody else what up Billy yeah go ahead Oh like it had a code one up right if you wanted to if you grabbed my code let's go let's go look at one real quick that's a great question so let's look at maybe the key pair right so and and this is using a library called light graph so I didn't build the underlying this this whole thing I put together in a few weeks so it's very very fresh come on in our our our nond it's not our nom nom you got to just yeah French it up at the end right yeah well welcome so you have basically your class here and you set your inputs and your outputs and then there is an on execute and that's basically like if you look at your CPU this thing is to be using way more cpu than it should be right this is this is a proof of concept kind of thing because this thing is just like jamming away like if if the thing was doing a hash function here let's do this lit this is cool so if I take a hash function and I take some text and I wire them up and I type hello we're gonna get a hash out of that right now watch what I do here now why are this type back around oh wait what did I do wrong usually that will give me let's see something's not right here the hash function is not working what's going on oh there we go okay for some reason it wasn't running now let's wire it back to itself there we go yeah okay so it's like constantly running so you you have an execute function so what we could do we could do like a substring oh man I wish I had more time there's so much fun playing with this like we we could do a substring and we could not subscribe we could basically set this thing up to like mine for accounts that have like leading zeros or something right we could check for a substring that has more zeros and we could have it stopped when it gets the one but basically you've got this on execute and it's running through doing something every time it renders the object so your CPU definitely takes a hit here and then there's a there's a display here somewhere too so if I go to like maybe the and and his stuff is all in the canvas and then I'm like rendering react like hacking reactant over the top of his canvas so it's really it's really kind of messy but but it's proof concepts coming together but yeah you sort of have this execute function you have like when someone calls a function and then you have the display stuff but yeah you just kind of plug in a thing and it just shows up in that menu so it shows up in the menu here but you can also just type file drop right and it'll it'll show up okay I think I'm probably out of time the other quick ones so I work word no no I think I think it's it's played go to eat build check it out give me feedback on Allison Griffith thank you guys so much [Applause]
Automatic transcript — names and jargon may be misspelled.