I have made my own cryptocurrency. And I am thinking about rewarding the miner who mines the transaction related to my contract. Thus, I am thinking about adding balanceOf[block.coinbase] += 1; at the end of each function. Is it the right approach?

Moreover I have found at https://www.ethereum.org/token#proof-of-work that you can tie proof of work to your coin supply. Is it necessary to add additional proof of work when ethereum already have Pow security model? Or I need to change my approach?


So let me restate it: every time a function of your contract is called (therefore a transaction to a function to your contract is mined and the function is executed by all miners and included in the block) the miner should get a reward in your currency. Yes the addition of balanceOf[block.coinbase] += 1; is the right way to achieve this. Obviously you will have to add also a withdrawal function for the miner to reclaim its tokens.

As the text you are refering explains this is sort of a merged mining, where your currency profits from ethereum hashpower. It is not necessary to add further proof of work. But you can if the use case seems attractive to the goal of your cryptocurrency.

| improve this answer | |
  • What sort of "goal" do you mean? What target can be achieved by adding additional proof of work? – Sukhmaninder Jul 11 '16 at 8:06
  • not only proof of work, but any variety of proof of ..., you can implement proof of stake to increase the incentive to collect lots of tokens and keep market price up. Or you can do a specific proof of work to incentivise distributed computing of DNA sequences, for example. – Roland Kofler Jul 11 '16 at 8:13

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.