Examples: query, "exact match", wildcard*, wild?ard, wild*rd
Fuzzy search: cake~ (finds cakes, bake)
Term boost: "red velvet"^4, chocolate^2
Field grouping: tags:(+work -"fun-stuff")
Escape special characters +-&|!(){}[]^"~*?:\ - e.g. \+ \* \!
Range search: properties.timestamp:[1587729413488 TO *] (inclusive), properties.title:{A TO Z}(excluding A and Z)
Combinations: chocolate AND vanilla, chocolate OR vanilla, (chocolate OR vanilla) NOT "vanilla pudding"
Field search: properties.title:"The Title" AND text
Answered
How much logic can be feasibly put on-chain?

If I want to make a board game, in order to show the fairness of the game, I put all the back-end computing on the blockchain.

A board game could require randomness and a lot of logic, could this still be done on-chain?


This question was imported from Telegram Chat: https://t.me/tondev_eng/9469

Votes Newest

Answers


It is definitely feasible to implement the logic of your game as a smart contact and then it’s guaranteed to be secure for all users.

Each transaction to change the game state will cost a few cents as gas. If this cost is an issue (for example your game has tens of thousands of transactions per player), then you can use payment channels to reduce this cost.

One of the interesting things mentioned is randomness, which is difficult in the Web3 space. A verifiable randomness function (VRF) is difficult to make on TON, and the randomness generated on-chain is influenced by blocks' validators.

https://ton.org/docs/participate/own-blockchain-software/random#how-does-block-seed-affect-random-in-contracts

You may want to create an oracle for these purposes.

1
1
Posted one year ago
Jeremy
384 × 5 Administrator
16K Views
1 Answer
one year ago
one year ago
Tags