Introduction

From Decred Wiki
Jump to: navigation, search
This page contains changes which are not marked for translation.

Technology

Hybrid Proof-of-Work Proof-of-Stake

Decred uses a hybridized proof-of-work proof-of-stake (PoW/PoS) consensus algorithm. Many cryptocurrencies use either pure PoW or pure PoS, but Decred hybridizes the two systems to gain the benefits of both. The challenges with using pure PoW are that miners have an outsized influence over the blocks that get mined, which can be used to control what constitutes consensus and to censor transactions. The main challenge with pure PoS is that, ultimately, nothing is at stake, and the early holders of the currency end up owning everything by merit of what is effectively passive income on their coins. By hybridizing the two algorithms, Decred makes it so that PoW miners are subject to the approval of PoS voters, meaning that if PoW miners attempt to block a consensus change or censor transactions, the PoS voters can vote against their block and strip them of their block reward. This hybridization creates a more balanced notion of consensus by requiring both PoW miners and PoS voters to agree on what should go in a block. The "nothing at stake" issue is circumvented by the dependency of PoS on PoW.

There are a number of advantages to the way Decred hybridizes PoW and PoS:

  • PoS acts as a "2nd authentication factor" on the content of blocks created by PoW miners, providing a check on the power of PoW miners.
  • PoS can effectively force soft and hard fork upgrades by voting against PoW blocks that do not adhere to new rules. This creates a notion of continuity across forks that is not possible when using pure PoW.
  • PoS helps to democratize the process of deciding what software upgrades should and should not happen.
  • PoS rewards create an incentive for users to hold their coins and participate in the PoS consensus process.

The PoS implementation used by Decred is distinct from others that have been published or used in other currencies. Decred uses a lottery system to determine which stakeholders get to vote on each block and collect a subsidy. To be considered a stakeholder, one must purchase one or more tickets, which entails locking a certain amount of coins for approximately 1 day (256 blocks). After waiting for the ticket to mature, the ticket is entered into a lottery that runs once per block where the winning tickets selected gain the ability to vote on the previous block. Stakeholders must wait an average of 28 days (8192 blocks) to vote their tickets, and during this time the coins used to purchase the ticket remain locked. The wait may be much longer than the average of 28 days because the ticket selection process is pseudorandom. Stakeholder votes that are recorded in the blockchain are rewarded with 6% of each block subsidy, and each block can have up to 5 votes for a total of 30% of the block subsidy. PoW receives 60% of each block reward, subject to the constraint that their subsidy scales linearly with the number of PoS votes included, e.g. including 3 of 5 votes reduces PoW subsidy by 60%. The votes themselves then decide by majority decision whether the general transaction tree of the previous block, including the PoW reward, is valid. This means that if PoS voters vote against a particular PoW block, it destroys the PoW reward and invalidates any regular transactions within that block. In Decred, PoW miners have a strong incentive to mine blocks according to the demands of PoS voters: they are incentivized to include all votes present under the threat of monetary penalty.

The PoS system in Decred is engineered in such a way that participation from a small stakeholder via decentralized stake pooling is not only possible, it is easily integrated. Even users with small amount of coins will be able to join stake pools and participate in the network consensus process.

Blake-256 Hashing Algorithm

Decred proof-of-work (PoW) uses the Blake-256 hashing algorithm. Blake-256 is based on Dan Bernstein's ChaCha stream cipher and was a SHA3 candidate finalist algorithm. It is also hashes small messages very quickly in comparison to other comparable hash algorithms and is not vulnerable to many of the numerous security issues facing Merkle-Damgård construction-based hashing algorithms, such as SHA-256. For example, BLAKE256 is strongly second-preimage resistant due to its HAIFA construction. Further, the 14-round version has a very large margin of safety as attacks have only been described for 8-rounds or lower.

Schnorr-Based Elliptic Curve Cryptography

By default, Decred uses 256-bit ECDSA public key cryptography over the NIST curve secp256k1. In addition, Decred allows optional use of Ed25519, which uses 256-bit ECDSA over a different curve, Curve25519, along with secp256k1 Schnorr signatures.

The distinction between the 2 curves is that secp256k1 was selected by Certicom (CA-based), NIST (US-based) and the NSA (US-based), whereas Curve25519 is the result of work by academics from the US, NL and TW. Decred offers this optional cryptography so that discriminating users can choose to use Curve25519 if they do not trust secp256k1, and secp256k1 Schnorr signatures so that they may take advantage of some of the unique qualities of this signature system (like smaller, more private multisig). The signature system has also been overhauled to allow for the easy soft-forking of other signature suites in the future, for example, those which are quantum secure.

