Contracts, templates, plugins, fees and IP.

Before I look at specific ideas for contracts, I'd like to raise a few points for discussion concerning the contracts that make ethereum so powerful.

Changing a contract

For obvious reasons, the ability to change a contract would be ripe for abuse. Is there any way to edit a contract once it is published, or is that only for contract corporations?

Contract execution

What order will contracts execute, if multiple users activate the same contract? If there is interaction between users, for example if there is an item for sale, then the first user will be able to buy it, and everyone's else transaction will fail. The order is very important in this point. Will the miner decide which order things are executed in, or should there be another system based on the time of message creation perhaps, or the miner fee? If you send a larger than required miner fee, I suppose that would incentivise this one being chosen, as long as the miner doesn't get fees for transactions that have no effect. Maybe for certain contracts, the miner should only get a fee from a single transaction per block, so the biggest tipper should win.

Fees

I'm not sure if I understand about contracts, fees, and balances. It says that each contract has a balance, which is depleted as the contract script executes.
Is it possible to make it so that a user has to send a minimum balance to cover the various execution fees? Any spare money would be returned.

Offline Preview

I think it would be good idea to have an offline preview for contract execution built into the client. As most users may not be able to immediately and correctly interpret the intricacies of the code in a contract, it would be helpful to be able to test what effect the transaction you send to the contract will do.
This would have no cost, as you are just using the copy of the contract stored on your hard drive in the blockchain (blockpool?).
This would let users see what effect their message will have on the contract, and how much it will cost to execute. An offline balance/contract explorer with a search function would be a good addition to the client.

Plugins

It would be great if the client supported plugins, that users could download to help them interact with contracts. The plugin could have a page that opens when you select it from a list. There are a number of input fields, which can have restricted ranges that ensure that a valid command will be sent to the contract. The plugin takes the selections, text and numbers you put into the boxes, and when you click send, it will put these into a message/transaction, with the correct syntax for the contract to execute it.
This would make contracts simple to use, even if they have complicated input conditions. Of course, you would want to be able to send the transaction to the offline preview first, to check that the plugin is correct and honest.

Templates

I imagine that there will be groups of contracts that are very similar, such as currency exchange pairs. If contract templates are published, these would make it simple to create a new contract with similar functionality. A plugin for these type of contracts (anything made with the template), could let you search for all contracts of this type, choose one, and put in your inputs for execution.

IP

I can see this being a contentious issue, but will there be any way to protect your contract code? If you create a novel application that is very valuable, what is to stop someone copy-pasting the contract, and releasing a version with a slightly lower fee? It will be easier to copy others than create original ideas, but this threat could discourage innovation. I can't see any simple solutions for this, other than community support.

I appreciate the prompt responses!

Comments

  • StephanTualStephanTual London, EnglandMember, Moderator Posts: 1,282 mod
    Great post Haposhi, just posting here to manifest my interest in adding to this later as some of the points you raise are really good. Would be great to see Vitalik/Richard comment on it, too!
  • StephanTualStephanTual London, EnglandMember, Moderator Posts: 1,282 mod
    Hi Haposhi, looks like the forum has been shut down, if you can read this contact me at [email protected] and we can discuss offline
  • VitalikButerinVitalikButerin Administrator Posts: 84 admin
    > I'm not sure if I understand about contracts, fees, and balances. It says that each contract has a balance, which is depleted as the contract script executes.
    > Is it possible to make it so that a user has to send a minimum balance to cover the various execution fees? Any spare money would be returned.

    Yes. In fact, you can see the sample contracts in the whitepaper do that.

    > For obvious reasons, the ability to change a contract would be ripe for abuse. Is there any way to edit a contract once it is published, or is that only for contract corporations?

    Only if the contract implements a code modification API.

    > What order will contracts execute, if multiple users activate the same contract?

    The order that the transactions appear in in the block.

    > I think it would be good idea to have an offline preview for contract execution built into the client. As most users may not be able to immediately and correctly interpret the intricacies of the code in a contract, it would be helpful to be able to test what effect the transaction you send to the contract will do.

    Interesting idea. We'll also likely have a (centralized) testnet up fairly soon, so you can get play-ether and try sending transactions and contracts.

    > It would be great if the client supported plugins

    That's already our intent.

    > Templates

    Also our intent.

    > I can see this being a contentious issue, but will there be any way to protect your contract code?

    Not much, beyond heavy obfuscation - but if you do that then you'll have to pay more fees and you'll lose the trust-free aspect so you might as well be making a centralized service. It will be an open source ecosystem predominantly.
  • HaposhiHaposhi Member Posts: 14
    Thanks Vitalik,

    That answered most of my questions, and things are looking good, but let me rephrase the one about transaction order.


    The order that transactions appear in the block will be the order they are executed in, but the point I'm trying to make is that miners can choose which order to list transactions in the block when they publish it.
    Most miners will include all transactions they have received, in the order they received them. However, miners could choose to change the order, or leave out transaction completely. I can see there being advantages for miners to manipulate the order for some contract transactions. Perhaps if blocks were only valid if the transactions were in some non-arbitrary order, such as by transaction fee, this could make things fairer.


    Another question has occurred to me, about the contract memory fee.
    The cost of space on the light blockchain will increase with the network hashrate, but you can recover Ether invested in contract memory. If you bought different amounts of memory at different prices, will there be a FIFO or a LIFO system for refunds? LIFO would reduce the cost of memory adjustments that decrease and increase the size of a contract.

Sign In or Register to comment.