Ethereum-based tokens are intrinsically bound to Ethereum. Any token transaction would be in the form of a valid Ethereum transaction, in a block on the Ethereum chain. (see footnote)
It's entirely possible, as you've seen, to reward miners in a token for including a token-related transaction. This would indeed probably require modifying mining software, although in a future where tokens are common this might become a default setting. Either way, a token miner would also be an Ethereum miner. There'd be no way to mine only the tokens--nor, really, would there be any reason when you could get 5+ ETH per mined block for no extra effort.
At the moment, token transactions are payed for in ETH, which any miner would accept. The problem with paying solely in tokens is that even if someone will include the transaction, no unmodified miner would. That's why, as far as I know, there are no token-based fees currently in common use.
Footnote: An Ethereum smart contract could host a sidechain, and then the sidechain would have its own kind of miner. That said, sidechains have less use in Ethereum, since you can write contracts to have most sidechain features.
At a high level, the main parts of ERC20 specify:
1. how tokens can be transferred by its owner
2. how tokens can be transferred on behalf of an owner
3. how to get data about the token
4. events about the token
The first specifies the obvious requirement that tokens must be transferrable, and what ERC20 defines is that you would tell the token contract to transfer
some number of your tokens to someone else. You would not tell a token contract to "send" or "give" tokens to someone else: the term ERC20 chose is transfer
.
The second part allows you to approve
someone to take some number of your tokens and transferFrom
you to someone else.
It's less obvious why that's needed but it helps in some workflows. For example, one goal of Ethereum and smart contracts is "veridical computing" and a way for this to happen is for someone to publish their contract which says: "if you approve
me to use some of your tokens, I will give you X". X could be another token or "smart property".
Now you can read that contract, approve
the contract and execute the contract. As part of the contract execution, it will transferFrom
your tokens and deliver you X. If the contract did not have those terms, you had full control to not approve and execute it in the first place.
This is different from giving the contract your tokens first, and then asking it to deliver X. You don't give someone something and then ask them to sign a promise to deliver you X, because they might take your tokens and ignore your request for X. (There's ways that the contract can be made to keep its promise, but the workflow could be more complicated.) You can see that the type of contract by me "If you give me T, I will give you X" is simpler than you writing a contract for "I will give you T, but you must then give me X": the former is a promise by me and your choice to accept or not; the latter is written by you and I need to accept first before you do anything.
If you approve
someone, you or they can find out for how many tokens, by checking their allowance
.
The other parts of ERC20 allows anyone to get data like the name
, symbol
, totalSupply
of tokens, as well as the balanceOf
an account.
Finally, ERC20 specifies the format and meaning of certain events, for example a Transfer
must indicate firstly the sender, secondly the recipient, and thirdly the number of tokens. User interfaces can then take comfort that what they display to users will make sense for tokens that comply with ERC20.
The finalized ERC20 is at
https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
Best Answer
At this very moment, it would take a gas price of about 80 gwei to cost $30 for a standard ERC-20 token.
I would suggest you lower that to about 21 gwei, which is about average for a quick confirmation, costing you about $8.
Based on data from http://ethgasstation.info/, you can go as low as 2 gwei and still get a confirmation (could take several hours) and pay only about $0.75.