2

I am a software engineer with blockchain background and I am new to the exciting Ethereum project. One thing I am not quite sure about is how Ethereum solves the trust problem between involved parties. Specifically, who can execute the contract? What if the owner of the contract does not execute it? Even if the contract will be executed as it is programmed, it does not matter if it is never called.

2

If you program your contract such that it has an owner and only its owner can call it, but other people benefit from it being called, the people who need it called will have to trust the owner to call it. For this reason, people don't usually program contracts such that only their owner can call them, unless the owner is the only person who benefits from it being called. (In many contracts, there is nobody in the role of "owner" in any case.) Usually you program the contract such that the person who benefits from it being called can call it.

If calling the contract requires a lot of gas, but the benefit of calling it is spread among many different beneficiaries, you may want to program the contract to refund the gas cost, or even provide a bounty, to whoever calls it. This can be a little bit tricky as the gas price needed to call a contract isn't knowable in advance, and you can't just rely on the amount spent in that particular transaction as the caller may be the miner who mines it, and thus profit from an unreasonably high fee. One strategy is to make the bounty payable gradually increase with time. People will have an incentive to call it as soon as it can be done profitably in case somebody else beats them to it.

| improve this answer | |
2

You're conflating owning a contract and deploying it on the Ethereum network.

Once a contract is deployed, every miner 'runs' it from then on every time someone (or some smart contract) sends it a transaction. There's no stopping it.

You can 'invent' an owner by recording the address that initially deployed it (or any other address for that matter). Thereafter, inside each function of the contract, you could check to see if the 'owner' is the initiator of the transaction. If the function 'throws' for all addresses other than the 'owner', then you have a sort of ownership.

Search around the web for the isOwner pattern or the owned smart contract.

In some sense, a smart contract is similar to an API, but because it is deployed and running independently on all nodes, no one party can be said to 'own' it.

| improve this answer | |

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.