 Thanks for attending my workshop. My name is Anne. Yeah, so again, a little bit about myself. I'm a software engineer and visual artist. I'm from Montana in the United States. And I moved to, thank you, is there another Montana here? Wow. What's your name? Mozilla. Oh, that's cool. Nice. I live in Tokyo now. And I'm a lead software engineer at HerbGrid. And this is a picture of me with a real yak. So, and yeah, HerbGrid, we're a small startup in Tokyo. We're 10 engineers now, a couple part-time staff. And we're building a middle-of-clear layer for Ethereum. We're trying to make blockchain easier to use. So this is a workshop. It's going to be about 90 minutes. There's going to be a lot of different components to this workshop. So I want to set some expectations, first of all. So I pitched this talk as beginner-friendly and it's a mixed-level audience. It's DevCon. So I'm sure there's people in the audience that can probably code circles around me. It's Liberty. There might be people that are writing their first smart contract. So if you're in the former category, maybe you can help your neighbor out, help them learn something. Or maybe you see a way of writing to Liberty that's different or unique and you can make a pull request against my open source code, fork the repo, get creative with it. If I mentioned something that you worked on or a project that you really like, feel free to give some small golf balls. I'm going to cover a lot of different creative projects in the crypto space. And hopefully, I think there's just a lot of really exciting stuff out there. So let's get into it. Next I want to talk about what I mean by creative constraints. I think there's a couple more seats in the front, so feel welcome to have a seat. So in university, I study fine art. And I also study computer science and math. And my dirty secret is my art classes were harder. But I continue to study printmaking and painting in Japan. And this is a woodblock print that I'm working on. And so in printmaking, you might think about, okay, I want an image here of this train and cherry blossoms. And I have to think about the technical parts of separating into different blocks and getting colorful layers. So I was thinking a lot about the connection between art and science and how technical things can be very creative. I think art has a lot of process. And coding has a lot of creativity. So that's one thing that I think about. The other thing is that sometimes in art, in technology, we encounter a roadblock. So here this man is running into the door. He can't open up the door. And sometimes if we take a step back, we can see a new way forward. I find solidity challenging. But I also find it exciting and interesting. And there is new ways of thinking that can be brought about when you encounter a challenge that has to be creative to get around it. So in the second part of the talk, I want to do a survey of games and creative projects in theory. So first of all is ERC-20 tokens. So this is probably one of the most common terms that we talked about. It's a fungible token. Can anyone in ten words or fewer give me a definition of fungible? Yeah? All the same. All the same. Sounds pretty good. Any other definitions? Visible part of that. I think that's a separate one. So basically one unit is exchangeable for another unit of the same thing. They can be interchangeable. So in currency, we can swap one for the other. And traditionally in video games, there's often in-game currencies, but they're hosted on a particular server. So in Second Life, you have Linden Dollars, but that's all centralized in Second Life's databases. So now currencies in games can actually live in their own world and be traded in an open market. So a couple of examples would be Decentralon's mana and the Loom token. In contrast, we also have ERC721 tokens, which are non-funcable and great for collectibles. So the illustration for this picture I took is from a shop in Shibuya, Tokyo called Mandorake. There's also a store in Osaka, and it's these, you know, vinyl collectible figurines that are very popular in Japan and around the world, and they're quite expensive, maybe tens of thousands of yen per each, or a couple of hundred US dollars, and they're all kind of a kind. And so we're seeing some of that in blockchains, like, let's make some one-of-a-kind goods. So I have a lot of examples to share. This one is super cute. I love these little round guys there. Axi Infinity, these are based off of axolotls. The Japanese word for these is uporupa, that's misodic, but basically they're generated, you know, code, and they have different features. This one's growing a turnip and a carrot. Another one here has a watermelon on its head. And what they're useful for is assembling small squadrons and fighting in battle. So you basically collect these things, and then the game is making them fight. It's really adorable. You can also read them, and so that would combine some of the code and mix them together. So here I have clover and baby, and sort of this stage of it growing up into a weird little bird. Yeah. Another example of the ERC721 is more just a collectible, but there's this kind of fun experience when you get to create a new building. So you pay some of each to the smart contract, and it generates a one-of-a-kind building. You know, it has different features, like a different background, the error class, their different heights. Some of them have rooftop tools. I wasn't lucky enough, but those are really neat. Cryptokitties is probably the most famous ERC721, and this is... Let's see. I mean, there's a lot of delight in just what you might find. So there's all these features of cats, and as, you know, new cats are bred and generated, you know, you can discover interesting mutations that adds a lot of whimsy and delight to these contracts. So, you know, it's kind of fun to see the jungle background and demon horns and flamethrower, and this other orange one that kind of looks like a seal. So this game, you know, there's just a ton of popularity, and it's pretty fun. Cryptokaiju combines these real-world vinyl figurines using NFC and blockchain. So there's some neat mash-ups of the physical world and the digital world. And another example, not a game, but still really cool, the Austrian Postal Service issued this crypto stamp that's both a collectible and, I guess you could mail someone you cared about a really cool letter. The other nice thing about ERC721 is they can be swapped and traded in different marketplaces. There's a couple more seats at the front, so let's create a step inside. So OpenSea is a very popular marketplace that has a lot of crypto collectibles. BlockSwap allows trading of item-to-item codecs. It's interesting that they're actually taking things that are not on the blockchain, like real-world art and assets and trying to connect it to ERC721. And there's plenty more that I'm not mentioning, but what's neat is it's not locked in any particular marketplace. Okay, I'm going to step back into features of solidity that we might see in days. So payable functions, this is really integral. How do you buy your crypto kit? You send money, you send your ETH to a smart contract. Maybe you're playing a betting game. You send, you know, ETH to some betting pool. Time stamps are pretty interesting too. FOMO 3D is just fascinating because it's based on the concept of fear of missing out. So the basic rules are, when the timer ends, the last player to enter the game wins the pot, the pool. And anyone could pay to join the pool and extend the game by two minutes. The creator's described it as a psychological social experiment ingredient. I did a fun project, it's time stamps, when I was doing my consensus project. So my co-workers created, as one of our first demos, a diamond-backed cryptocurrency. And there's a lot of projects that are putting assets in, you know, backing things. And I thought, well, what's valuable in Japan? And the thing that's valuable in Japan is free. If you go to any department store, you might find a fancy musk melon that's worth maybe $100. This is pretty normal in Japan, they're used as gifts. You could even, I think the most expensive ones went for 27,000 US dollars per just a pair. And they have nice stamps and they have a little bow on it. So I thought, this would be really fun to make a cryptocurrency. But the thing is, fruit goes bad. So what do you do then? You use the time stamp. And when the fruit rots, you can't trade it anymore. So we use the now keyword in Solidity. And you have to be a little careful with now. I know consensus is giving a security best practices later this week. And they also have a lot of this online. But keep in mind that with the now keyword, miners can sort of bunch it a little bit and not get caught. So it's better to use wider time spans with doing comparisons. It's an open source project. It's not a real ICO. It's a satire. But I made the logo. It's like the Ethereum logo is split. It's just another one that's broken in half. So here's a little bit of the code. In the transfer function here, we have this is expired helper function that basically compares the current time to now. Hash functions. We'll see hash functions in the workshop at the end, the game we're building. But just a reminder, hash functions, we take a string or a bit of memory and run it through a function like Ketchak. That's the famous one in Solidity. And we get out some bytes. Summary transactions. It's not specifically taking Ethereum, but I think it's really interesting. And the Axi Infinity folks did a really cool job with this. So with Ethereum transactions, you're paying gas and you're also paying in time. And in a game, you know, that delay, people get impatient and want, they don't want to wait 15 seconds for an action to happen. So Axi Infinity has a lot of gameplay and that happens off chain. And then you can summarize it by clicking the sync pending experience, sign a transaction and send it. And then, you know, you're incentivized to do this to level up your little critter at certain levels they can breed or, you know, grow. And so it's a nice balance of putting things on the blockchain but not slowing down games play and keeping the incentives for people to keep playing a game. It's also possible to use summarization and side chains. So rather than just putting things on the server, you could put it on a separate blockchain. You could, you know, choose a blockchain that's more optimized for speed, computation, or scalability. And I'm just going to name drop a couple groups of people that are working in this space. Loom especially is really in the gaming space and they're all about side chains. So they have a developer SDK that helps set up side chains. And I think actually Axi Infinity is working with Loom now. Omise Go was one of the first developers of the plasma Ethereum side chain. You know, there's other companies doing more general side chain things like off-chain labs doing sort of a privacy preserving side chain called arbitrary. So it's a concept of burning which would be maybe sending a token to the zero address. And, you know, maybe you could use that in the game. Maybe you could say high stakes, cryptokitty bedding, and now we've locked up our kitties forever in 0x7. It's also possible to layer because contracts are public anyone can interact with them and that's just a really fascinating thing with blockchain. So does anyone know who's maybe done the crypto zombies tutorial? Does anyone know what crypto zombies eat? Crypto kitties. Yeah, they eat crypto kitties. I found one here that shaped like a pickle. It's very funny. And it's fun because while it can't actually destroy the crypto kitty it doesn't hurt it, it does take the information to use that in their game. And it's a fantastic tutorial. It taught me to live with you so I highly recommend it. Kitty hats is pretty fun. It's an ERC721 on another ERC721. It was a Google Chrome plugin and although I think it's not in the Chrome Store anymore unfortunately but you could have taken your crypto kitty and given it, you know, a very dapper hat and a mustache and other accessories. And then there's metaverses which are just ecosystems that, you know, combine different blockchain technologies. So just a central one is a big one where you get parcels of land and you could put some of your crypto collectibles in there and they're partnering with different companies and different startups. So they just had a really big game jam and this was one of the demos of, you know, some of the video assets and things, the charge rendering thing. You can get a little character. Yeah, I definitely want to explore this one more. Okay, so the first part I talked a lot about things in solidity and the second part I'm going to move a little bit into talking about some of the challenges but with the caveat that challenges often bring us new ways of thinking and, you know, opportunities for creating problem solving. So one of the challenges is that there's a lot of different tokens out there. Here's a couple that are just in the game space, just a handful that you might have to use if you play some of these games. And it's not always easy to get those tokens. So I'll give you a case study from my personal life. I am a U.S. citizen residing in Japan and I wanted to get on a token so I could play Centralland and I have to complete the know your customer or KYC process. So I go to an exchange in Japan and say, I'd love to sign up, it looks really cool. They say, well, you're a U.S. citizen maybe you should do it in the United States. So I email the U.S. side through their website and say, well, you don't have a U.S. mailing address where you're getting your bills paid and we can't really... we don't know who you are. Where are you? So, no thanks. I go to another exchange and they said it's very difficult for us to verify U.S. citizens and our government doesn't make it easy so, you know, no worries. But thankfully Coinbase, you know, after a couple failures Coinbase let me get some Ethereum. So great, I'm partially the way there. I turn my Ethereum into wrapped Ethereum or WET. This token makes the Ethereum behave more like the ERC-20 spec. And so the next step is to just get some mana. Okay, so I go to the Relay Order Book and I put in a buy order for 100 mana and nobody's selling. Maybe five days later somebody sells me and I go to Decentraland to claim my avatar name and because of browning error I buy 999 mana, that's not enough mana. Okay. Back to the order book. One mana please, somebody. A couple days later somebody gets it. I can register my name. So, story has a happy ending but it's not the easiest onboarding process to a game, we have to wait like 10 days. Another challenge is setting price and this is really personal to creators. There's always a balance between making a profit on something and then buy it for the next century and that's a very personal thing but there's a trade-off there. The price also changes day to day. So, gas fluctuates. Here's an example from, sorry this is kind of small but it goes from June of this year to mid-September. We can see towards the end of September that gas prices are quite a bit higher. Meanwhile, the underlying currency is quite volatile as well. So it just changes day to day. And here's another example. When I went to generate my block city, this little building in Atlanta, notice I'm calling the same smart contract here. Zero, two, four, a same smart contract, three days apart, same cost in Ethereum but the underlying cost in US dollars is totally different. So on the first day it's $8.97 for the price and then the gas fee is $3.75. Three days later the transaction fee is $11.10 and the gas fee is only $1.24. So the overall transaction or contract file is cheaper but it's interesting how these variables move very independently. There's also been a shift in just how games are played in terms of how do we charge for games. When I was a girl you'd get your box of your game, you'd get your four disquets, your mom would install it all day and then you'd play it over and over and play it as much as you want. Now games are, they often have microtransactions. It's no longer a flat cost. So a game like Cow Flicker you've got to keep clicking on that cow and maybe you pay to turn that cow into a beef later but it's no longer and some people like that in games some people don't. It's just a different practice. It can work well in cryptocurrency though because you can pay in small chunks over time but people might run out of ability to pay. There's also a time delay. I talked about this a little bit when we were talking about summary transactions and how Axie Infinity solved it. So there's this waiting for transactions to be mined and I think the CryptoKate team did a nice job of having some cute animations and building suspense. Kind of have this ghost cat while you wait for your cat to load and that can be a little exciting like what am I going to get? So it can be an opportunity. Blockchain also is very at risk to security exploits. FOMO 3D I mentioned before let's review the rule. So when the timer ends the last player will win the pool and anyone could join the pool and the game by two minutes. However, this team at SecBit wrote this really awesome article I highly recommend and they figured out how to exploit the whole Ethereum network to win the game. They basically sent some very high cost transactions that used up all the gas and ultimately failed but they were able to prevent anyone else from calling that smart contract in the next few blocks. So you read more of SecBit's article if you're interested. It's very interesting. Another consideration is how decentralized are our games? Ethereum wasn't made to support high-finality data like images or large objects and that's not what it's strength is it's more about establishing trust and you know so some of these things it's like where do you put the artwork? Where do you put any cash data before you've loaded it onto the blockchain? Sometimes things go sour despite the best intentions you know if a development team falls apart or their servers go down how easy is it for another party to come and recreate the game? One example you know I think the Katie Hatch project looked awesome but it's no longer available in the Chrome Web Store so it's very hard to play this game now that Google said I'm not sure of the circumstances but it's not really playable. So this is not a game but this is an art project that I think does a really good job of putting a lot of the data on chain it's Auto Blast by a group called Larva Labs and these are ERC721 collectibles and these patterns are generated through a smart contract and you know not too hard for someone to build the image the image is not stored on the smart contract but the data is you could add a couple text characters and just use some code that you'd run to regenerate the image if you need. Another consideration is that Ethereum is public so who has played Dungeons & Dragons before? I love that game it's a lot of Dungeons & Dragons you want to think about information hiding so we have this character here and he's got the Game Master screen screen and he's you know if you're a Game Master you're often hiding information from people that's slowly revealing it to build a story or write an narrative maybe create some dramatic tension so you might want that in your game you know contract calls are public and people can read those people can go and read events and see the data in there even your ID is a pseudonym it's not truly anonymous so you just might consider that even games aren't real okay this next part we're going to do a little bit of a hands-on activity explaining the rules so we'll use some of the ideas that we thought about Solidity and we're going to take those and make our own games so for our purposes we're going to think about three characteristics of games so we already talked a lot about features of Solidity that might be incorporated in games and I want to dive into the detail on what the other two card categories are we're going to do a little bit of a card game kind of like apples to apples or cards against humanity okay so game categories what type of game are we playing I'm going to name a couple that might not be common knowledge just in case you draw the card so you know what it is so one category of game is called a god game and this is not in any specific religious sense this is more that you're an omnipresent entity that can control a world so in SimCity you have this sky view of this world and you can build things and decide how your citizens work and create these things rollercoaster tycoon it's just focused on a theme park and building rollercoasters one of my favorite games SimAnt from 1991 has anyone played it so good but you're basically an ant you can manage an ant colony and you can become an ant and you're fighting for control of the backyard against rival ants and humans and lawn mowers another category of game that you probably will see in Osaka is a gachapon and this is a castle dispenser it dispenses a toy it has a little bit of randomness because there's usually six different types of toys and there's even a bitcoin one I saw you can pay 300 yen to get a plastic bitcoin see if you can find it this one has the the dashi chainsaw and and then some like pre-no-shiki cats is a famous artist in Japan they're really fun and interesting but it's just a bit of random random toy dispenser okay let's talk about theme or setting this type of card theme or setting is critical to a game and a lot of story time can be told without even any human presence so I think one of my favorite games are from the early 90s my other this is probably my very favorite computer game but it's mist does anyone play mist? yeah this level channel one there's no people in it it's just this abandoned place and it's misty and kind of dark and you can see that people may have lived up above and you're just curious about how do I get in there, how do I get into that world so theme and setting is very important we can draw inspiration from the world around us so Osaka has lots of fun neon and giant puffer fish things to see there's the world of Japanese mythology you know kunyoshi prince and boys fighting fish and samurai writing toads, it's pretty surreal okay so I'm going to go through a couple examples of how the games play so we're going to have different types of cards and there's different colors and there's symbols on them too if the colors are hard to see green stars in the game category we're going to draw two of those and discard one blue cards have moon on them we're going to draw three and discard one so you have two cards left and salinity features you're going to draw two and discard one maybe you get a hand like this and you decide to pick your favorite okay I'm going to choose a racing game the theme is that it's post apocalyptic and it's about ducks and I'm using the burning function so maybe I make a game called mad cracks to the pond warrior and you know it's some hostile world where ducks have to fight for survival or get sent to 0x another example here let's take a role play game and we picked trains and Japanese mascots and we're using layering of smart contracts so perhaps I decide to use BRC721 collectibles and layer them together to build a Japanese rail network featuring cute mascots and wonderful trains and try to entice people to come ride my railway okay so now we're going to play it first what we're going to do is break into groups of maybe four to five people and you can move your chairs a little bit as long as we move the chairs back at the end of the workshop and some of us will be around to hand out decks and cards and we'll be back in a moment yeah yeah we're going to be sitting down and we'll be back in a moment yeah two of three of us yeah so we're going to go around to the chair and just try to stay he's going to join your group and see you so we're going to be choosing the first person to move the chairs and the second person to move the chairs and the third person to move the chairs and the third person to move the chairs the second person to move the chairs and you're going to be a second person so of course you can help put cards cards okay, so here's another here's another good deck take it from there so to the other right so to the person to the right I'm going to get a chair for him and he will get hearts. And then you need three of these. Three of these. So I'm going to discard one green. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm thinking. I'm thinking. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts. I'm going to get a chair for him and he will get hearts.