The origin of Decred

13 minute read

Updated:

Decred is a cryptoasset that uses its own blockchain, all of its code is open source, and its protocol has a lot in common with Bitcoin’s. Decred’s original developers developed Bitcoin’s btcsuite, a set of applications written in Go language, from which the Decred code derives.

Decred was designed because the developers saw several serious organizational problems in Bitcoin, the main ones being:

  • the way decisions are made in Bitcoin network through proof-of-work (PoW) mining;
  • network funding; and
  • project governance

1. btcsuite/btcd

Btcd was developed because having an alternative to bitcoind (the original Bitcoin daemon) would increase the diversity and resilience of Bitcoin’s ecosystem and infrastructure.

Go language was chosen because it takes advantages over C or C++, the most important of them being the test infrastructure. By having a robust testing infrastructure, all code can and shall have test coverage. This test coverage ensures that most errors will be caught early in the development cycle, before they cause widespread problems. Test coverage has always been something taken seriously because btcd is a financial software and errors can make people lose money.

As explained before, the decred/dcrd (Decred blockchain server) repository is a btcsuite/btcd repository fork, as well as decred/dcrwallet (Decred wallet) is a btcsuite/btcwallet fork. A fork means that a copy of the original repository of the source code was made and then changes were applied creating new versions, which may or may not have been applied back to the original repository, depending on the compatibility and interest of administrators.

Figure 1 - Source code repository fork
Figure 1 - Source code repository fork

The importance of btcd in the cryptoasset ecosystem can be verified on the btcd forks page on Github, which shows that the blockchain server of many projects derives from btcd.

2. Hybrid PoW/PoS mining

The notion of PoW/PoS hybrid mining is critical to understanding the next few paragraphs, so a brief introduction is necessary. A consensus system that uses only PoW is subject to a number of issues:

  • denial of service via mining empty or artificially small blocks;
  • censorship by not including certain transactions in blocks; and
  • miners having the ability to block or force consensus changes.

In PoW mining there is a dispute between miners (who want to centralize mining to increase their decision-making power and consequently their profit to the detriment of the ecosystem), large companies and brokers (who seek to improve business-supporting features) and investors (who use the network as store of value and means of exchange).

One way to look at this situation is to see PoW as a single authentication factor for the consensus system, where PoW is usually executed by a small number of entities that do not necessarily represent the rest of the system participants. Although this process is fundamentally decentralized, practical issues lead the PoW mining process to be very centralized, similar to trusted third party systems such as banks.

A hybrid PoW/PoS mechanism creates a two-factor authentication consensus, in which PoS miners can vote for or against the previous block mined by a PoW miner. If a sufficient number of PoS miners vote against the previous block, the PoW reward of that block can be reduced or eliminated entirely, which means that PoS miners act as a check on the behavior of PoW miners. In the scenarios described above, PoS miners can vote against PoW miners’ blocks that they disapprove of, providing a clear incentive for PoW miners not to engage in what most of us would understand as dishonest behavior.

Technical features

Some technical features that make Decred different from other projects:

  • Proof-of-work/proof-of-stake (PoW) hybrid consensus system - A decentralized lottery is used to select PoS miners voting on PoW blocks. The PoW and PoS subsidies account for 60% and 30% of the total block subsidy, respectively. This system is based on MC2, which is very similar but developed independently of Proof-of-Activity (PoA) designed by Iddo Bentov, Charlie Lee, Alex Mizrahi and Meni Rosenfeld.

  • Cold staking and decentralization of stake pools - The ability to generate new coins without the risk of having your coins online while mining in the PoS. The PoS mining system has also been designed with distributed and decentralized stake pools in mind so even those with few coins can participate in network validation.

  • Internal voting system for selection of hard or soft forks - PoW and PoS miners can vote on features and disputes via signaling bits, providing a sensate mechanism to resolve disputes over blockchain features.

Mining

Bitcoin

Figure 2 - Bitcoin supply equation
Figure 2 - Bitcoin supply equation

At the beginning (n = 0), in 2009, each mined block rewarded the miner with 50 BTC (50/2^0 = 50/1 = 50). Then, during the first 210,000 blocks, 10,500,000 BTCs (50 BTC * 210,000 blocks) were issued. After 210,000 blocks, almost four years, the first halving occurred (n = 1), and the reward dropped by half (50/2^1 = 50/2 = 25 BTC). In the next 210,000 blocks 5,250,000 BTC were issued, totaling 15,750,000 BTC. Almost four years later the second halving occurred (n = 2) and the reward dropped by half again (50/2^2 = 50/4 = 12.5 BTC). The following figure shows the result of this geometric progression until the end of BTC issuance estimated for year 2140.

Figure 3 - Bitcoin supply growth curve
Figure 3 - Bitcoin supply growth curve

  • New block: approximately every 10 minutes
  • Blocks per day: 144 (24h * 60min = 1440min, 1 block/10min = 144 blocks/day)
  • Block difficulty adjust: every 14 days
  • Estimated date of the last block with BTC issuance: May 2140
  • Reward: 100% of Coinbase (name of transaction that issues new coins) + 100% of fees goes to PoW

