{'fraction_non_alphanumeric': 0.019669611986169806, 'fraction_numerical': 0.004187475989243181, 'mean_word_length': 4.5860515021459225, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 1, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
The Decrits Consensus Algorithm: Decentralized Agreement without Proof of Work

Decrits is a cryptocurrency in development that makes use of a novel consensus algorithm that does not require proof-of-work. This paper describes how the Decrits Consensus Algorithm (DCA) is as trustless as a proof-of-work algorithm while offering superior transaction security at virtually no cost.


Introduction
Satoshi Nakamoto's landmark paper, Bitcoin: A Peer-to-Peer Electronic Cash System [1], showed that a decentralized, trust-free, digital cash protocol can solve the double-spending problem 3 by using a concept called proof-ofwork (POW) as long as greater than 50% of the work is performed by honest members of the network. While at least one paper has described some weaknesses of this concept 4 , it remains a stalwart system. However, the capital costs of maintaining this system are rather exorbitant-currently estimated at nearly $800 million USD annually [2] while the Bitcoin total network capitalization is around $5 billion USD.
Recognizing this conundrum, the first proposal for a concept called proofof-stake (POS) eliminated the need for POW by relying on users of the currency to vouch for a given order of events, weighted by the amount of currency they possess [3]. Unaware of the proposal, the author of this paper proposed a vaguely similar but naive implementation several months later as part of an ongoing cryptocurrency design paper. This eventually evolved into the DCA.
Since then, several cryptocurrency implementations that do not rely on POW have made it to market: Peercoin which uses the Bitcoin code base and adds POS functionality very similar to the first proposal; Ripple which uses a hidden set of public nodes trusted not to collude; and Nxt which again uses a similar system to the first proposal but provides an entirely new code base. The security of each of these protocols has received passionate dispute at one time or another, with little academic research published as of yet.
The DCA is thematically similar to the prior proposals and implementations, but it aims to solve the perceived problems therein such as reduced decentralization and/or "nothing at stake" where no significant punishment exists for stakeholders who (seemingly) defy the rules of the network. This paper is an outline of only the DCA and not the Decrits protocol as a whole. Concepts that are not specifically necessary to describe the DCA's operation will be discussed only minimally. Among others, a paper that describes a significant reinforcement to the strength of the DCA in concert with the Decrits network protocol will be released in the future.

Records
A Record is the basic building block of network consensus provided by the DCA. It is roughly equivalent to the Bitcoin block and contains a set of transactions along with other network data. In lieu of a POW solution, a Record is created and digitally signed 5 by a network peer selected by the DCA in a particular order-one for every 10 seconds of real time.
Each Record acknowledges as many Records as possible prior to itself, chaining them together. A new Record needs only to confirm Records that have not already been confirmed in the chain.

Voices
A Voice is a person (or group of people) who has chosen to participate in the network consensus by risking a predefined amount of Decrits currency in return for a portion of transaction fees collected by the network. To receive these fees and to avoid penalties, a Voice must create Records at the predetermined time decided by the DCA. A Voice may also be referred to as a network object, similar to a peer or a node.
A Voice is not an ephemeral concept; the currency risked cannot be used for any other purpose for a period of approximately one year. There is no limit to the amount of Voices that may exist; it is governed only by the total amount of currency people wish to risk to protect the network.
Becoming a Voice is considered a risk for two primary reasons: the opportunity cost of losing the liquidity of the currency during the period in which it is locked, and the possibility of the computer performing the Voice's duties being compromised by malware that maliciously creates invalid Records. A Voice who creates two Records for the same window of time or includes an invalid transaction 6 is considered in violation of the network protocol and will have its risked Decrits destroyed.

Consensus Blocks and Cycles
A Consensus Block (CB) is a snapshot of all the Decrits protocol data at a given point in time that is taken approximately every 10 days. This is a reference point for which nodes new to the network or ones that have not connected in some time may refer to as a starting point for network data.
Having an up-to-date picture of the network data is as simple as downloading the snapshot and all subsequent Records since the snapshot. As part of a Record, a Voice will include a hash 7 of the prior CB to confirm its approval.
A Consensus Cycle (CC) is the period over which data is aggregated before determining a new CB. CCs are not explicitly separated by CB snapshots, but lag several days behind to allow for Voices who may have missed creating a Record to still confirm the prior CB. An additional period of about a day is provided to allow for a new order of Records (see section 5.1) to propagate the network, giving Voices time to prepare for the next cycle.

Description
The defining concept of the DCA is known as the Voice Ledger (VL). The VL is a record of all Voices who have ever existed at any point in the network's history. Whenever someone opts to become a Voice, the transaction that executes this action will be added to the VL. Whenever someone no longer wishes to remain a Voice, the transaction executing this action will also be added to the VL.
Part of the reason for requiring a lengthy minimum period of time to be a Voice is to keep the VL compact and easy to transmit-there is less turnover among Voices. Its fundamental purpose acts similarly to the combined difficulty of the Bitcoin block-chain: it protects the history of the network. However, while forging Bitcoin's chain only requires creating a new history of work 8 , forging the VL would require catastrophically breaking the underlying digital signature algorithm 9 .
Like Bitcoin's genesis block, the Decrits software will contain a genesis CB that contains a list of public keys in the VL representing the initial Voices of the network. In lieu of anonymous POW, these Voices are tasked with creating and protecting the network history.

Defending the Voice Ledger
While it is intuitively possible to create a forged network history by controlling some of the Voices' keys, the properties of the VL make it so that these attacks are rendered entirely ineffective.
The primary attack vector on the VL is to create an alternate network history in which the Voices under the attacker's control become the only Voices securing the network. This attack is fairly simple to execute and could even rewrite the entire history of the network if the attackers control any of the Voices in the genesis CB.
However, a key concept of the VL is that when a Voice chooses to end his tenure, he will sign a transaction stating so, and this transaction is added to the VL. This transaction is the key that unlocks the Decrits that were originally risked to protect the network. Without it, the Voice does not retrieve his money. Any rewriting of history cannot possibly include these transactions for Voices which the attacker does not control.
It then becomes obvious 10 to any peer new to the network which fork 11 is honest: the one that contains these signatures. The signatures cannot be carried over from one fork to the other because the exit transaction includes a recent CB hash which will be invalid on the dishonest fork. If the Voices in question are still working for the network, recent signatures will be available via the Records they have created.

Recapping Bitcoin's Security
A significant drawback of the Bitcoin network is the amount of time it takes to confirm a transaction. Requiring anywhere from a few minutes to occasionally longer than an hour, even when a transaction is confirmed, it is not necessarily secure. From the bitcoin.org website: "For larger amounts like 1000 US$, it makes sense to wait for 6 confirmations or more. Each confirmation exponentially decreases the risk of a reversed transaction." 12 [original emphasis] The website, by virtue of the protocol as a whole, makes no guarantee of transaction security. The statement of "Each confirmation exponentially decreases the risk of a reversed transaction" is also technically incorrect. It 10 Obvious: No human or other external input required to determine the correct network. 11 Fork: One of two or more competing network histories vying for dominance. 12 https://bitcoin.org/en/you-need-to-know assumes that an attacker with significant resources can only control some significant fraction of the Bitcoin hashing power that is less than 50%, but never equal to or greater than 50%.
While this attack seems unlikely, and indeed is a weakness inherent to POW that is conceded by Bitcoin, it is possible and must be considered. The only defense is to wait until enough resources have been consumed by the network to exceed the value of the transaction 13 -and even then this security is weakened by the probability of the attacker executing multiple attacks at once, multiplying the profitability of the attack.
In the future when Bitcoin mining is no longer as heavily subsidized as it is today, the problem is compounded by the fact that the network's security is relative to the amount of transaction fees assessed. If transaction fees are low, the comparative network security must be low. If transaction fees are high, it is likely that fewer transactions will be performed on-chain 14 which would also contribute to lower network security and an easier opportunity to attack. It may very well be the case that older, less efficient pieces of silicon known as ASICs that can only perform Bitcoin POW may find new life and profitability in attacking the Bitcoin network.

The Decrits Security Model
In contrast to the somewhat hazy properties of the Bitcoin model, the Decrits transaction security model is simple: Any transaction appearing in a Record is confirmed, and any given Record that is confirmed by at least 10 subsequent Records is secured.
Confirmed means that a Voice has "wagered" all of the Decrits he has on deposit that the transaction is valid based on his view of the network, and Secured means that reversing the transaction could only be achieved by an unresolvable network fork 15 . This means that at the very least one Voice has forked the network in a way that nodes who were not watching the network at the time require human input (in some cases) to make a decision.
The figure of 10 Records for security is a variable intended to give the network enough time to propagate data. Should a newer Record fail to confirm 13 From a game-theoretic point of view, it only makes sense for the attacker to perform this attack if they can manage a profit.
14 On-Chain Transactions: Transactions that are sent directly over the network rather than through a third-party service such as a wallet website.
15 Unresolvable Network Fork: A fork in the network that will likely remain permanent. Assuming both forks continue to exist (one does not die out), each fork will eventually destroy the other's Voices' money, and the Decrits user will have to choose which one to use. See section 5.3. an older Record that has already been confirmed by 10 Records in between, and the "unconfirming" Record contains a double-spent transaction, the newer Record will create an unresolvable network fork.
However, an honest Voice will not blindly create a Record it knows could cause a fork when its network connection might be at fault-the likely scenario is that it is under attack. Instead, when the situation does arise, it will create a Safe Record that acknowledges the prior Records it has available, but does not confirm any transactions. Safe Records pose a minor but necessary nuisance by further delaying transaction confirmations.
In a network where Voices are present and timely, transactions will take between 5-15 seconds to confirm and 105-115 seconds to secure.
The following subsections describe some of the possible malevolent scenarios that may arise in the security model.

Scenario: Double Spending Insecure Transactions
The simplest way to avoid any possibility of having a transaction double spent against a Decrits network user is to wait until the Record containing the transaction in question has been confirmed by at least 10 subsequent Records. However, many times this is not practical, such as in the case of point-of-sale transactions where confirmation speed on the order of seconds is important.
In this case the scenario arises where a Voice could purchase a product in person in during the time window of his Record and execute a double spend on an insecure transaction. The Voice does not create his Record on time and waits for the transaction to be confirmed by a Record after his Record's window of time. He then creates his Record with a different transaction that sends the currency to a different account, and submits it to the network.
In theory, because his Record is earlier in the order of Records than the Record that confirmed the real transaction, his Record should take precedence and the latter transaction should be considered invalid. In practice, network nodes that have seen both Records in the order they actually appeared will refuse to transmit the Record that is obviously attempting a double spend. Without controlling a huge majority of the network's nodes, convincing the network that the double spent transaction came first will be a nearly impossible task.
However, it is not a completely impossible task. If the Voice in question also controls a large portion of the subsequent Records, he could order the transactions regardless of what the network thinks. The network has to accept this. This means that if a merchant suspects anything out of the ordinary, and a recently past Record is missing, it would be prudent to wait until the transaction is secured.

Scenario: Isolating a Voice
A malevolent entity may be able to isolate a Voice from the rest of the Decrits network. Provided that this is possible, by creating a public set of Records and a secret set of Records fed only to the targeted Voice, the Voice could be convinced to unknowingly unconfirm another Record or confirm a double spent transaction.
This would require an unlikely confluence of malevolent Voices to be aligned together in the order of Records, positioned just prior to the Voice being targeted. Mitigating factors to this attack include the destruction of all malevolent Voices' Decrits for creating multiple Records for the same window, the difficulty and unlikelihood of organizing malevolent Voices to be in the proper position to perform this attack, and further protection provided by the network protocol to be described in a future paper.
The probability of executing this attack is very low, the attacker will lose far more money than the victim (unless they can string together a significant number of victims, significantly increasing the attack's difficulty), and the possibility exists that the victim has an outside source of information thereby easily catching the attacker in the act-the attacker will lose his money but the victim will not.

Scenario: Isolating a Transacting Node
Isolating a transacting node may be somewhat easier to execute, primarily for transactions done in person. If, for example, the transacting node is a cell phone in a bunker underground where the only Internet access is provided by wifi under the control of the men in suits across the table, they may be able to control the network view. Now if the men in suits are able to predict-days in advance-within a few minutes of when the transaction will occur, and by luck or by rigging the network they are able to control the Voices for that period of time, and they are sure the victim will accept the transaction as being complete before running out of consecutive Voices to create Records, then and only then could a double spend be executed.
In certain, less-than-ideal situations, it may be prudent to wait additional time to be sure that the Record chain has not been hijacked. The attackers will still lose Decrits for each Record that the victim waits as they must create both a secret and a public Record, and if the victim becomes aware at any point before parting with merchandise that the chain is a fraud, he can end the transaction and still prove the duplicate Records to the network. This assumes he is able to leave the bunker, however.

Scenario: Partitioning the Decrits Network
Partitioning the Decrits network may be possible, most likely by partitioning the Internet itself such as the case in Egypt in 2011. This may cause an unresolvable network fork if the portion of the network partitioned is large enough or the partition remains in place for a long enough time.
Without a free and open internet, all cryptocurrencies are at the mercy of those who control the flow of information. Technologies such as wireless mesh networking 16 and even satellite backup transmission are of paramount importance to protect the network from this attack. Abandoning complete Internet neutrality 17 is also a threat. None of these threats can be conquered within the scope of the network; it is a social and political issue.
A novel property of the Decrits network is that all users will be able to relatively quickly detect a network partition by noting the missing Records. If many more Records are missing than normal, the client should warn the user of the partition possibility.

Scenario: Voices Colluding to Fork the Network
A group of malevolent Voices could collude in secret or in public to unresolvably fork the network.
If done in secret, all nodes of the network that are connected during the time in which the attack takes place will know with certainty which fork is honest simply by observing and noting the great time disparity between receiving the forks.
If done in public, all nodes of the network that are connected during the attack will know with certainty which fork is honest because the earliest, ontime Record in order will take precedence.
Nodes that were not monitoring the network during this period of time will not know which fork is honest. This is a concession that is made by the DCA. There is a keen difference here between Decrits' concession and Bitcoin's concession (regarding 50% attacks): the Decrits user is not affected by the result. If they were not watching, they were not conducting commerce with Decrits and could not be fooled into believing in a double spent transaction. Any commerce that the user is interested in after this point is likely to be completely unaffected and secured on both forks.
On the other hand, a Voice is always affected as it must do its part to help the honest network and confirm the honest fork. It may issue a Safe Record to divert the decision to a later time, but the decision must be made, and it must be made with common-sense, human input. In a ubiquitous network that Decrits would hope to be, if you don't know what happened, then your friend or your neighbor does, or the mom and pop shop down the street does. Calling for common-sense, human input is a small concession to make when the benefit is the impossibility of double spending and true security of transactions.

Records and Consensus Cycles
Each CC, a new order of Records is created by using a random number (see section 5.4) as a seed. Via this mechanism, the Voices have no control over when they will be tasked to create Records. Should malevolent Voices be able to control the order of Records, they would be able to organize Records that they control together, leading to the possibility of attacks such as the one covered in section 4.2.3.
The actual Decrits CC length is 876,600 seconds (about 10.15 days), and the time between Records is 10 seconds, so the number of Record "slices" is 87,660. If there are fewer Voices than this number, some or all Voices will be tasked with creating multiple Records. If there are more, more than one Voice will create a Record for some or all slices. When there are two or more Voices assigned to one slice of network time, a modulo algorithm will determine which Voice records which transactions so that they do not duplicate each other's work.

Network Time
Transactions on the Decrits network are timestamped. Each Record slice covers a specific window of time. Without a highly coordinated attack, it will be nearly impossible to confuse a node's sense of network time. If a node is ever confused, the client will require user input on timestamping a transaction. In the case of a Voice, the client will most likely issue a Safe Record.

Resolving Unresolvable Forks
An unresolvable fork does not imply the network can never be whole again, it means that a decision must be made regarding network consensus.
The most extreme example imaginable is presented: All Voices except for one lone Voice are corrupt. All users of the Decrits network watch the network at all times. The corrupt Voices double spend a transaction. The honest Voice carries the network on by itself, destroying all of the corrupt Voices' money by refusing to confirm their Records. The entire network, save the corrupt Voices, agrees without any human input required. If all nodes watch the network at all times, the network is secure from attack as long as one Voice is honest. Transaction confirmations will be temporarily and significantly delayed.
Of course both sides of the scenario are unrealistic. Nodes not watching the network will be confused about which network is correct and cannot make the assumption that the network with more confirmations is correct. The human in control of that node must ask others. This could be sanctioned in software (e.g. 'I trust Google's version'), or it must be resolved by seeking out the accounts of others. Resolving this issue is not a matter of trust, it is a matter of common sense. A few players at the table cannot collude when a large faction of the world has seen their hole cards.
On the other side of the coin, not all unresolvable forks are intentional and malicious. Partitioning the Internet will likely cause one. Because of this, each fork does not immediately destroy the decrits of the Voices on the other fork. Instead, the Voices in question are "jailed"-they may not retrieve their money or create Records while in jail. In the case of a non-malicious fork, a consensus among Decrits users must be made to select which fork is the primary fork. This will probably be the fork that has a larger portion of the Voices. If only a single country is partitioned away, the rest of the world should rightly expect that their fork is the primary.
Under this scenario, the primary fork must vote to pardon the jailed Voices. The voting system will be described in a future paper.

Generating a Random Number
During each CC, each Voice will include in a Record an encrypted string and a decryption key. The decryption key will decrypt the string from the Voice's Record in the prior CC, and this string will be hashed together with all of the other Voices' strings to generate a random set of data. This random hash will be used to create a new, random order of Records in the next CC. It will also be used for other purposes to be described in future papers.
To affect the output of this generator, a group of colluding Voices could withhold their Records until the very end of the CC. If the group controls the very last Record of a CC, they could see all outputs of the generator by providing or continuing to withhold the Records. For this reason, a Voice that does not supply a Record at all during a CC will have its money destroyed. This turns a relatively free attack into a rather costly one.

Attacking Lite Clients
A lite client, known as a Simplified Payment Verification (SPV) node in Bitcoin parlance, chooses to receive only Record headers in lieu of all network data. When receiving a transaction, the sender is expected to provide proof that the transaction exists in a Record for the lite client to accept the payment.
In Bitcoin, it is quite difficult but possible to create a fake history that is fed only to an isolated SPV node in order to double spend. In Decrits, this attack is as difficult to perform as the one described in section 4.2.3.

Future Papers
The DCA is a critically important concept of the Decrits network, but it is only a part of the whole. This paper has not described at all the operation of the actual network protocol, the monetary system, or the voting system. The author believes that each of these categories has received an equal amount of thought and attention, and each deserves its own paper. These will be released during the continued development of Decrits.

Conclusion
This paper makes the claim that the Decrits Consensus Algorithm is superior to POW algorithms in many ways: faster transaction confirmations, truly irreversible transactions, and permanent punishments to malevolent actors-all at virtually no external capital cost. At this time, the benefits of the DCA over other POS algorithms is not as clear. The Ripple consensus algorithm has a detailed paper describing its function, but the Ripple network operates on disparate principles that are difficult to compare. The author of this paper is unaware of any papers describing Peercoin, Nxt, or any other POS algorithm in enough detail to make a proper comparison.
The author invites the reader to comment, criticize, or question the contents of this paper at the official Decrits forum, www.decrits.net.