TL;DR an experimental emulation of Bitcoin running on Ethereum is deployed at 0xe7B3Dd2B7C81e93de6936802bc8f05b437121192 . Beginning with the start of Byzantium (block 4,370,000), miners can earn both ether and ECoin. Anyone can call issueRewards() by putting 0xf483f33b into their data field.

ECoin — A “Store of Value” Experiment

Recently, something called eBTC was released, claiming to be a tokenized version of Bitcoin on the Ethereum blockchain. Why create eBTC? From its website:

There are multiple reasons, firstly Bitcoin has issues with high transaction fees and slow block times, ERC20 tokens don’t have these issues and also have smart contract capability. Secondly, there is currently no widely accepted tokenized version of Bitcoin on Ethereum which is pretty surprising. Thirdly, as eBTC grows it will display Ethereum’s capabilities and strengthen its stance among crypto-currencies.

At its inception, eBTC was created with 21M tokens. This is the only number of eBTC that will ever exist.

eBTC has been dismissed as a scam, a joke, and a shallow attempt to taunt the Bitcoin community with Ethereum’s richer feature set. I think it’s probably all of those things, but it gets at something much more interesting. Unfortunately, eBTC is doing it wrong.

Store of Value

In spite of Ethereum’s undeniable technical superiority, the Bitcoin community has largely saved face by the fact that Bitcoin has a lower attack surface and more security. Both of these things may be technically true, but they are practically irrelevant. If you don’t want to expose yourself to attacks, keep your smart contracts simple. In fact, don’t write new smart contract patterns at all — just transfer ether or ERC20 tokens. If you’re afraid of Ethereum’s security, look at this chart — it’s hard to argue that the Ethereum network is insufficiently secure from any realistic 51% attempts.

But the one last bastion of superiority that Bitcoin can claim is its “store of value”. This is one point that I will concede. Bitcoin’s fixed 21M supply is much more appealing than Ethereum’s currently unbounded issuance curve. Yes, Casper may cap the supply, yes EIP186 will reduce the issuance rate (I argued strongly in its favor), but the fact remains that right now the inflation trajectory approaches infinity.

However, I’ve never found the “store of value” argument convincing. Recently I’ve noticed others sharing this sentiment: Bitcoin can’t only be a store of value because then it’s basically just a Ponzi scheme (relevant article here). Bitcoin needs to have some utility, which in my opinion it does have. But with the advent of other sufficiently secure cryptos that have faster confirmation times and more functionality, the advantage of Bitcoin is no longer clear. With the rapid adoption of Ethereum’s ERC20 standard and decentralized exchange protocols like 0x and SWAP, we really can tokenize Bitcoin on Ethereum, but not like eBTC.

A Dynamic Issuance

Where eBTC immediately failed was in issuing all 21M tokens on Day 1 and handing out tokens to random accounts that did no work for them. eBTC is not a tokenized representation of Bitcoin because the supply of Bitcoin is always changing and it takes real work and capital to earn bitcoins through mining. A truly tokenized BTC needs to offer a dynamic supply. Below is a solution:

uint issuanceBlock = (block.number - 4370000);

uint maxReward = 125000000;

uint divisor = (issuanceBlock/8400000)+1;

uint blockReward = maxReward / divisor;

Beginning at block 4,370,000 (a.k.a the Byzantium starting block), the starting reward is 1.25 tokens. Why this number? Since we’re measuring Ethereum blocks, we must keep in mind that we are going about 40x faster than Bitcoin (Ethereum~15sec, Bitcoin~10min). Thus, the initial Bitcoin reward of 50BTC should be 40x lower, or 1.25. Also note that bitcoin has 8 decimal places, so this token should have the same number.

The reward gets halved every 8,400,000 blocks, or roughly every 4 years. Again, since Bitcoin halves every 210,000 blocks, we just multiply that number by 40.

But who gets the block rewards? Well, the miners of course. The Ethereum miners.

Merge Mining

In Solidity, you have access to the miner’s address in the current block with block.coinbase . Seems easy enough to give the miner (who put in real work securing the Ethereum network) some tokens:

function issueReward() {

uint issuanceBlock = (block.number - 4370000);

require(lastClaimedIssuanceBlock < issuanceBlock);

uint maxReward = 125000000;

uint divisor = (issuanceBlock/8400000)+1;

uint blockReward = maxReward / divisor; // Multiply any unclaimed rewards

uint multiplier = issuanceBlock - lastClaimedIssuanceBlock;

uint totalReward = multiplier * blockReward; // Sanity check

require(totalReward > 0); // Update balances

balances[block.coinbase] += totalReward;

totalSupply += totalReward;

lastClaimedIssuanceBlock = issuanceBlock;

}

Anyone can call this function on any block — it simply finds the miner of the current block, gives that miner some tokens, and increases the total supply. It can only be called once per block, because lastClaimedIssuanceBlock must be smaller than issuanceBlock . If there is were any value to this token, you would expect miners to include a transaction invoking this function in every block, but until then anyone can bootstrap the success of this token by calling issueReward() periodically (if you’re interested, use 0xf483f33b in your data field).

If one or more issuanceBlocks don’t get claimed, the rewards stack up. If, for example, no one issues a reward for 5 blocks, the next recipient gets 5x the reward. Yes, there is an attack vector — if no one cares enough to call this function, a miner could wait a very long time and scoop up a 1.25 token reward multiplied by many unclaimed issuance blocks, even if the halving had occurred. I suppose we’ll find out if this is a problem in 4 years or so.

It’s Alive!

By adding dynamic issuance and merge mining, we have just recreated Bitcoin on the Ethereum network. Now we have a token that is truly a “store of value” and sees the same benefits as other ERC20 tokens on Ethereum. There will only ever be 21M tokens (probably), no one controls the issuance, and there is no pre-mine.

As an experiment in this notion of “store of value”, this contract was deployed to the Ethereum main net here. Anyone is welcome to issueReward() to the miner of the current block or redeploy the contract yourself.

We must give this thing a name. I suggest “ECoin” — an unfortunate name collision with the EvilCorp product, but also a fitting mishmash of existing terms. If there is merit to this notion of “store of value”, then ECoin should theoretically be valuable; it is bitcoin with faster confirmation times and more functionality. It can only be earned by doing work. If it is valuable, then perhaps it can be a hedge against the possibility of infinite ether inflation.

Perhaps proof-of-stake will never come. Perhaps it will be what solidifies ether itself as a “store of value”. Either way, we will have ECoin.