I have not found any place where this topic is well covered. I've been playing around with smart-contracts and trying to figure out what advantages an smart-contract has over plain logging of input parameters.
Mentally I'm just comming to the basic of software development, where I have an algorithm reading input data, processing it according to some algorithm and writing output data/results.
As I see it, if I just keep/save the inputs into the ethereum logs and then use such logs as input to any external software outside the blockchain I can keep a consistent distributed state reusing ethereum infraestructure:
Advantages of Log approach:
- No risk for buggy smart-contracts. The log have no logic or state, just "probe of fact". If the external program processing them is buggy we can just fix it.
- Much cheaper. Logging is a few weis per byte, (much much) cheaper than executing a transaction.
- Much easier to port from one block-chain implementation/environment to another (just replay the logs).
- Any others?
Disasvantages of Log approach:
- smart-contracts that depends on the current state of the ethereum block-chain (non-idempotent) or external oracles (input sources) depending on time.
- No automatic clearing for contracts using "virtual money" (ethers) as payment method.
- Every client needs to "download" the logs from the block-chain and re-process the computation (Could this be problematic / disallowed in public networks?).
- Any others?
Postcript: I tried to add the "idempotent" tag but I have not enough reputation. Still I consider "idempotent" is a very important topic for smart-contracts for obvious reasons.