Figure 4 - PoW miner is rewarded with new coins from Coinbase transaction and transaction fees
Figure 4 - PoW miner is rewarded with new coins from Coinbase transaction and transaction fees

Decred

Figure 5 - Decred supply equation
Figure 5 - Decred supply equation

On block #0 there was no transaction or issuance of DCRs. In block #1 1,680,000 DCR were pre-mined. Of this amount, 840,000 DCRs (50%) were distributed among developers as a form of payment and the other 840,000 were distributed via airdrop, with 282.63 DCR sent to each one of 2,972 people who subscribed to the airdrop list, a form of distribution that developers created so that since the beginning there would be a circulation of DCRs (supply and demand). This matter will be addressed later in the following sections.

Starting on block #2 on 08.02.2016, lasting for the next 6,142 blocks (n = 0), each mined block could reward* miners with 31.19552664 DCR, so 191,604.7672 DCR (31,19582664 DCR * 6,142 blocks) could have been issued*.

PoW (60%) PoS (30%) Net (10%) Total (100%)
18.71749598 DCR 9.35874799 DCR 3,11958266 DCR DCR 31,195,82664

After 6,144 blocks, on block #6144, the first reduction in reward (n = 1) occurred. On the following 6,144 blocks (~21.33 days), from block #6144 until block #12287, 187,890,5586 DCR were issued.

PoW (60%) PoS (30%) Net (10%) Total (100%)
18.53217424 DCR 9.26608712 DCR 3,08869570 DCR 30.88696697 DCR

Then came the second reduction (n = 2) in the reward on block # 12288.

PoW (60%) PoS (30%) Net (10%) Total (100%)
18.34863787 DCR 9,17434368 DCR 3,05811456 DCR 30.58114561 DCR

Figure 6 shows the result of this geometric progression until the end of the DCR issuance, estimated for year 2039.

One explanation*: until block #4095 the only block reward was the coinbase transaction, which issued the PoW miner’s DCRs (60% of the possible reward) and network fund (10%), totaling 21.83707865 DCRs rewarded per block. Until this block there were no drawn tickets, just the purchases. So this was the maximum reward from blocks #2 to #4095. Starting with block #4096 tickets purchased in the previous blocks began to be drawn and the PoS miners reward was included in the block, totaling 31.19552664 DCR per block. The first drawn ticket rewarded the PoS miner in 1.87174959 DCR (93.58% return) and unlocked the 2.00 DCR used in the ticket purchase, totaling 3.87174959 DCR. The rewards forecast can be tracked on the DCR Subsidy Forecast page, which already accounts for the difference in PoS mining explained above. Also Figure 5, which shows a total of 20.638.330,04460490 DCRs, shows a result already adjusted for 4096 blocks without PoS reward.

Figure 6 - Decred supply growth curve
Figure 6 - Decred supply growth curve

  • New block: approximately every 5 minutes
  • Blocks per day: 288 (24h * 60min = 1440min, 1 block/5min = 288 blocks/day)
  • Block difficulty adjust: every 12 hours
  • Estimated date of the last block with DCR issuance: May 2039
  • Reward: 60% of Coinbase (name of the transaction that issues new coins) for PoW, 30% for PoS (PoS reward actually comes from a transaction identified in the blockchain as “Vote”), 10% for the network fund; 100% of fees goes to PoW

Figure 7 - PoW and PoS miners get most of the block reward
Figure 7 - PoW and PoS miners get most of the block reward

With a pure PoW consensus mechanism, those who have more mining power win, the same as saying that those who have more money win. The Decred Project likes “skin in the game”. The “coins” are temporarily locked in the blockchain in exchange for tickets that have voting power. As a reward, when the ticket is drawn it is remunerated (in DCRs) by 1.2% on average, every 20 days on average. This PoS mining mechanism is added to the PoW mining common to Bitcoin, creating a two-factor authentication. Thus, stakeholders can vote on proposed changes to the network and tickets validate the blocks mined via PoW. So the miners can’t make decisions that hurt the long-term investor.

Measure of comparison

By the end of year 2039 all ~20.6M DCRs will have been mined, as well as ~20.88M BTCs (~99.45% of 21M), approaching the horizontal asymptote at y = 21M. This means that the geometric progression used in Decred is smoother and, given the same approximate number of years (BTC: 2039-2009 = 30 years; DCR: 2039-2016 = 23 years), issues approximately the same amount of coins. The smallest difference between the supply of BTCs and DCRs should occur in 2039, when the difference will be ~248,000 fewer DCRs than BTCs.

Figure 8 - Approximate comparison between Bitcoin and Decred supply growth curves
Figure 8 - Approximate comparison between Bitcoin and Decred supply growth curves

3. Network fund

It is difficult to maintain a solid and steady development without a source of funding or just with donations. It’s important to know where the money comes from. Whether it is the developers, a private company or the MIT Media Lab makes a difference when assessing the possibility of conflict of interest, the agenda of each organization and its objectives behind the funding. So nothing more reasonable than a project that intends to be a sound notion of money to finance itself, without relying on outside sources and agendas.

