Learn to Code Ethereum DApps by Building Your Own Game
cryptozombies.io
cryptozombies.io
1. Blockchain games are best when only the necessary work is done on chain, such as transfer of ownership or enforcement of critical rules at run time. This tutorial may not show that so as to demonstrate the power of the blockchain, but most people in the space are building only the components players want to not be controlled by a central entity into the blockchain. It works fine.
2. The lack of digital scarcity is a real problem for artists. Blockchain art is a real solution. Artists I talk to are extremely excited about the ability to issue limited/special editions of their art on the blockchain that can owned and traded by their biggest fans. It's not about hiding the source art (image, music, etc) from the public, it's about having "signed" and "authentic" editions folks can collect and trade. They've lost that ability in the digital art world and this gives it back to them.
collectors and tax avoiders like to invest in scarce art (hence why they only assign big made-up values to the work of dead artists) and so they will be the only ones really interested in maintaining a block chain to authenticate their investment.
In the realm of gaming, digital ownership of in-game assets is one area we're really excited about. Economies have already sprung up in many online games around selling items for real-world cash. With something like ERC721 tokens on Ethereum, you would truly own your items outside of the company's web server. No one could take them away from you, the items could be provably scarce, and you would have full control over selling or trading them on decentralized marketplaces (in a secure way).
Or take collectible card games like Magic the Gathering — these types of games are an ideal fit for the blockchain for the same reasons as above — rare, collectible, and tradable assets with a real-world value.
You could even have multiple games or apps that read the same crypto assets. This means you could build a new game, but use the assets of an existing game with a large user-base. You would be able to tap into a large community of players who could instantly jump into your game world with their existing characters. This lends itself to some really interesting new possibilities — imagine a World of Warcraft type game, where players were playing in the towns and worlds created by players of a totally different MineCraft or Sim-City-like game. Two sets of players playing entirely different games, but they could be playing in the same game-world where their actions have real effects on the other game through decentralized shared data.
As you mentioned, there are currently serious limitations for how much can be done on-chain. Our solution to this scalability problem is have DApps run on their own sidechains. So the in-game tradable assets would be hosted on Ethereum, while the heavy game logic and the rest of the client would live on a sidechain. This way the entire game would be running on a blockchain instead of only a small part on chain and the rest on a centralized server.
One of the huge benefits of a game running on its own blockchain is forkability. There have been plenty of examples in games where the developers released a change that nerfs a favorite character or spell, or the creators shut down the server entirely and stop supporting it.
If the game were running on its own blockchain, the users running nodes could reject the software update and hard fork. They could continue running on a legacy version of the client indefinitely, so long as there were still nodes running it. Basically the entirety of the game data is stored on the sidechain, so both sets of nodes could go their separate ways and play the version of the game they prefer. And no one could shut down the game server as long as there were nodes willing to support it.
For those who are interested in more info, here's an article that outlines some of the motivations behind sidechain-based games and community sites and what we're building: https://medium.com/loom-network/million-user-dapps-on-ethere...
CryptoZombies is just intended as an intro to building apps on Ethereum to get more developers in the space. Up until now the focus on blockchains has been on financial apps, but we think the potential is much bigger than that. We're betting on games being one of the first areas to bring blockchain tech to the mainstream, and we hope CryptoZombies inspires developers to get onboard!
The DAO fork.
Sorry, but the Etherium team/chain/community has no credit when it comes to irreversibility.
But I don't buy this argument for video games. Most of the game code ought to live outside of the blockchain and that non-blockchain code/art would be difficult to reproduce let alone subject to copyright claims or closed source.
Another random video game thought: Would item storage on blockchain mean that every player could see the inventory of every other player?
It's worth noting that you can achieve semi-privacy through either on-chain/off-chain hybrids, as well as some other emerging efforts.
One example I've been playing around with is to use the multi-address approach:
In your database each "player" consists of multiple addresses each which are OR-multi-sig wallets, for various inventory elements and stats.
When they log in via a system like metamask, their main wallet (PlayerID) is unlocking an account which in your games database (off-chain) ties together another set of "master wallets" together with you've given the player private keys for - for each item, or each set of X items, in the players inventory you are setting up a new smart contract that is a OR-multi-sig wallet.
For this wallet, which holds the item, there are two possible signatories the first being the game's main contract, so that the game can add/remove items from players based on game events, and then one of the players private keys.
While you'd likely need a custom fork of metamask to handle the multi-key environment, you've made a system where:
* Player's inventory cannot be know from one private address.
* Player's retain full control over the items.
* Player's have private key access to the items in case the service goes down.
* You store player data off-chain, but in a way that your service is not crucial to the game.
* Player assets can be traded off-game without updating the game service.
* Data about individual items is still public, and does not need to be obscured, oraclized or stored off chain.
The current blocker isn't any specific blockchain technology, but just having a good multi-key management UI for users.
Every participant has the choice to stick to the old protocol or use the new one. Or use both.
If I create a Bitcoin fork tonight and somebody buys 0.1 Bitcoin from me in the forked chain, what's wrong about that? The price of Bitcoin my forked chain would obviously be another matter.
The scarcity is in the platforms, not the digital assets.
If you say it’s the one with the greatest market cap, then you’re agreeing with me that blockchains don’t provide scarcity and assets can be copied, albeit on blockchains with less liquidity.
Furthermore, the subjectivity of what is the “real” blockchain means an artist can believe she owns an asset on ChainA, only to see ChainB become the market leader but her asset is now owned by another individual.
We have failed to solve the problem the parent poster supposes blockchain can solve...
On the off chance you weren't thinking of the same type of game I am, I'm thinking of a massively multiplayer online game, not a single player game.
I get the interesting aspect of creating a game with a limited supply of some virtual good, but how much energy does it make sense to put into a game of this nature when the underlying platform prevents your game from becoming successful (because it can’t handle that kind of load)?
I suspect there’s a genuine use case for limiting the supply of virtual goods in games, but I doubt the solution involves all games performing state updates using on-chain transactions in a single, shared blockchain.
Every developer interested in making (a lot) of Easy money by riding the crypto bubble. Maybe the question should be what gamer would be interested in paying for such a game (i.e. paying significant sums for pictures of cats and paying more at every turn...you can’t even give a picture of a cat away free without paying gas), but the answer is the same...any gamer wanting to make money off the cryptobubble.
Blockchain can be marketed with terms like immutable, decentralized, and smart contract all anyone wants. However the reality is it’s all a race to the bottom based on greed and speculation.
In my eyes, it's dangerous to crypto that advocates spout absolutisisms about crypto. With a fledgling technology and market, anything is possible, and we should be honest about the fact. Otherwise, you risk blowing up expectations to where a potential crash back to reality gives everyone an irreparable distrust and dislike of crypto anarchists akin to that of Wall Street bankers.
And then the powers that be will mock anarchism for it's corruption and greed, paint the technologist as a devil, and write history books warning of the folly of decentralization. Anarchy is dead, long live anarchy!
So maybe the last part was overblown, but in seriousness, when people lose a lot of money, they get very angry. I'd hate to be the ideology at the receiving end of that anger.
It’s all fun and games until the IRS comes knocking at your door for failing to pay taxes on each and every cryptokitty transaction.
People thought blockchain and Bitcoin was a way to escape fiat...turns out mining is taxed as ordinary income, investing transactions as capital gains, and the IRS only accepts fiat.
People thought Ethereum smart contracts were a way to escape the legal system (the code being Law and all)...turns out people could’nt trust these smart contracts to do what they thought and were marketed to do (DAO); turns out the code isn’t the Law because the parties to the smart contracts could just fork and break the contract; and it turns out the SEC can actually regulate and prosecute ICOs that violate securities laws.
Who wants to file a tax return and pay ordinary income on every cryptokitty they birth or capital gains on every cryptokitty they sell?
Maybe I can get ahead of the ball and start offering “stripe atlas for self directed IRA LLCs for tax free cryptocoin/kitty trading”.
However, nothing currently exists that seamlessly handles scenarios like cryptokitties, or when tokens are automatically bought/sold behind-the-scenes of a dapp via 0x, etc.
Ethereum is still in it's infancy today and it does indeed have a very slow processing power and speed. But you can bet on the fact that it will improve exponentially.
Do you remember the first hard drives? 56K Internet speeds? IE6 browser? So many challenges have been overcome during the last decades in tech, why would it stop here?
There is a lot of brillant and very-well funded people working on the subject and they will find solutions to improve the platform. No doubt about it.
I always find it odd that such a tech-craving population as HN readers always seem to miss the bigger picture.
That’s not a fair comparison, in my opinion. A billion NES consoles can operate in parallel, without affecting the performance of other consoles. It scales perfectly. For a shared blockchain, however, performance deteriorates for you when someone else plays. And it doesn’t even have to be the same game. I mean, if a single game like CryptoKitties can reduce performance and increase fees, how will it look when there’s 10 games out there, or 100?
> I always find it odd that such a tech-craving population as HN readers always seem to miss the bigger picture.
I’m not saying this can’t be solved in the future. I’m talking about the present motivation for building blockchain-based games. Why can’t we critique technology just because it has the potential to improve in the future?
There's an inherent tradeoff between performance and decentralization. The major blockchains like Ethereum focus on decentralization above all else, because it's extremely important for a cryptocurrency where there's a real financial incentive for someone to attack the network. Performance is important, but shouldn't come at the cost of decentralization. There's a ton of smart people working on scaling Ethereum, and they will scale, but not to the level required to run WoW and Twitter simultaneously on the mainnet.
Which is why we think scalability will be achieved through sidechains. A sidechain can play by its own set of rules. Something like an online game or community on the scale of Hacker News needs to optimize for realtime performance, but can make reasonable tradeoffs for security — on a blockchain data integrity is already ensured by cryptographic signing, and you can't "double-spend" a comment or post, so there's little financial incentive to attack the sidechain to delete a historic comment.
I'd say the motivation for learning to build blockchain-based games now is because the infrastructure for this tech is coming very soon. We're in the process of building out one game as a demo to showcase Loom Network, and are talking to a couple other game studios who want to build games on our platform.
Things like CryptoKitties may just be a novelty right now, but they're paving the way for new types of game economies that that we've never seen before.
What makes more sense right now, for many games, is to put most of the state changes off-chain. If players are taking turns, they can sign the state changes as they go, and submit the final couple moves to the blockchain. Add in another trick and you can even make fair random numbers: http://www.blunderingcode.com/gamble-channels-fast-verifiabl...
This is how FunFair works; there's an on-chain transaction to deposit, another to close out and withdraw, and in between you can gamble all day without waiting for blocks or issuing transactions to the blockchain.
I’m not saying it’s impossible, of course, just that a lot of really smart people have been working on this problem for almost a decade, without having a production-ready solution yet.
A good discussion of the challenges is at their sharding FAQ: https://github.com/ethereum/wiki/wiki/Sharding-FAQ
Isn't that the approach taken by the Lightning Network for Bitcoin?
I think it's totally fair to say that Lightning technically isn't production ready, but it does seem to be in the late stages of testing / early release candidate stage of development.
This is the same way that the lightning / plasma network works, right?
In the case of a game, this might be simpler since you can have each player sign their own moves and the other player's last move, so that you can always broadcast your opponent's last move if they quit.
http://www.blunderingcode.com/a-lightning-network-in-two-pag...
So perhaps you have a game where you play for several hours or even days and only then eventually you want to save your progress on the blockchain for the world to see. Just an example.
As seen with CryptoKitties the high transaction cost is a crippling factor right now, on the other hand the game wouldn't even be possible in its current trustless design without the blockchain.
Is it really a “trustless” game? If the company folds and the website with it, sure you still have your “CK Tokens” in your wallet, but without the centralized platform you can’t exactly access the picture of your kitty, you can’t breed, you can’t sire, you can’t gift...in other words you can’t even transfer the “CK token(s)” from one wallet to another without the platform. Therefore it seems there is a whole lot of trust the platform will continue to exist, not to mention the value of the kitties is constantly subject to change, not just on a free market basis, but based on the rules and prices which are unilaterally set by the centralized company.
Yeah the game would lose 99.9% of its potential userbase without the front end, but if the remaining 0.1% wanted to build a new web interface we could and the game could go on. This may seem similar to spinning up a legacy WoW server, but the difference here is that we’d still have our own actual kitties and no be able to cheat the system so the game integrity remains in the blockchain version.
There's many, but none of them include blockchains. Being "distributed" isn't a valuable enough attribute for games to make it worthwhile. What you get is stuff like CryptoKitties, which isn't a game but is just trying to be more speculation.
I think this could give Hearthstone et al. a run for their money.
On the other hand, once the contract is deployed and the code open sourced, you can pretty much prove that you cannot manipulate your own creation anymore. It will probably be even better once there are other languages than Solidity to develop for the EVM.
I wrote a blog entry about my experiences and the second iteration on another platform at medium: https://medium.com/@jraedisch/the-path-to-sudokoin-6aee92cfa...
Right, and there are people working on the blockchain level with very compelling bandwidth improvement solutions.
You might find one interesting, take a look.
There are people making silly games right now on the understanding that the infrastructure they are building on will improve. These people are doing this because it helps them understand the toolkits, language and infrastrcture, which has a massive upside in their opportunities by merely exposing themselves to it now. When the infrastructure is already there, and the books exist, and the college kids are learning it at state schools, the opportunities won't be nearly as great for them. And yes, they can be wrong!
But it isn't as simple as you (and everyone other competent full stack engineer) questioning their life choices and being the only people to notice that the underlying platform has an uncompetitive limitation right now.
Time will tell which one is safe. If the rewards are high enough, someone powerful/knowledgeable will inevitably try and break or cheat the system.
† Some people like to make a distinction between "distributed" and "decentralized". For me the former is part of the latter.
You can totally build something Cryptokitties with NEO -- the only difference is that because there isn't a standard, there isn't a third-party marketplace for these assets. (i.e., there's nothing inherent about NEO that prevents something like Cryptokitties from being built.)
If you take a look at who's actually working on all the cryptocurrency projects, a lot of the hardcore developers are probably older than you because they came from the "cypherpunks" era, almost around the dot-com times.
I'm not talking about the scammers building ERC20 tokens. I'm talking about legit cryptographers who are building stuff.
Anyway, this is incredible.
All of which begs the question, why am I a fan of the game? There’s the fact that I feel now like I’ve invested a couple grand in the game ... but that’s my irrational brain again. Some slightly more rational reasons include that working with the community to crack the genome and build tools to help make smart breeding and buying/selling choices has been a ton of fun and very educational. Also just deep diving into the game mechanics in a way I couldn’t have truly appreciated from the outside looking in has been a revelation: many people complain that this is not much of a “game,” and of course they’re right, but there’s still a ton of careful consideration that went into developing each aspect of what exists, including how new genes are gated through release of new kitties and a breeding algorithm with special mutations that require particular gene pairs to breed. And then there are fancies, which a cat becomes when it meets certain minimum requirements such as being Cloudwhite, with a Scarlet pattern, and having a beard along with a hidden “wild” trait: all of which, when combined on the same kitty, produces a (relatively) valuable Santaclaws kitty.
Also, I really don’t need a new crappy old car. I’ve already got one of those. And man those kitties really are adorable sometimes.
hyper ledger is a (generic) term for a ledger for the internet blockchain era :-).
Copycats uses the ledger-lite (open source) library [1] - the tagline reads: hyper ledger book for the distributed blockchain internet era; add your transactions one block at a time; transfer crypto(currencie)s or collectibles (e.g. kitties or cats) and balance the accounts (that is, who owns what etc.)
This an online IDE to play around with Ethereums Solidity language: https://remix.ethereum.org
Throw it in a database that is owned by a virtual-kitty-selling company. Yeah, it's not decentralized. So what? It's a game! IMO the blockchain should be for important (financial/legal/real estate/?) transactions.
If you wish to experience the hype first hand. There's a show, perhaps the first of its kind, happening in NYC this weekend. With the founders of CryptoKitties, RarePepes, DADA, Cryptopunks, Decentraland in attendance.
Rare Digital Art Festival, Rise New York, 43 West 23rd St, NYC, Sat Jan 13, 9am
And also is there a tutorial on how to download the whole ethreum blockchain and parse it to a databse for analysis purposes?
There is the BitcoinTalk forum for announcing your new super token https://bitcointalk.org/index.php?board=159.0
Voila!
I'm (self)-interested in learning about Enigma[0]. It's an off-chain solution for scalability & privacy with regards to systems of blockchains (blockchain agnostic).
It also has the capacity for its own dapps. The Enigma product isn't completed, yet there is a working product on top of the protocol called Catalyst[1] (I've not personally tried Catalyst, yet). Catalyst is a trading app for quants.
Enigma is supported by MIT, & has Alex Pentland as an advisor.
There's more to Enigma than what I've just outlined. 1) There's the data marketplace component. 2) It could also conceivably become a secure data processing layer for the Internet. I think it can be used with different protocols. I've yet to figure that out.
[0] https://www.enigma.co [1] https://enigmampc.github.io/catalyst/