0

Total newbie to blockchain. I want to use ethereum to store information and not so much currency. For example, I want to create a game where I can store someones point. Can the wallet address store any other value other than ETH? can it store someone's point?

for example player A plays a round of game, gets 1500 points. I want to add the 1500 points to his account and have the moderator do a getbalance, on every account to see who is in first place.

Obviously I can name name the "wallet" points, but from my understanding the gas uses the same currency as the "Wallet", that way the point balance gets diluted.

The other way around is to send empty messages and parse the blockchain network for the messages send to that particular wallet, and su up the points.....but there has to be a more efficient way.

Any suggestions will help. thanks.

0

The wallets by default can not show such points beacuse for that they need to know you abi and what are functtion params. You still have few option:

  • Design your own wallet

You can design your own wallet and access your contract the way you want it. The overhead is, you need to have a geth node running, if that is not a problem, go with this. The advantage of having your own wallet is you can access any feature you want and can add/update later on. LIke if you want to show highest scorers as well.

  1. Create ERC 20 token for points

If you don't wamt to take step for wallet development, you can create ERC-20 token for points. 1 point = 1 token. You can also make sure peoples can transfer thier points to others just like any currency. The advantage is you can hold them in wallet of your choice liek MEW, Metamsk or even in hardware-wallet.

from my understanding the gas uses the same currency as the "Wallet", that way the point balance gets diluted.

No. The gas is always paid in ETH, your points will never deplete. You can not get rid of gas in ethereum Either of both approaches need ETH to be functional.

0

You're missing a fundamental idea, and as soon as you understand it, everything will come clear. The idea you're missing is the idea of the smart contract. The account or wallet you mention is a regular or external account and can hold ether. It has a public/private key pair. You personally hold the private key, and only you can sign messages (i.e. make transactions) on that private key that allow the ether to be moved around.

Another kind of account, and the kind that you need to grok, is called a smart contract. A smart contract is an account, in the sense that it can also hold and spend ether, but it's different than an 'external' account. No-one owns the private key of a smart contract. No-one can control it directly other than by sending it transactions (function calls) from an 'external' account.

Smart contracts, in addition to holding ether, and different from external accounts, also hold state. The idea of state is what you're looking for in answer to your question.

In your case, you can 'store' the points in a smart contract's state. You program smart contracts with a programming language called Solidity. One of the constructs in Solidity is a map. You can store the points in a map indexed by your user's accounts. One deploys a smart contract by sending a special transaction carrying the compiled Solidity code from an external account.

Not to get too complicated, but you'll probably come to realize, after time, that storing a lot of state on the Ethereum network can be astronomically expensive, and you'll seek out other solutions such as storing the actual state data on IPFS and storing the only the IPFS hash on the smart contract, but that's an issue for a later date.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.