Because Decred uses the existing secp256k1 signature scheme from Bitcoin as default, it may be easily and quickly integrated into software designed to work with Bitcoin. On the other hand, if uses wish to take advantage of Schnorr signatures and their features, they're welcome to use either Ed25519 or secp256k1-Schnorr.

Modular Codebase

Decred is based on the full node Bitcoin implementation in Golang, btcsuite. As a result, the Decred source code is well-modularized and straightforward to extend and maintain. Additionally, it inherits lots of test coverage and documentation from btcsuite.

Development

Multi-Stakeholder Development Ecosystem

Decred seeks to create a multi-stakeholder system where talented developers and organizations can contribute to the ecosystem, not just a select few insiders. Historically, most open-source projects are run by a benevolent-dictator-for-life (BDFL) or some mild variation thereupon, which typically creates a lot of in-group out-group behavior. Decred welcomes the participation of new developers and makes an active effort to include new talent.

The Decred development organization is built to provide financial incentive for work to improve Decred, meaning both independent developers and organizations. Ideally, participants from many different countries and backgrounds will participate in the development work.

Self-Funded Development

Decred includes a mechanism for self-funding development to ensure the project is and remains sustainable. A major sticking point for many open-source projects is that they require funding to survive, meaning they typically need to ask for donations and are limited by the funding they receive. To ensure that Decred remains free from the problems related to lack of funding, Decred's consensus rules include a 10% development subsidy in each block that is paid to a development organization on an ongoing basis.

The current development organization is Decred Holdings Group, LLC (DHG), a Nevis-based organization. The development organization will be open to anyone who makes contributions to develop Decred, will remain transparent and issue regular financial statements biannually, and will publicly account for how funds are spent. This entity is built to be adaptable and open to community feedback and guidance, and may therefore change in the future if circumstances require adaptation for it to continue serving its goal to make and keep Decred development sustainable as the project and network scale upward.

Participant Developers

Decred, through DHG, pays developers to build and maintain its software and other infrastructure. A list of requests for proposal (RFPs) will be maintained on the Decred website and proposals can be submitted by any independent party. In order to ensure that the quality of deliverables stays high, Decred requires prospective developers work on some smaller open-source tasks before submitting a proposal for an RFP. After publicly evaluating the proposals submitted for a given RFP, in full view of the Decred community, a winner will be awarded a contract to perform the work. The Decred development organization, Decred Holdings Group, LLC, pays contractors in decred for work performed under contract.

Makers of btcsuite

Decred is currently built and maintained by Company 0, LLC, the maker of btcsuite, a full node Bitcoin implementation written in Go (golang). btcsuite has not forked from the Bitcoin main chain once in over 2 years, is extremely stable, has 98,046 lines of code, of which 44,576 lines are test coverage, and it powers the technology of several businesses and organizations. Decred is built on top of btcsuite, meaning that Decred benefits from improvements in btcsuite and vice versa.

Governance

Meritocratic Governance

Decred seeks to create a sustainable system for cryptocurrency development and having proper governance is fundamental to that mission. In the absence of a modern system of governance, most organizations naturally tend towards primitive systems of governance, e.g., "I was here first", tribal oligarchy, or autocracy. While these structures may be acceptable for private businesses or other open-source projects, these more primitive forms of governance have limited utility in the context of a currency.

Decred approaches governance from a layered perspective, where various groups are each allowed to participate in their own layer according to their merit. At its base, this structure is encoded in proof-of-work (PoW) and proof-of-stake (PoS), where participants earn rewards in proportion to their merit in terms of PoW mining or PoS voting. While PoW and PoS empower 2 very significant groups, PoW miners and PoS voters, there are additional groups that require representation that is not proportional to their hashing power or number of coins they own.

Decred Assembly

The first of the groups in the layered governance system is the Decred Assembly, a rolling list of the most meritorious members of the Decred community who will be expected to vote episodically on Assembly-wide issues (creating an effective proof-of-assembly) and participate in committees. The Assembly is a threshold meritocracy with rolling appointments for no fixed length of time, where members are admitted on the basis of what they have actually done for Decred not what they promise to do. Assemblypersons will contribute to the advancement of Decred through discussion and voting in various committees that may be long- or short-lived. Proof-of-assembly, in the form of Assembly-wide votes, will be included in the blockchain in the future, but is not included currently.

Additional layers of governance are planned, e.g., proof-of-developers, and will be formalized in conjunction with the community as Decred development progresses.

Decred Constitution

Decred encodes the rules governing the structure of the project in a Constitution to make it clear what users and members of the Assembly can expect from the project. The Decred Constitution describes how the governance model works, how it self-funds, and the core principles of the project. The core principles that describe what Decred users can expect are straightforward: fixed finite supply, privacy, security, fungibility, inclusivity, and progressive development of the technology that adheres to these principles. The Decred development organization will not fund work that undermines any of these core principles.