I am new to both Blockchain and Smart Contracts. My use case is to design a contract which can be mined in a way so that, if any user of blockchain sends ether to another user using any type of wallet, contract should be triggered automatically and perform some action - say sending part of ethers to other user or owner.

Basically I am looking for some documentation , or help for designing a smart contract which should be executed automatically on the even happening on blockchain - transfer of ethers in this case. User should not need to interact with contract, instead contract should identify event to act upon.

  • If you're asking for a contract that monitors events of other contracts, you can't. A contract can't monitor other contracts like that and a contract can't do anything on its own - someone always has to call it for it to do something. – Lauri Peltonen Jul 13 '18 at 15:21
  • I do not want to monitor other contracts events. Take a simple use case. I am an owner of blockchain and what I want is , whenever any user of this blockchain sends ether to other user, owner should be able to cut some amount as commission or fees and those should be transferred to owners address. – Chetan Bhise Jul 14 '18 at 15:37
  • Like a block reward for miners? – schemar Jul 14 '18 at 20:27
  • Not really. Its like commission for each and every transaction for a single person. Each transaction will have some of its amount cut and transferred to some third party or say contract owner. – Chetan Bhise Jul 16 '18 at 14:09
  • You'd have to alter the protocol by forking an ethereum client like geth and altering its internal code. This cannot be done with smart contracts – Henk Jul 16 '18 at 19:03