I'm looking to run a private Ethereum blockchain. But I wanted to check first, is it possible for an account to hold multiple custom tokens?
For example, can an account hold tokens that denote very simple points(e.g. 100 tokens = 100 points), and another token that is unique (e.g. collectable once only). This is an example with 2 kinds of tokens, but there could be more.
Best Answer
Yes. You can run multiple custom tokens on a private Ethereum blockchain.
There is a token standard ERC: Token standard #20 that standardises the methods and events for a token smart contract on the Ethereum blockchain. You can find a list of ERC20 compliant token contacts on the Ethereum mainnet blockchain at https://etherscan.io/token-search.
Each ERC20 compliant token contract should have a data structure like the following to store the user's account and token balance:
Each ERC20 compliant token contract will have the following methods to:
Query the token balance belonging to an address
Transfer the token balance from one address to another address
Here's a simplified token contract based on The DAO's (with the USD 50 million bug) source code:
As you will see in the contract code, your address will just be a entry in the smart contract mapping table. You can have multiple token contracts, each with their own mapping tables. You can have the same address existing in the mapping tables in one or more of these token contracts.