the balance of an address. But that's all there is to it. Theoretically, Ethereum-based token
systems acting as sub-currencies can potentially include another important feature that
on-chain Bitcoin-based meta-currencies lack: the ability to pay transaction fees directly in
that currency. The way this would be implemented is that the contract would maintain an
ether balance with which it would refund ether used to pay fees to the sender, and it would
refill this balance by collecting the internal currency units that it takes in fees and reselling
them in a constant running auction. Users would thus need to "activate" their accounts
with ether, but once the ether is there it would be reusable because the contract would
refund it each time.
Financial derivatives and Stable-Value Currencies
Financial derivatives are the most common application of a "smart contract", and one of
the simplest to implement in code. The main challenge in implementing financial contracts
is that the majority of them require reference to an external price ticker; for example, a
very desirable application is a smart contract that hedges against the volatility of ether (or
another cryptocurrency) with respect to the US dollar, but doing this requires the contract
to know what the value of ETH/USD is. The simplest way to do this is through a "data
feed" contract maintained by a specific party (eg. NASDAQ) designed so that that party
has the ability to update the contract as needed, and providing an interface that allows
other contracts to send a message to that contract and get back a response that provides
the price.
Given that critical ingredient, the hedging contract would look as follows:
1. Wait for party A to input 1000 ether.
2. Wait for party B to input 1000 ether.
3. Record the USD value of 1000 ether, calculated by querying the data feed contract, in
storage, say this is $x.
4. After 30 days, allow A or B to "reactivate" the contract in order to send $x worth of
ether (calculated by querying the data feed contract again to get the new price) to A
and the rest to B.
Such a contract would have significant potential in crypto-commerce. One of the main
problems cited about cryptocurrency is the fact that it's volatile; although many users and