Practical Plasma: Gaming by Matthew Campbell (Devcon4)
Devcon·Wed, Oct 9, 2019, 12:00 AM
Visit the https://archive.devcon.org/ to gain access to the entire library of Devcon talks with the ease of filtering, playlists, personalized suggestions, decentralized access on IPFS and more. https://archive.devcon.org/archive/watch/4/practical-plasma-gaming Talk will explore how Plasma Cash is changing the blockchain gaming landscape. Viewers will come away with a strong understanding of how to add advanced functionality like real time battles and crosschain token transfers to their existing games. Also we will explore how Plasma Cash enables use of sidehains to speed up gaming. What are the UI/UX difficulties of Plasma Cash? What would having wallets on multiple chains look like. Can we have automatic sign transactions for users? First we will delve deeper into L2 solutions like sidechain and state channels. We will see how plasma cash enables token transfers to sidechains, enabling the game to be fully run on the secondary layer. We will compare from a high level some common L2 solutions. We will walk through the UI/UX choices, how existing wallets interact with Plasma contracts. Then we we will delve into the tradeoffs in UI to speed. Finally we will tie everything together, by showing a working game that uses plasma, on a sidechain. So the audience can get the feel of what the end result of all this work would look like. What kind of games are possible and open up ideas for their future titles. Speaker(s): Matthew Campbell Skill level: Intermediate Track: Scalability Keywords: games, sidechains, UI, UX, L2 Follow us: https://twitter.com/efdevcon, https://twitter.com/ethereum Learn more about devcon: https://www.devcon.org/ Learn more about ethereum: https://ethereum.org/ Devcon is the Ethereum conference for developers, researchers, thinkers, and makers. Devcon 4 was held in Prague, Czech Republic on Oct 30 - Nov 2, 2018. Devcon is organized and presented by the Ethereum Foundation, with the support of our sponsors. To find out more, please visit https://ethereum.foundation/
Transcript
so today I'm gonna kind of talk to you a little bit differently than how plasma is constructed or how you build plasma but I want to actually talk about applications that we're building and deploying into production with plasma and how plasma is actually going to scale games on the blockchain and I'm kind of a big fan of games because I think it's actually what's gonna drive normal user adoption onto the blockchain so like we're super passionate even though we're like researching plasma we're always kind of passionate about how can we actually get end-users to play and use the blockchain right cool so this talk actually starts about 20 years ago so I used to I used to play this game called Magic the Gathering anybody here actually play like Magic the Gathering or you do or alright there's a whole bunch of people in a nerdy crowd so it wasn't a big surprise so we used to like when we were in high school we used to play Magic the Gathering we used to play card games and yugioh and all this stuff and we loved it right and you know about a year ago when we were starting a blockchain company we said you know what it would be really amazing if we put magic the gathering of hearthstone on the blockchain because you could have real ownership of cards you could have provably correct logic you know you could actually prevent fraud you could actually have real money embedding inside the games we said let's do it so I don't know if you guys were developing a theory I'm about a year ago but having a full card game on the blockchain was just not reasonable right and that's where we've kind of taken this journey over the last year about trying to take a very simple application and actually scale it and run it on top of the blockchain so cool so you you're you're looking at me you're like Matt I play for tonight I play all these games why do I need it on the blockchain that doesn't make any sense the blockchain is for transferring value it's for you know running prediction markets and stuff like this it's not for games so I actually I actually think that games are have some really amazing use cases that actually blow away traditional games so obviously everybody talks about real ownership of right like the items that Ewing own in-game you can really own them you can trade them you know there's digital scarcity if you guys have ever played like an online game like an MMO or any other kind of game you know that the publisher will just flood new items continually and if you had some valuable staff of magic it will like overtime lose its value but it's kind of nice that we can actually know what the value of our items are because we actually know what the scarcity of our items well it's also kind of cool as Vitalik actually had this quote where like like he was really sad when they changed the rules of StarCraft and he stopped playing because the one day they like changed how the game worked and I think what's kind of cool is if a game runs on the blockchain we just literally fork it if we think that like we want to play Ultima Online with dreadlords or we want to play the original World of Warcraft before they nerfed it we could just literally fork the blockchain and be able to run our version of the game right and then the last point we just made this realization very recently and I think that this is going to be like one of the biggest features is because we have a trustable vm because we have this the e vm and it's trustable we could actually have end users upload code into our game servers and now we could have anybody that plays our game could make mods for the game and the mods are not cheetah below they could actually be running on the chain and other people could be introspecting the mods so we think that there's a ton of amazing use cases for actually wanting to run these games on the blockchain and now you can actually monetize it so like you could actually build a game we could actually build like game modes and actually be able to charge users for them so gaming on the blockchain has actually been around for quite a long time so I don't know if you guys ever seen Bitcoin actually had the first blockchain games so about five years ago there was this group called xcp and they actually built blockchain games and but they had like custom miners and then they would put little bits of metadata on top of the on top of the Bitcoin chain so it was kind of the first start and basically the only thing they had asset ownership you could prove that you own some asset an asset had scarcity and then aetherium came out right and obviously we all know last year last year was when the big jump happened when crypto kitties came out everybody said oh my god a theorem actually runs a pretty cool application and these are c720 ones came out and everybody was jumping all over it right but it was kind of boring right so anybody here ever play crypto kitties okay like half the audience it was kind of just a Ponzi scheme with like a cute graphic scheme so don't don't get me wrong I have a couple cats I'm a fan but it was kind of like okay this is cool but like this isn't anything that like mainstream gamers are gonna care about this isn't gonna come in I'm not gonna get my electronic gaming monthly and see crypto kitties in it right it's kind of still a very boring game but it did invent the concept of these non fungible tokens right so now we have like the first kind of building block for all this gaming technology right and obviously we all know like proof-of-work Chan's like Bitcoin and aetherium have been really secure and they've been they but the thing is is that they're still quite slow so we're never gonna actually be able to run a full game on a proof-of-work chain at least I don't think we will so I think what we're gonna see is we're gonna see a combination of other kind of consensus mechanisms joined with plasma and plasma will be adding the security from the from from the proof-of-work chain and then you're gonna have side chains that are running on DPOs or proof of stake or maybe other consensus algorithms as they come out so we're currently a really big fan of DPOs because you can actually deploy applications today so if you look at a couple of popular chains like steam it and yo s and then loom and a few others they're all a lot of them are kind of going with this deep us model and it's it's it's a lot more centralized and it's good for applications that have lower value like games I wouldn't want to run my core block chain on DPOs I wouldn't run like the blockchain that holds all the value on a DPS chain but you can be able to run pretty interesting blockchain applications on top of DPOs so we're big fans of side-chains so these guys earlier have been talking about plasma and using plasma for payments and that there are plasma chains so there's kind of really three scaling techniques right now that we're talking about with blockchain apps we have the state channels we have plasma and side chains and I kind of think that it's going to be a combination I don't think that you're going to see there's some groups that say oh you know you can run everything on plasma I don't believe that's true you can run everything on a sidechain sure you could do that but then you don't have as much security so I think really combining the plasma with the side chains is actually what's going to be what's actually making these applications run so that was kind of a very very long-winded way of being able to show that we can actually have real card games so this is a game called zombie battleground where it's actually like if you guys play hearthstone or Magic the Gathering it's a real card game that runs on a side chain and what's really cool is because we have it running on a blockchain like I was saying earlier now we have end users can upload new game modes so a user could say I want to write a solidity contract that gives me a tournament and the term it says Oh everybody has to put in a half an eighth and whoever wins the game gets all the eath right and the owner of the contract could actually monetize the contract and they could be reusing all my game assets my client my chain and they would be able to extend the functionality to their end users without having to build a full game themselves and we think that like by having lots and lots of developers be able to extend other games this is also going to cause decentralization to the games themselves so say you're say Matt you know this is a plasma talk when we gonna get into plasma I said yeah so one of the issues we had was originally when we started this game we had a bunch of people back the game and we had like 2000 users kind of donate to fund the game and initially we had to give them two million cards so I don't know if you know how much time it would take to give two million cards across the etherion blockchain we would have probably eaten up every single transaction for like over a week if not two weeks on the entire chain if we were gonna do this so obviously it wasn't even feasible on day one and this was only with two users with 2,000 users so that's when we that's when we started to say and these these are what the cards look like better they just so you have kind of a good reference so we were like okay how can we give them these assets right and how can we secure them so first we want to be able to issue assets on side chains so that way like we can have we can even have on ramps from like mobile games so like let's say that you know you have free-to-play mobile games you want to unwrap these users right and maybe a few hours in then you want to tell them about crypto you want to start with having them play these games and then eventually get in and say oh this oh you mean I can move my assets to aetherium you mean that I can sell my assets for ether or I can sell my assets for Bitcoin or something like this and then we slowly get adoption through these people that are just kind of playing these games and they don't even really realize that they're doing the blockchain and then one day we get like we just unranked them right and this is where kind of plasma comes in because plasma is going to be the mechanism that we're going to actually be able to exchange these assets to main net so before we get into plasma just like a quick 30 seconds about me I'm the founder of loom Network we build l2 solutions we also build games I'm a big go developer so if anybody here likes to talk about go I'd love to geek out about it and fun fact I wrote a well if elephant to my wedding and if you get me drunk I will speak tied to you so that is it so what was plaza so about a year ago when I first heard about plasma Vitalik had written the white paper and it read the original white Pei and I was like wow this is magical it's like unicorns and sunshine and all this stuff and I said this is just not possible I said when when you read the original paper it's just it's too kind of out there it's like ten years in the future kind of thing and I and I said you know what I'm not gonna I'm not gonna do plasma I don't believe it's going to exist I want to build my apps now right so so now plasma has actually changed and I think every speaker has said this but I'm gonna I'm gonna steal their lines is that plasma cash is now plasma basically anybody that said somebody was gonna like dude over there or something like that but basically anybody that's talking about plasma or the original plasma paper has just totally missed the last six months because basically everything is moving the plasma cash plasma cash is a massive simplification of all the plasma constructions so that we can actually use them in real applications today we even have an open source repo right now where you can go and download and use plasma on our test net for free right now so so it was funny so like about five or six months ago I'm on reddit and some guy is like trolling me on reddit this vbeauté uhrin guy I don't know who that is and he's like you guys should really like you guys should like really do plasma and I said I don't know and he's like oh I'll hook you up with the imme say go guys so he hooked me up with David over here and we had some coffee in Bangkok and he's like man plasma cash is the future and after like 30 minutes I was convinced that it was the future so about six months ago we started actually building the first real plasma cash implementation because I knew that it was actually something that could go in to production and be absolutely be used this year because that's what I care about you know it's fun to talk about this stuff in the future and I know a lot of you guys are building the next generations of this stuff but I kind of I kind of just want to ship my game like that's that's just kind of my main motivation here and that that's kind of what I'm trying to get out of this talk is that you know a lot of these guys are talking about the research but I really just want to build some stuff so I'm in a bit of a different category so just a quick background about us so we built l2 solutions with DD POS and plasma cash there's a bunch of people that are doing it I'm a big fan of plasma cash you don't have to use us a music goes doing some amazing work on the plasma cash stuff also whoo somebody who is jumping in there so you're like ok cool you've kind of told me you give me some background about why plasma ydp us how are these things kind of coming together and how are they actually useful today how does this all fit in what does this actually technically look like when we look at like a diagram right so this is like a kind of a big jumble diagram that I stole from somebody else but basically the idea is is that you have a proof of stake network whether it's deep us a proof of stake or in some cases the proof of authority network that is is allowing users to be able to do plasma transactions between themselves on this side chain almost immediately so a lot of these chains have sub-second commit times so then if as long as we have these plasma cash we can actually transfer or trade value between every single person that's on that side chain and if at any point in time we don't trust that side chain we can pull our assets back to aetherium and we don't have to trust the constructions of the side chain what's kind of cool is basically what's happening is that side chain is periodically just compressing all that information and dropping Merkle trees onto a smart contract on main net and the clients can verify it and there can even be third party people that can verify it and slash this contract so if the sidechain ever tried to cheat you of value there are other people that could actually work on your behalf and and actually penalize the sidechain so I'm gonna skip this so I kind of want to show like what it looks like when you're doing a plasma trash transaction so it's not going to be particularly different so like let's say that we have a mobile app that's like a marketplace right and we're gonna buy like a specific item like we could actually go into the marketplace and we could pick an item and then what's gonna happen is on mobile it would link to your wallet so we link to your theorem what you see it's it's not obvious but that's actually trust wallet that's not our app when you switch so Trust wallet and a couple other wallets they actually allow deep linking so if you have a mobile app like your mobile game you could link into it the user doesn't really feel like they're having to go to their wallet interface they can sign the transaction and the information signed from the transaction just jumps back into your application so we can actually make these seamless user experiences even when we're doing complex things like plasma and to me like that's actually the exciting stuff I'm sure the Merkel trees and the sparse Merkel roots and all this stuff that's super awesome but like if an end user can use this and barely even know that they're using crypto that's even more exciting to me yeah so just so you can see so this screen is actually your wallet and it's just deep linked into your wallet software so George touched on this a bit too and I'm gonna talk about this for just a minute is these things called liquidity providers and why they're important so one of the things that both David and Kelvin and George we're talking about is that there's these long exit periods there can be a one-week two-week exit period for a plasma chain so for a normal user that's really kind of really annoying like I deposit Ethan to this chain and then before I get my eath back I have to wait like two weeks like when we use bye Nance and they make us wait two minutes after we log in we're already annoyed enough to get our eath back so what we can do is like chains like loom can actually operate things called liquidity providers where they're watching all the transactions and they can see that hey these transactions were actually valid and I'm going to credit the user for the transaction in advance and then I'll take the payment a week later so we can take the spread and and and allow the user to exit very quickly because we're watching the chain and we know that these transactions are valid and that nobody else is going to be able to contest them so we can take that and that's another mechanism that we used to like smooth down the user interface and make it even easier for people to build these plasma applications so just kind of getting started I I know there was somebody in the crowd that was like asking about how to get started so anybody here ever used crypto zombies ok cool like a like a good half of the audience so we actually just started crypto zombies season 2 today so we have a whole bunch of stuff about these custom game modes but we're actually coming out with a plasma cash lesson over the next two weeks so basically what we want to do is we want to make it plasma cash as easy to use as a person learning solidity for the first time so if there's things you guys want to see in the upcoming lessons go ahead and hit me up because we love to get some feedback but we really just we think that education for developers is kind of the next step so if we have a thousand developers that know how to use plasma then we're gonna have 10,000 plasma applications and it's just gonna snowball on itself and I want to kind of come back here next Def Con and I want to see claps or what was it Flats whoo I want to see some plops next year and then I'm then I know that like we actually did a very good job cool so George mentioned very briefly our plasma cash implementation is open source the o me say go plasma into the implementation is open source also we also have a tool called the plasma CLI that allows you to just have a repple and be able to toy around with plasma transactions because we got to the point where we were like trying to do these things and it was really confusing and we just built a very simple repple on how to use plasma so that way you can like walk through transactions you can cut you can test invariance you could test like if you have a failure condition so that way you can kind of actually know how the transaction flow is going to work and if you're gonna cancel things you can actually know how to cancel them so cool cool things to build this wouldn't be a good talk if I didn't give you some suggestions liquidity networks I think are really cool so like if you have big of tokens and you want to transfer them like said that you have eath and Bitcoin and Mesa go and loom tokens and you want to be able to have pools where you automatically convert it like that would be a great use case for plasma I've seen Dex's I'm obviously a big fan of gaming and something that not a lot of people are talking about is you could potentially be using plasma as a cross chain communication so let's imagine that we have three or four different chains that are communicating with each other they could actually communicate with each other without going to theory main net they could actually use plasma caste constructions between the different change just to communicate so toca weight takeaways so plasma cash is here you can use it today if you have questions you can ask the four of us down here in the front you can use it for non fungible tokens and you can scale payment networks with it so I have a few minutes and I want to answer questions so we'll open it up for questions cool I think this gentleman in the back was the first one you can just shout it out and I'll repeat it yeah so that was a great question the question was you can't run an EVM on a plaza on plasma so how do you run the game logic so that's that's where like we think that different consensus models are interesting so we have a side chain that runs deep us so the game logic actually runs on contracts on the DP us chain and the DPOs chains has a lot higher transaction rate when users want to do things the value they can use plasma as the mechanism of transference of value between chains and that's where we think there's a kind of be a balance over time until some kind of mechanism comes that we can actually do EDM on plasma cool this that's a great question so truss wallet does it support plasma it doesn't need to so it's just an etherium wallet that allows deep linking by other applications so I believe some of the other wallets do but we're friends with the trust wallet guy so basically all you're doing is you're sending aetherium transaction to the wallet just like you would meta mask and probably the new meta masked wallet will probably just work also you're just sending it transaction it doesn't need to know about it and the user approves the transaction in the other wallet yeah I say so that was a good question what is our biggest challenge thus far and what was kind of going forward is their biggest challenge I think our biggest challenge has always been trying to figure out how we can actually get normal users to get on to these applications and how do we get adoption so like everybody else is kind of talking about the technology and I have lots of people that work for me that look at the technology but I'm really excited about how many users are using it how easy is it for me to onboard a user and how many and how much can we grow kripp there because if I can grow crypto by 10 or 20 thousand users I've made it quite a large dent right and if a couple other developers do this all of a sudden we have like a very large community of people that are actually using crypto kind of going forward I think the biggest things are going to be about UX and UI these plasma if you've played with plasma transactions they're still very complicated there's you know there's deposits and withdrawals and challenges and then mass exits and all these things and I think there's gonna be a ton of work involved and trying to figure out how we explain these to the user or how we hide these away from the user without them losing all of their security that's really what I think is kind of the challenge going forward I'm gonna I'll go back to you but this gentleman the way back there this is a great question so he was saying that if you have two million tokens in a plasma cash that over a year you could potentially have a petabyte of storage I don't know if that's the exact number but basically so a couple of the I think George was talking about plasma XT there's a couple there's a couple proposals for checkpointing so essentially what's gonna happen is that you're not gonna be tracking two million assets over that time or if you are we're gonna have smaller and smaller check points because obviously holding around a petabyte of data is not something that's reasonable zero or zero knowledge proof yeah that was a good question so can we upgrade our plasma change yeah so like basically with any blockchain you can upgrade it through either soft or hard Forks depending on if the validators of the network accept the changes so we have smart contracts on our plasma chain that are upgradeable also so yeah there's there's no reason why you can't upgrade the plasma chain over time cool oh sorry okay this guy in the back here how big of a team do we have to build it so loom is 70 people the team that built the game is around 30 people so so quite a sizable team yeah cool yeah so this is a great question it says while you're in the game the game is actually controlling the key could the users potentially be controlling that key so we we perfectly we purposely try to do this thing where we have multiple keys so we have a private key that is actually doing your gameplay that has no real value other than the actions so if that key is lost the only thing the person can do is just kind of play the game as though they're like you and that we purposely make any of the keys for values the ownership of the items to be a different key that's controlled by your wallet so that way when you're actually doing actions that would move or sell or buy items you would use you would use your primary wallet right exactly both keys are on your computer its yep that's correct so so the question is zombie battleground is a game that runs on loom and does it use aetherium for asset management so the chain itself has asset management and when you want to move app but you can move assets back to aetherium so the idea is is that there's going to be lots of these side chains and then over time if you want to move value back to main net so like say there's a Dex on main net that you wanted to use you can move the cards back to main net and trade it or if you just wanted to store it on your ledger or your some other Hardware wallet you can move it back to aetherium for that so what the question was how this is the game use it so so on the sidechain we use we obviously put the assets we have the game logic and then we allow end users to upload new solidity contracts to modify how the games work on the chain I think I have time for maybe one more question this gentleman in the way way back here how have we been marketing the game and I have gotten so much grief from the entire crypto community about this so we did a Kickstarter not for money but because we wanted to get a whole bunch of gamers a bunch of people that don't know anything about crypto and basically all of our marketing efforts have been about the game about how how fun the game is and we have purposely not done crypto people because if I have a thousand pete crypto people that just want to get in another ponzi scheme of buying cards for me that's not exciting to me but if i get 10,000 users of people that like think my game is awesome and fun and then they eventually find aetherium then i have won so that's it thank you guys [Applause]
Automatic transcript — names and jargon may be misspelled.