Also, a cryptoasset like Decred is created with zero or near zero value. Only its technology and its utility can increase its value. In other words, just like Tim Cook, Apple CEO, has stocks that he can only sell in a few years, needing to increase the company value in the long run to make profit, Decred developers have created a cryptoasset that needs to increase its value so they can have a return on their investment.

The pre-mined DCRs are 8% of the total offer of 21M DCRs, or 1,680,000 DCRs. Company 0 and its developers invested USD 415,000 in the project since April 2014 and received 4% of the total offer, 840,000 coins (at a rate of USD 0.49/DCR). No developer received any amount of coins for free: all developer coins were purchased at this rate of USD 0.49 per coin through their initial investment or in return for paid work at this rate.

The remaining 4% were equally distributed (282.63 DCR, as seen in the coinbase transaction of block #1 already shown in the previous paragraph) between participants of an airdrop list as part of an effort to increase Decred’s network, decentralize coin distribution, and reach people interested in participating in the project.

The developers financed the project from their own pocket and therefore, there is a commitment to the project. This is quite different from an ICO, where developers “sell” the market a whitepaper in exchange for Bitcoin or another asset with market value.

ICO (Initial Coin Offering)

The term refers to the IPO (Initial Public Offering), when companies open their capital on stock exchanges. Performed by companies that wish to finance their projects, monetize the investment of the founders of the company and facilitate the negotiation of a part of the company by increasing its liquidity through the markets. Laws and regulations protect investors and enforce accountability before, during and after the IPO.

Projects funded by ICOs (Initial Coin Offering) suffer from conflicts of interest inherent to their funding model. The developer writes a whitepaper, presents it to the market, and asks for funding. The terms and conditions of the projects, in some cases, present the project as high risk investment, where the investor may lose all of its resources. It’s like buying an apartment on the blueprints: the further from the end, the greater the risk. In other cases, the investment is presented as recreational rather than actually a financial investment.

ICOs usually have two major problems: (1) on paper everything is possible; (2) to undertake is to build something first and then get the results, make a profit. When funded through an ICO the developer gets the profit before writing the first line of code, so there isn’t a great incentive to actually build something after receiving financial resources, especially when the investment was subscribed as ‘recreational’. Some projects actually come to light, with basic characteristics, mere copies of Bitcoin code or another functional project, with some parameters changed.

4. Project governance

In addition to its technical features, Decred Project introduces governance through proposals and votes to ensure long-term growth.

A stakeholder, using a Decred client (Decrediton or dcrctl + dcrwallet), can lock its DCRs in the blockchain in exchange for tickets. These tickets give the stakeholder voting power in proposed changes to the network. When the ticket is drawn using a network algorithm, the investor gets back his locked DCRs and another 1/5 of the 30% of the DCRs mined in the block (30% of mining reward goes to the tickets, and five tickets are drawn per block). At this moment the ticket is called to vote on a proposal that is open for voting during 8,064 blocks (28 days, with 288 blocks/day). Anyone can submit a proposal through Politeia, the public proposal system with versioning and timestamp anchors in the blockchain, and developers will be paid to work on the accepted proposals.

For a new block to be approved it is necessary that at least 3 of 5 tickets are drawn and that those tickets approve the block. The block can also be rejected and not be included in the blockchain.

The initial distribution via airdrop and the block reward impact the project governance. The airdrop distributed 282.63 DCRs among 2,972 participants, diluting the participation of the initial developers. Block reward percentages favor PoW miner, which invests in hardware and electricity. A higher percentage of reward for PoW is important to dilute the participation of early investors who only invest in PoS and do not continue to buy more DCRs and tickets or also invest in PoW, otherwise those early investors would have always had a guaranteed stake in the PoS rewards and the decision-making process by vote.

This architecture creates a balance of power between users, miners, and developers. Long-term investors, the PoS miners, decide the course of the project by validating the work of PoW miners, who provide the network with security through hash power. PoW miners also vote on proposals, but could not act in collusion because their choices and also the mined blocks will be validated by PoS miners. Developers are paid to work on proposals that the community understands will bring more value to the project in the long run. The early developers of Decred, the founders, are also committed to the project, since they funded the development from the beginning and were paid in DCR.

The project relies on its Constitution that establishes basic principles such as finite emission, privacy, security, fungibility, inclusion and progressive development of technology.

Decred Constitution

Decred (/ˈdi:ˈkred/, /dɪˈkred/, dee-cred) is an open, progressive, and self-funding cryptocurrency with a system of community-based governance integrated into its blockchain. The project mission is to develop technology for the public benefit, with a primary focus on cryptocurrency technology. Decred, as a currency and as a project, is bound by the following set of rules, which include guiding principles, a system of governance, and a funding mechanism. These rules have been established in an effort to create an equitable and sustainable framework within which to achieve Decred‘s goals.

References: