Is it possible to schedule function calls to an Ethereum smart contract? I am wondering - is it possible to schedule or somehow trigger function calls to an Ethereum smart contract based on the current block height or timestamp? This would involve some pre-payment of gas for execution understandably, but it might be beneficial to have something like:


If current block height is 1'000'000, send 1000 ether to the block miner
If it's 2016-01-01 00:00:00, release funds from escrow


Of course those functions could be triggered by transactions at an appropriate time, but some sort of "execution scheduling" might be a useful automation of the process.
This feature can be easily realised outside the Ethereum virtual machine (and thus keeping the VM simple): Create a (reusable) contract where contracts can register to be called at a certain time (and provide a reward as compensation for the gas costs). A script can poll this contract from outside and call it at the appropriate times. The contract could be similar to the following.

contract CallbackRegistry
{
  struct Entry { uint time; address addr; bytes data; uint reward; }
  mapping(bytes32 =&gt; Entry) entries;
  function register(uint _time, address _addr, bytes _data) external returns (bytes32 _hash)
  {
    _hash = sha3(_time, _addr, _data);
    entries[_hash].time = _time;
    entries[_hash].addr = _addr;
    entries[_hash].data = _data;
    entries[_hash].reward = msg.value;
  }
  function invoke(bytes32 _hash) external
  {
    if (entries[_hash].time &gt; 0 &amp;&amp; now &gt;= entries[_hash].time)
    {
      msg.sender.send(entries[_hash].reward);
      entries[_hash].addr.call(entries[_hash].data);
      delete entries[_hash];
    }
  }     
}