You are viewing a single comment's thread from:

RE: Misconceptions about 2nd layer apps: part 1

in HiveDevs5 years ago

Anyone can run your code on their computer, connect it up to a Hive API node, verify all the game transactions, and determine who really won each game.

How would you go about verifying all the game transactions through a Hive API node? Is there a way to pull a subset of all the blockchain custom_json transactions, i.e. only those custom_json that are flagged as belonging to your game? And only for a certain set of users?

I didn't think that this kind of detail was currently possible through the API? I'd be very happy to be wrong.

Sort:  

well, if code is only streaming and verifying it would possibly take A LOT of data reading but its technically possible to verify all the transactions of the game with Hive API.

I think it's currently technically possible by:
(a) Streaming all the blocks of the blockchain and separating out custom_json that match your game criteria.
(b) Pulling the operations of each user account involved in the game and separating out custom_json that match your game criteria.

These approaches are OK if you have a centralised server for your game that can do this work and update the current game state for all players.

However neither of them is really suitable under a decentralised approach, i.e. if each game participant has to carry out this work themselves to validate the current game position. You don't want to be streaming the last 10,000 blocks to find 9 noughts-and-crosses moves.

Is there currently a better way?

Yes, you are right, that is why i said its 'technically possible' because:

You don't want to be streaming the last 10,000 blocks to find 9 noughts-and-crosses moves.

It pretty impractical to do this on some public Node (Hive API). so in conclusion the game is decentralized and if you have doubts you can always verify running your own node.. a better way? maybe this tic-tac-toe game can have a ledger & blocks storage & hash verification (like hive-engine) which would be faster since now your only looking the game transactions (but a mumbo jumbo of blockchain code witch is totally op for a tic-tac-toe game), don't know if it makes sense. the final goal is that it can't be cheated, you can always verify.

Right now you have to pull them all, but the API you're describing is also pretty trivial to implement.

That's good news. I think we would see a lot more game development if devs could just pull their own data rather than having to deal with the full blockchain.

We see this with the front-ends. The Hive API is pretty good for building a front-end, so a lot of them get built.

We would also potentially get some invention / progression into true decentralised gaming (as you outline in your article) which I think would be really interesting.

Visit my hive blog please