Master Thesis Tobias Petri
Master Thesis Tobias Petri
Master Thesis Tobias Petri
Supervised by:
Professor Dr. Aleksander Berentsen
Author:
Tobias Petri
Submission Date: January 11, 2018
Abstract
The goal of the following thesis will be to design a digital currency with
preferably a private ledger without losing the effciency of a decentrali-
zed approach and the implied blockchain technology. Furthermore, an
analysis of various anonymity and privacy procedures from an economi-
cal perspective within decentralized schemes will be shown. To preceed
this, there will be a presentation of the vast bulk of promised anonymous
structures from existing cryptocurrencies. After that there will be one
possible implementation of the presented anonymous schemes for the ne-
wly designed cryptocurrency.
1
Contents
1 Introduction 1
2 Designing a Cryptocurrency 3
2.1 Reasons for a New Cryptocurrency . . . . . . . . . . . . . . . . . . . 4
(Zk snarks) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
4 Conclusion 45
A Appendices i
A.1 Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . i
References xiv
List of Figures
et al. (2016) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
6 Code makeTransaction . . . . . . . . . . . . . . . . . . . . . . . . . . 19
7 Code txnRawList . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
8 Code nodeLeader . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
13 Code state . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
work System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
19 Process of CoinJoin . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
20 Process of CryptoNote . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Plagiatserklärung
Ich bezeuge mit meiner Unterschrift, dass meine Angaben über die bei der Abfas-
sung meiner Arbeit benutzten Hilfsmittel sowie über die mir zuteil gewordene Hilfe
Ich habe das Merkblatt zu Plagiat und Betrug vom 22. Februar 2011 gelesen und
Tobias Petri
1 Introduction
A currency is a form of money that includes coins and paper notes. Generally
speaking each country has its own ocial currency which are typically issued by
each country's central bank, but there are several notable exceptions to this model.
One exception is the Euro which represents the legal tender for multiple European
countries. Moreover, the currency can be used as a medium of exchange for goods
of digital or a virtual currency that does not possess any physical form and it is
regulated, and controlled by sovereigns and its responsible authorities, meaning the
intrinsic value, can be seen as a medium of exchange, and most often have entirely
Nakamoto and since then has captured the public's attention. Bitcoin does not only
face competition by traditional existing at currencies, backed by central banks, but
in which new digital currencies could prot from a second-mover advantage and
suppress Bitcoin's market dominance in the future. Currently, Bitcoin is still the
digital currency with the highest price and the biggest market capitalization. As of
January 11, 2018 its market price is trading at $13,600 with a market capitalization
of $ 228 billion. The other cryptocurrencies in the top ve are: Ethereum with
a price of $ 1,200 and a market capitalization of $ 117 billion, Ripple with $ 1.70
capitalization of $ 42 billion, and nally Cardano with a price of $ 0.69 and the
1
percentage points and is dominating the cryptocurrency market.
online, central banks are paying increased attention to digital currency issues. For
instance, the European Central Bank is following their impact on monetary policy
and price stability(European Central Bank, Feb. 2015), the US Federal Reserve
1 www.coinmarketcap.com
1
is implementing their ability to deliver a faster, more secure and more ecient
innovation(Johnson et al., 2014)in this area. The Bank for International settlements
(BIS) is also reviewing the intersection between cryptocurrency and central banks
more thoroughly (Quarterly Review, Sep. 2017). These developments do not come
banks. For example, the Clearing House Automated System (CHAPS), Target 2
and Fedwire are cost intensive and have a reduced possibility to innovate.
The motivation to design a new cryptocurrency draws from the existing ones. Nu-
merous digital currencies are created in a short period of time. However, there is no
detailed plan what has to be considered when building a new cryptocurrency from
scratch. Furthermore, the invented currency will have specic properties from dif-
ferent available coins and alternative details that could provide new ways of thinking
by an ecient, reliable and usable approach including the costs for security issues.
All these factors inuence the size of the user network and the possible degree of
cryptography for a long time. David L. Chaum's paper from 1985 called Secu-
discusses anonymous digital cash using blind signatures and the double spend prob-
lem. The title of Chaum's paper indicates what current blockchains should enable:
example with a decentralized structure, Bitcoin does not possess true anonymity.
Their transactions have pseudonymous addresses with hash keys in which there can
be easy linkages between users if a user reuses a Bitcoin address and the transactions
are stored on a public blockchain. In practice, Bitcoin oers only weak anonymous
schemes. For these reasons, the approach of the following thesis will introduce fur-
To summarize, the thesis will include the following points. Firstly, there will be an
one. After that, an explanation of the new invented digital currency will be provided
the next section, the economics of anonymity will be highlighted, followed by the
2
concluding remarks, a brief summary of the ndings in the thesis will be presented.
2 Designing a Cryptocurrency
The cryptocurrency Bitcoin solved one big issue, the double-spending problem that
could not be solved with digital cash. Before that, there had to be an intermediary
people from spending the same digital cash multiple times by having a decentral-
ized ledger whereon transactions are conrmed. This ledger removes the necessity
technology and the private-to-public key cryptography making a new piece of dig-
ital cash. The coin owners and the transactions are stored in the public ledger.
protocol. Every form of digital cash normally has both a currency and a protocol. In
from other ones, such as Bitcoin or Ethereum. Naming an example, Litecoin has its
own currency and protocol, and also relies on the Litecoin blockchain.
in general. First, person A gives a notication that she wants to make a transac-
tion from her account to the account of person B. In two and three, the requested
nodes mostly in a computing environment. The nodes in this ledger are trying to
work or proof-of-stake approaches. In the fourth step, when the algoritm consensus
has been solved successfully, the transaction can be seen as veried and it can be
combined with transactions from other members. The combination of all these
3
transactions will form a new block of data for the ledger. After that the block can
to the public, can hardly be changed and it will stay permanently on the ledger.
Finally, person A and B can be informed that the transaction has been executed
succesfully.
Nevertheless, existing digital currencies such as Bitcoin also have drawbacks. Kosba
et al. (2016) are having issues with Bitcoins' privacy and are suggesting a new ap-
proach with its Hawk model. Limited privacy can only be ensured with pseudony-
mous public key implications and the reduced privacy issues are discussed among
others by Androulaki et al. (2013) and Bonneau et al. (2014). Thus, Green et al.
(2013) also suggest improving the anonymity of a user by presenting a new cryp-
tocurrency named Zerocoin. Moreover, Barber et al. (2012) are showing the loss
tage of Bitcoin. One further weakness involves the reduced transaction scalability.
Whereas PayPal can transfer over 100 transactions per second, Bitcoin is only able
Since 2010, there was a one megabyte restriction for the block size to limit the
amount of transactions to seven per second. However, the scalability issue has been
a highly controversial topic for several years in the Bitcoin community itself. Due
to that on the 1st of August 2017, a hard fork took place in which a new Bitcoin
version called BitcoinCash emerged. The original Bitcoin version wanted to increase
its block size to two megabytes (MB) in November 2017. However, there were some
controversies and on December 28, 2017 another hard fork took place introducing
an increase of block size to four MB by Segwit2x when the entire wallets and users
support Segregated Witness. Nevertheless, its block size rises to eight MB meaning
the transactions will increase by eight times per second over today.
and the condence on broadcast are one component for the limited scalability. The
computational energy to handle the transaction ledger and mitigate double spending
will have the capacity of large power plants or more by some estimation providers.
For instance, in March 2016 the daily energy consumption for the entire mining
network was around 350 Kilowatt (KW) that is approximately the energy consump-
4
tion of 280,000 US households. Deetman (2016) estimates that, at actual growth
rates in computing technology, the Bitcoin ecosystem could consume around 15 Gi-
gawatt (GW) by 2020. This amount is similar to the consumption usage of Denmark
in 2014. There are some existing alternatives such as Permacoin or Litecoin that
can limit the computational energy aspects; however, it cannot reduce the costs
eciently.
Another key limitation of Bitcoin refers to the monetary supply. This involves no
control mechanism over monetary supply after its creation. For instance, Bitcoin will
provide around 21 million coins in total in 2140 while it is not possible to manipulate
the supply which means there is full to almost complete rigid macroeconomic policy
and no exibility. Moreover, the predened total value of 21 million coins in the
Additionally, the value of Bitcoin and other digital currencies can be extremely
volatile as it has been experienced for Bitcoin at the most recent development of its
currency performance with respect to the dollar. For instance the highest price of
Bitcoin was reached so far in December 2017 with a price above $ 20,000. Just a
2
year ago the price was only around $ 780. The daily market volatility is also quite
high meaning that some users might not swap their coins for goods and services and
as an explicit show case do not satisfy the demand in terms of fast transaction
scalability and anonymity properly. However, it is also worth mentioning that one
cryptocurrency cannot satisfy all desired key properties, yet. The newly invented
system. Thus, the presented cryptocurrency will have the following key properties:
it will use a private blockchain approach, will be highly scalable, provide an op-
tional higher degree of anonymity and a central authorithy will be responsible for
an adequate implementation of the new coins, the sound control of the process, and
that the whole procedure takes a long time and is expensive. It also involves a
credit -and reputation risk if an intermediary is not able to maintain the verication
2 www.coinmarketcap.com
5
process. With the invention of the blockchain technology a user does not have to
rely on intermediation for the verication of transactions any longer. The blockchain
solves all the aforementioned issues with a change from trusting people to trusting
for the verication process. In other words, a blockchain is trustless and the user
only has to trust the system and its technology but no other party or intermediary.
consensus, and business logic. The replicated ledger contains a complete history
and it can be replicated. The integrity of the ledger is one characteristic of the
possible degree of anonymity and privacy of transactions and the identity of partic-
and a shared control that respects possible disruptions. Finally, the business logic
presents the logic of the dened ledger and gives out the execution together with the
transaction. The logic itself can vary broadly from coins to smart contracts. Based
on these four elements, a blockchain can dier immensely due to the implemented
specications and the inherent variability. For these reasons, only blockchains re-
forms of ledger possibilities will be presented. Following Brennan et al. (2016) three
ledger properties can determine the degree of a blockchain. The rst property is
the amount of copies, the second characteristic is the accessibility of the reader and
al. (2016)
6
In the cryptocurrency sphere, two basic blockchain types can be distinguished: the
Brennan et al. (2016) dierentiate the public ledger into two parts. For the per-
missionless public ledger any person can participate in the network and view the
transaction history and the consensus mechanism. Furthermore, anyone can also
join the consensus process in which the transactions get veried and to nd out the
actual state of the chains. On the other side, in the permissioned public ledger,
controlling a pre-selected set of nodes. But anyone of them can view and make
The public ledger in general is completely distributed and it has a complete trustless
that someone does not have to prove her identity to the blockchain network. Fur-
thermore, there are no entry barriers for the users and miners except the needed
technology. Morevover, any miner who respects the rules can participate in solving
the consensus mechanism and verify the block for getting the mining reward. A
further positive argument involves the openness of public ledgers. The open envi-
ronment permits many participants to use the system, resulting in gaining network
eects, for instance in the improvement of the blockchain system. Finally, the public
ledger gives users a protection from the developers because one developer does not
have the authorithy to change anything within the system. Two points encourage
this statement. Firstly, it will strengthen trust and ensure increased interactions
within the network. Secondly, the pressure of other entities on oneself will be di-
minished because nobody can force a user to change anything because one user does
not have the authority to proceed. In fewer words, a public blockchain is censorship
missionless public ledger. Ripple is also an example of a public blockchain, but only
permissioned users can take part in the consensus mechanism, while anyone is able
7
The typical Bitcoin blockchain example can be seen in Figure 3. In this case the
blockchain has a chain of data blocks in which one block consists of several trans-
1
actions (TX -TX n). The respective blockchain is increased by every additional
block and shows an entire list of the transaction history. In the specic case of
Bitcoin, the miners create the validated blocks that are rewarded by bitcoin coins
and transfer fees. The blocks' validation is done by the network via cryptography.
Moreover, each block has a timestamp, the hash value of the last veried block and
a nonce. The rst block of the blockchain is the so called genesis block and the
following procedure assures the integrity of the complete blockchain including the
genesis block. The hash values only exist once, meaning fraud can be prevented.
The reason for the prevention of fraud is that the changes within the blocks would
immediately change the hash value in the chain. The proof-of-work is a consensus
mechanism in the Bitcoin blockchain which ensures that when the majority of nodes
agree to the validation of transactions within a block, the block can be added to
the existing chain. According to Swanson (2015) the consensus algorithm consists
of a set of rules and processes that enables the maintenance between several nodes.
Newly added transactions are not a part of the ledger automatically. The consensus
procedure gives the permission that the transactions can be part of the block after
a specic time. With Bitcoin, transactions can be conveyed to the ledger after ten
minutes. After the transfer of the block, altering the information in the blockchain
The private ledger consists of one central authority or organization that can give
instructions to the ledger and check the consensus meaning only this authority has
write permissions. The responsible authority also cares about the identity of the
ledger. Read permissions can be public or restricted depending on the desired char-
In general, the private ledger has multiple advantages compared to public legders.
One advantage is that a user has to be an approved entity for participating in the
blockhains do not need to use computer power related mining applications to acquire
consensus because all entities and thereby nodes are known. In this case you can use
algorithms such as Raft or Paxos and more algorithms without any proof-of-work
the next paragraph. As there is no requirement to use any of the mining procedures,
8
the 51% attack that is needed to manipulate the blockchain within the system from
possible miner collusion is not possible. Since the verication process will need
only a few nodes, the transactions are cheaper and more scalable referring to public
can change the rights or rules of the blockchain, or see the transactions. In addition
to that, as long as read permissions will be under restriction, a greater form of privacy
will be enhanced which can allow restricted access to the transactions within the
In the following, Hyperldeger has one organization and 3 nodes. The preparation of
called transaction proposal because this proposal will be forwarded to the nodes. It
can be sent to one or several nodes depending on policy details. All nodes are exe-
cuting a simulation on its respective ledgers. Meaning the key from the transaction
proposal will be updated to a new value set. The nodes sign it with cryptography
and send it as a so called endorsement response to the SDK. The endorsement re-
sponse consists of the cryptographic details of the node and the transaction, and the
updated value of the new set. The SDK collects all endorsement responses, signs
them with a key and transmits them as an invocation request to an orderer. The
orderer has the task to verify the chaincode and its implemented policy. A possible
policy could be that all nodes have to agree on the transaction proposal. However,
if for example only node one got the proposal and sent the endorsement response
to the SDK, the orderer cannot verify the transaction due to unfullled policy re-
9
quirements. Additionally, the orderer veries every endorsement response from all
nodes and the updated set of the new values. Those endorsement requests from all
participating nodes must be the same because the result will consist of nodes that
have the same ledger, the same data and the same chaincodes. If the policy and
the endorsement requests are valid, the orderer sends the updated set of data to all
nodes accept the new data set and update its respective ledger on the same stage
to keep all nodes in synchronization. Hyperledger is not restricted to only one or-
The blockchain's main operation is that the network should agree on the ledger
within the system. The updating process of the replicas in the system follows a
programmed transition rule in the network with the help of a state machine executing
it on every replica. This process ensures that the state will still be in the system if
some nodes crash. The state machine rule allows for the same execution of outputs
of every node, giving the same inputs and resulting in an agreement in the consensus
protocol. In other words, the state transition rules are the rules of the blockchain
protocol.
The rst property is safety which is when all nodes give out the same output and
the nodes are in line with the protocol. It also refers to the consistency of the
shared states. The second point involves the guarantee of liveness of the consensus
protocol when all valid nodes participate in the consensus producing a nal value.
Fault tolerance is the third property and a consensus protocol can be maintained
if it can live with a few faulty nodes that participate in the consensus process.
Fischer et al. (1985) show that for asynchronous systems all three properties cannot
can elaborate in two dierent ways within distributed networks. The rst category,
called fail-stop faults, causes nodes to stop participate in the consensus protocol by
having hardware or software issues. The second form of faults are Byzantine faults.
Lamport et al. (1980) come across the "Byzantine General's problem". A Byzantine
10
node is able to lie, can give out ambiguous results or mislead other nodes which are
part of the consensus protocol. With a limited amount of Byzantine nodes in the
distributed system, the consensus protocol must reach consensus and the consensus
setup.
In a permissionless network, the number of nodes is large and unknown. Any node
can join the network meaning the nodes are anonymous and trustless. For this
system, the consensus mechanism has to be responsible for malicious behavior, es-
pecially Sybil attacks. Bitcoin solved the problem with a proof-of-work (PoW)
order to add blocks to the blockchain. Following Diedrich (2016) the work is a
non-ending puzzle challenge in which all nodes participate against each other in the
network. The node looks for a hash value given a correct nonce input which is not
greater than a specic number attached with a diculty level set by the system.
The diculty level depends on the Bitcoin protocol and the currently existing hash
power-the hash rate- of the nodes. On average, one block is produced in a ten
minute interval. To solve the PoW task, the node has to nd a matching hash value
and this process is called mining. The node that nds the wining hash value rst
gets the mining reward. Currently, this mining reward consists of 12.5 newly minted
bitcoins and an optionable transaction fee. The mining reward of the bitcoins halves
every four years and in the future there will be only a transaction fee left. However,
in the race to the wining hash value more than one node can nd a matching hash
value at the same time. This means every winning node informs the network about
its new added block to the blockchain which can result in a temporary fork in the
system. In this case by adding more blocks, the branch with the maximum size will
be part of the blockchain, eventually and the other branch will die out.
According to Baliga (2017) the PoW mechanisms have several weak elements. The
rst includes the possibility of 51% attacks in which the attacker can double-spend
his or her funds or can actively dictate which transactions to include on the block-
hain. Eyal et al. (2013) prove a further weakness of the PoW approach. It is
11
called selsh mining, in which honest mining entities are persuaded to join a 51%
attack. Additionally, other factors that inuence the Bitcoin PoW negatively are a
transaction nality and a high transaction rate. The waste of energy computation
for getting the hash values in the mining process is an additional drawback of Bit-
coin's PoW system. On the other hand, the scalability of the nodes participating in
the network is very good and the system is completely decentralized with open-end
participation.
The Bitcoin PoW is not the only PoW in the cryptocurrency environment. Ethereum
has a separate consensus model known as EthHash. EthHash is conrmed faster and
created on ASIC resistance to ght the 51% attacks that Bitcoin is vulnerable to.
that EthHash has been designed. The PoW of Ethereum uses two properties for
tackling mining centralization. The rst one is called memory hardness in which
the computer is able to shift data around in memory unlike pursuing calculations.
The second technique refers to the GHOST protocol that is a revised version of
the Bitcoin PoW. The headers of the recently discarded blocks are contained in the
technique of GHOST. The discarded blocks, called uncle blocks, were part of the
temporary forks and not on the main blockchain. The node that creates the uncle
block and the node that includes the created uncle blocks on the blockchain, receive
a smaller reward to nudge them to work on the current block in the Ethereum
blockchain again. As with the Bitcoin PoW, the EthHash is also looking to nd
a correct nonce input that can give out a hash value below a specic diculty
threshold. Ehereum's PoW also cares about a possible 51% attack. But with the
ASIC design, EthHash can develop a better resistance level in its network than
the Bitcoin PoW. In addition, Ethereum plans to move to a proof-of stake (PoS)
tricity consumption in the mining process. The PoS mechanism is trying to overcome
user's stake or ownership of the cryptocurrency will play a part in the blockchain
system. The amount of coins of each participant will be used as a stake to acquire
blockchain. For instance a user with 200 coins in the system will be two times more
12
Furthermore, the PoS procedure does not need any specialist hardware to mine
the blocks. The PoS algorithm cannot predict the next validator of block creation
incentive to vote on the correct block meaning nodes can vote on several blocks
this circumstance a user with nothing to lose has no incentive to behave honestly.
One possible solution is to instruct a validator to store the coins in a form of digital
vault. In case the validator tries to double fork or vote in the network, his or her
coins will be destroyed. Peercoin implemented the PoS mechanism rstly. Other
Ethereum will release an own PoS algorithm called Casper in the Serenity version
of Ethereum in the future. Casper uses the procedure of digital vaults and hopes to
around today and it is still an ongoing process in the eld of permissionless se-
tups. An alternative consensus protocol is the proof of elapsed time (PoET). This
algorithm works almost as the PoW approach but with less waste of electricity.
blocks is done in a randomized lottery and without any work. The proof-of-activity
mechanism is another one that uses a combination of both PoW and PoS. In the rst
stage, there is a mining process until the winning block only includes a header and
the address of the miner's remuneration. In the second stage, the system enables
PoS and it is based on the headers' information while some validators are selected to
sign the newly created block. The ownership of coins of the validator determines the
probability of the validator's selection. The fees are divided between the miners and
for the computer hardware, the amount of coins permits the user to mine in the
proof-of burn. The more coins the user burns by sending coins to a non-reachable
address, the greater their chances are to mine the new block. The cryptocurrency
Slimcoin uses a combination of PoW, PoS and the proof-of-burn mechanism. In the
proof-of-capacity environment the user will provide hard drive space. The more a
user will supply, the greater is the possibility to mine the newly created block and
13
its consensus mechanism. Additional variations of the proof-of-capacity algorithms
In the permissioned case, the amount of nodes is restrictedly small and the identity
is known, meaning they can be semi-trusted in general. For these reasons, com-
any computer power based mining, such as the PoW, can be implemented. Per-
missioned platforms can rely on and adopt existing algorithms such as Paxos, Raft
those consensus approaches have placed their focus on creating fault tolerance fac-
ing unreliable systems that provided fail-stop faults. Lamport (2001) presents one
ment called Paxos. This consensus algorithm consists of three roles executed by
three classes namely proposers, acceptors and learners. On the one hand, Paxos
or temporary failed nodes. On the other hand, it is built to ensure a reliable net-
a progressive and consistent procedure which can be reached with a state machine
Ongaro et al. (2014) present a consensus algorithm called Raft which is based on
Paxos. Raft focuses on a replicated log and enhances the element of understand-
Paxos and Raft are the same unlike the structure to improve understandability and
tion, log replication, providing a safe system, and membership changes. The servers
in Raft can also be divided in one of the three states similar to Paxos: a leader, the
followers and the candidates. First, the client goes to all the followers, after that, the
log gets to the selected leader. Finally, all the candidates are used to choose a new
leader. The greatest dierence between Paxos and Raft is the leader selection. In
Raft, the leader selection plays an important part while it is not the case in Paxos'
algorithm. Paxos, Raft and further modications of them can order transactions in
distributed systems. These networks can organize generated requests from clients
14
With the tolerance of Byzantine faults, the consensus protocol got more complex
with additional layers of messaging within the system. Castro et al. (1999) show a
"Practical Byzantine Fault Tolerance" (PBFT) algorithm that can provide consensus
with Byzantine faults. The PBFT approach uses the concept of a replicated state
machine and voting. The replicas can be distinguished into primary and secondary
replicas in which the secondary ones review the proper implementation of decisions
from the primary replicas and can be substituted with a new primary in case the
used one is compromised. The replicas can also be used to optimize the signature
and encryption of messages that have been swapped between replicas and clients. A
further optimization involves the reduction of the size and the amount of messages
exchanged for a smooth implementation in the system amid Byzantine faults. The
of the replicated service the PBFT algorithm institutes a low overhead. Following
experiments in the paper of Castro et al. (1999), a 3% overhead can be reported for
a reproduced network le system (NFS) service. Nevertheless, the PBFT algorithm
results. Above the 20 nodes threshold, the messaging overhead goes up tremendously
gateways and also market-makers. Each node needs a denition for a Unique Node
List (UNL). The UNL consists of other Ripple nodes with trust of the existing node
and no collusion against it. A consensus can be reached on the Ripple network when
each node calls other nodes in its UNL. Every UNL needs an interference of 40%
with other nodes in the system. The consensus can be achieved in several rounds
in which each node gathers transactions in a specic data form. The data structure
is known as candidate set and a node relays its candidate sets to other ones. The
validation of the transactions is ensured by the nodes and a voting system. In the
voting system, each node screens its candidate set and sends transactions to the
next round that are getting the largest amount of voting shares. If a candidate set
gets a superma jority, in Ripple's case more than 80% of the accumulated votes from
all the nodes in the UNL, the candidate set can be seen as a valid block or a ledger.
Finally, the ledger is called the Last Closed Ledger and it will be included on the
Ripple blockchain. The appended consensus round begins with new transactions
and transactions that have not been proceeded in the previous round of consensus.
Once each sub-network achieved consensus, the process of consensus in the Ripple
network is completed.
15
2.4 Creating the New Cryptocurrency
and a protocol. The newly invented digital currency will be based on a protocol to
send transactions from dierent participants within the network. The peer-to-peer
will be used as it ensures resilience and decentralization aspects for the consensus
mechanism. The currency will be called ChoiceCoin (CC) and its tokens are called
The architecture of ChoiceCoin will be based on three key modules: the terminal
overview, the blockchain and transaction module, and the consensus mechanism.
central authority will be in charge of the so called terminal overview. One service
component of the terminal includes the registration procedure of the nodes in the
system. Those pre-dened nodes can determine the verication process of the trans-
actions and identify the transaction authority. Furthermore, the central entity will
the new network. In addition to that, the terminal is also authorized to provide the
will provide the overall maintenance of the network. In this perspective, the central
entity can support a fast and exible adoption of new rules and orders and facilitate
16
To implement or change the existing rules in the network, the pre-dened nodes can
set of rules, the nodes can propose it to the central authority. However, it should also
be noticed that the exercising power of the central authority has to be limited and it
cannot play god in the system without any approval by the participating nodes. One
option of the central entity could be a veto right for inaugurating new rules voted
by the majority of nodes. The auditability property signies the terminal can oer
the provision to ensure authorized participants to handle and allow the transactions
of each user using the network. Furthermore, the central authority can also screen
the complete process of the network system in order to improve the eciency and
transaction list which will be submitted to the node leader in the transaction process.
1. Any user can propose a transaction to one of the dened nodes that is authorized
in the network and in the acceptance of transactions. This node will save all its
receiving transaction details such as the hashed values and the amount on a separate
2. All transactions from the chosen nodes will be collected. After that the central
authority will take all transactions from the nodes that sent them to the authority
and order them numerically with a timestamp to a transaction list. The central
authority is also responsible to delete any double entries or wrong sets of transactions
3. The node leader will be determined with a random function in the beginning of
each new transaction round. More details will be provided in the code representation
4. This node leader is the leader of the verication process and takes back the
transaction list from the central authority to submit it to all validator nodes in the
network.
5. The nodes verify the transactions with a consensus algorithm that will be similar
17
6. After several verication rounds and reaching the supermajority the transaction
list can be seen as valid and the list will be transformed to a new block called
7. Following the conrmation of the blockchain by all subnodes, the transaction can
The mentioned transaction process only shows a proper execution of the network
system without any misbehavior of nodes so far. The treatment of malicious nodes
and possible attacks will be covered in the choice of a stable and reliable consensus
algorithm. Moreover, it should be mentioned that any transactions which did not
get into the rst round of verication for "theAddedBlock" might be a part of the
transaction list for the next verication round and the next block implementation.
scalability into three parts: latency, throughput, and capacity and network band-
width. In all mentioned parts, most public blockchain types such as Bitcoin's have
worse properties in those three parts than the permissioned counterparts. As the
blockchain should consist of a high throughput, a low latency and a smaller capacity
and network bandwidth, the private blockcchain is superior to the public ledger pos-
sibility in transferring transactions. Even though the security versus cost trade-o
equips the private case with a lower security than public blockchains, the coming
costs have a bigger impact in choosing the blockchain technology in this case. The
permissioned ledger opportunities do not have to rely on high cost -and unneeded
The consensus mechanisms of public blockchains also aect the transaction scal-
nodes can be semi-trusted while one central authority can organize and change the
blockchain instructions. This will result in a more exible and faster implementa-
tion of new rules and upcoming changes. Since the anonymous structure will be
introduced in the next section, until now anyone of the pre-dened nodes can view
18
3
language. In the following a few key properties will be highlighted to enhance the
pairs from users A to B and C to D. Deposits will be indicated with positive numbers,
while withdrawals will have a negative sign. Each transaction will have a timestamp,
there will be the amount of the transaction for instance "aPays" for the user A and an
individual hash value. However, each node should also save its received transactions
on an extra transaction list in case the transaction details will have to be reviewed
The "txnRawList()" will generate several transactions for each pair of transactions.
In this case 20 transactions will be simulated. This list will be transferred to the
central authority afterwards. There, it will check the transactions in general and
few checks and set of rules for the users and its transactions. Firstly, coins cannot be
created or destroyed by default. In other words the sum of deposits and withdrawals
of each transaction must be zero. The second condition is that a user's account must
4
be covered with enough funds for withdrawals and mitigate overdraft issues. In case
3 The complete code of the simulated blockchain can be found in the appendix section.
4 Those validity checks are dened in the functions "updateState()" and "isValidTxn()" in the
code section in the appendix
19
Figure 8: Code nodeLeader
The node leader is based on a randomized function. In this case there are 24 pre-
dened nodes in the network. Thus, the node leader will be a random number
between one and 24. The node leader will be the leader of the following verication
round and relays the transaction list to all other pre-dened nodes. By applying this
working process, it will be ensured that no node will manipulate any transaction
such as omitting transactions which the node does not prefer or pursuing malicious
behavior. In the next round a new node leader will be determined with the help of
the random function generator. After that the verication process begins. The con-
sensus mechanism will be explained in the next sub-section including the consensus
After successfully executing the consensus mechanism, blocks will be built. The
blocks have the following components: a timestamp of the block creation, a block
number, the previous hash of the parent's block, the amount of transactions ("txns")
and the new block hash. The initial states of users can be found in the denition of
5
the genesis block. In this demonstration, the network assumes each user starts with
60 coins. This assumption will simplify the simulation process with the creation of
show the process in theory. However, in a more practical approach as can be seen
with Ripple, the number of transaction could be 1000 to 1500 transactions per block.
This number is also feasible in the shown approach. The number can be set by the
central authority in the beginning and the dened nodes can also vote to change
5 see Appendix for source code: "# generating the states and the genesis block"
20
Figure 11: Code create nal block
If a superma jority in the consensus algorithm for all the transactions within the
transaction list is achieved, the list will be transformed into a new block called
This code snippet shows the output of chain [1]. The block does have the number one
because the genesis block started with zero. The hash of the genesis block is shown
in the previous hash. Furthermore, all transactions of the users are shown under the
the "blockSizeLimit" section before. Finally, the new block also has a timestamp and
It is also worth mentioning that with this approach and creating the rst block, the
account balances that are denoted, as "state" in the code section for each user, get
updated immediately with all four transactions for the respective user.
Before the dened nodes can send the block to the blockchain, several checks will be
made to verify the chain validity. The checks involve the hash value of the blocks,
6
the validity of the blocks, and the state of the chain. The hash value check should
return that the block component matches the hash. Verifying the validity of the
blocks makes sure each block is based on the previous block and the current state.
It should return an updated state given the block is valid or otherwise send an error
message. Finally, checking the chains ensures the complete chain is valid including
the genesis block. If this is true it will give back the system state and if not an error
due to the nodes. In this approach only full nodes will be accepted in the system.
21
This property is similar to the Bitcoin system. A full node means the complete
Those nodes verify and create the blocks independently starting with the genesis
block until the most recently added block in the network. By checking the validity
of the complete chain, a new node can be protected against misbehavior by others
have to check the validity of the newly added blocks to keep an updated blockchain
structure.
The complete blockchain structure can be compressed to the following code lines:
The expression "nodeBlockchain" returns the respective chain and the "nodeBlock-
Txns" includes all necessary transactions. In this case the four transactions and the
chain represents a new block entry for a dened node in the network.
In the following the "newAddedBlock" is transferred to two nodes, node one and
node two. Those nodes check the block and will update the current state if the
In this example, in the beginning the blockchain consists of six blocks on both nodes.
Following that node one and node two check the state of the "newAddedBlock". If
the check was successful, the result will be a new valid block. The new created block
is added to the blockchain thereby the total amount of the blockchain increased to
22
2.4.3 The Consensus Mechanism
blockchain structure. Thus, the PoW model and with some limitiations the PoS
model, that could also be used in a permissioned setup, will not be ideal for the
setting. The transaction nality is another key issue. A transaction can be seen as
faster on the consensus algorithms of private blockchains than on public ones. Es-
pecially, the PoW and PoET take a longer time based on the model construction
with the danger of several blocks being mined simultaneously. In other words those
Consecutively on the transaction nality argument is the transaction rate. The fol-
lowing consensus should execute and conrm transactions fast. This can be achieved
on a consensus mechanism based on PBFT including the Ripple and Stellar proto-
col and PoS approaches. The cost versus security tradeo also plays a signicant
role to determine a reliable consensus model. Whereas PoW and PoS have a high
cost for the participation process in the consensus with high energy costs in the
PoW approach and high coin expenses for the PoS model, the costs are low for the
of nodes in the consensus system in the permissioned case increases the amount
amount of overhead in the system. Therefore, for a fast system the number of peers
should be around 20 optimally. The level of trust plays no role in the proof of
models in the unpermissioned case. There, the nodes can be untrusted. On the
based on current research at least two thirds of the validating nodes should behave
correctly to maintain a valid consensus process and avoid Byzantine failures. Based
on all these characteristics, the Ripple protocol with slight modications provides
the best option to implement it as a meaningful consensus mechanism for the new
cryptocurrency.
system. The factor of trust is almost negligible and can be made smaller with an
is the consequence of the Ripple protocol with a robust setup in terms of Byzantine
failures and standard failures. Schwartz et al. (2014) dene three main goals that
23
should be satised with the Ripple algorithm: agreement, correctness and utility.
The components to reach consensus of the Ripple protocol are a server, a ledger,
the last-closed ledger, the open ledger, a Unique Node List (UNL) and a proposer.
The server is responsible to run the Ripple Server Software while only registered
user nodes can participate in the consensus procedure. The updated blockchain
with all valid transactions veried in the consensus process is called ledger in the
Ripple protocol. The last-closed ledger is the most current veried block and reects
the recent state of the system. The open ledger represents the current working
block of the nodes reaching consensus. A key specic characteristic of the protocol
involves the UNL. Every server s has a UNL consisting of servers that s asks when
verifying the consensus mechanism. Solely the nodes of s are respected meaning the
UNL can be seen as a sub-network that is trusted by s on a collective perspective.
However, not any participants of the UNL have to be trusted. The proposer element
guarantees only suggestions from servers on the UNL of a server s can be considered
by s itself.
A nonfaulty node behaves honestly in the system, while a faulty node can get an
error either though being honest and getting standard failures based on data issues
or the faulty node performs a malicious behavior with Byzantine errors. To for-
decision given the information on the binary value of zero, implying no success or,
one meaning success. According to Attiya et al. (1984) consensus can be dened
based on three axioms: First, each nonfaulty node decides nitely ( C1). Second, all
nonfaulty nodes get the identical decision value ( C2). The third axiom embodies
for every nonfaulty nodes, zero and one are both feasible values. ( C3).
24
The following algorithm of ChoiceCoin is based on the Ripple Protocol consensus
algorithm (RPCA) with slight dierences. The RPCA runs every few seconds by all
registered nodes. Unlike in the Ripple algorithm, the validating nodes in ChoiceCoin
cannot be run by the central authority in order to boost the decentralized argument
in the verication process. In gure 17, the new cryptocurrency will start with 24
pre-dened nodes and four UNLs with six nodes each in total. It can be seen that
not all nodes need to be linked to each other to reach consensus consistently. There
will be several rounds to achieve consensus. At rst, every server prepares a list
with all unconrmed valid transactions. After checking the transaction list with the
help of the terminal overview, the node leader gets the transaction list back. The
node leader distributes the transaction list to each server on its UNL and starts the
a minimum of yes votes, the transaction will be forwarded to the next round if one
is available. Transactions that do not receive sucient votes will not be processed
in this round or delayed for the next consensus process on the next block.
Figure 18: Transaction Process of 24 pre-dened Nodes and four UNLs in a Network
System
Figure 18 shows the verication process of one transaction in a setup of 24 nodes and
four UNLs. The black color signies unconrmed notications of the nodes, while
the white colored nodes veried the transaction as valid. At rst the node leader,
here number two, gets the transaction, veries it, and relays it to other pre-dened
nodes within the UNL environment. In the rst round, it requires 50% of accepted
votes to send the transaction to the next round. In the second consensus round,
the third number in the gure, the bound increments by 10%, thus 60% of positive
votes are required. In the nal round, consensus needs at least 80% of agreement of
25
can be achieved as long as a UNL of n nodes within the system has the following
property:
f ≤ (n − 1)/5. (1)
The parameter f denes the number of Byzantine failures. As long as this property
holds, the consensus protocol can be maintained. Another main goal is the agree-
ment argument. In case there is only one possible solution in a decentralized system,
this can be referred to the agreement requirement. To reach the requirement, every
nonfaulty node has to achieve consensus on the same list of transactions irrespective
of its UNLs. In the original white paper of Ripple, a fork is an option as long as
the UNL is smaller than 0.2 ∗ n_total. The parameter n_total is the number of all
nodes in the system. To prove the agreement requirement, there is an upper bound:
The upper bound makes sure two sets of UNLs cannot reach consensus on conicting
al. (2015) investigate a possible fork scenario in the underlying Ripple algorithm
and proved that forks are not possible in the system if and only if:
This means instead of the 20% upper bound as presented by Ripple developers,
two intersected nodes of UNLs needs to have more than 40% of shared connections
such that forks are not possible. The developers of Ripple agreed to the proved
17, the intersection amounts to 50% such that a fork is impossible in the algorithm
In this context utility can be dened as the latency of the network. The Ripple al-
gorithm dierentiates utility into convergence, and heuristics and procedures. The
convergence argument veries the consensus will terminate on a nite time schedule.
Convergence is the point when strong correctness is achieved. In other words, equa-
tion (1) and (3) have to be fullled meaning consensus is satised in nite time. The
crucial element for the algorithm termination is the communication latency between
peers. The time to reply between nodes is screened and nodes that have a larger
response latency than a preset threshold b are deleted from all UNLs. Adding to
the convergence component, there are more heuristics and procedures supporting
26
the utility of the Ripple algorithm. To build the initial transaction list on each
pre-dened node, there is a two second window to make a proposal in each round
of consensus. This will guarantee participation of nodes with solid latency. In the
beginning UNLs will be determined by the central entity. This default list can be
changed by the users at a later point in time if favored based on a voting decision.
Schwartz et al. (2014) mention that consensus can also be reached with solely
one round. However, it might lack utility improvements. Several rounds with an
gains because high-latency nodes can be identied more easily. By processing only
one round of consensus, it could be only some transactions satisfy the 80% bound
and also slow-acting nodes can survive leading to lower transaction rates for the
whole system.
The RPCA can handle transactions in a few seconds and it depends on the required
time to accomplish a round of consensus. The algorithm is not the strongest result
for Asynchronous Byzantine failures with only tolerating a default rate of 20%. Nev-
ertheless, it can provide a quick and cheap network with sound safety and reliability
properties.
Critique on RPCA
Nevertheless, the Ripple algorithm faces some weaker points. Todd (2015) mentions
the optimal choice of UNLs is not answered properly and the rst best option of a
node should be to stick permanently with the default starter UNL provided by the
central entity. Additionally, there is no stated incentive why a node should process
a validation service at all. The Ripple algorithm does not possess a compensation
mechanism with transaction fees or a mining process of new coins. Thus, to reduce
potential risk for legal issues or nancial crime, Todd (2015) proposes making the
validation process on the Ripple ledger private. Armknecht et al. (2015) address
the privacy and anonymity issue of the Ripple algorithm. Similar to Bitcoin, Ripple
vacy. In addition, the open payment system with publicly announced transactions
limits the privacy argument in the network and privacy could be improved in the
Ripple system. The centralized element of the Ripple system is a further issue.
maintainenance, a lot of validating servers are also managed by the central author-
ity called Ripple Labs and diminish the decentralized approach in the verication
process tremendously.
27
2.4.4 Further Properties of the Created Cryptocurrency
detail.
Cryptography
ChoiceCoin will use private-to-public key cryptography. First, Chaum (1983) comes
elements can only be calculated in one way and are irreversible. Cryptography
ensures the creation of digital secrets and fraud resistant digital signatures. Any
user of the network will have a key pair. The key pair has a private key for each
user to sign spending transactions of its account balance. Based on the private key,
a unique public key will be generated which is used to receive the funds. However,
ChoiceCoin only uses signatures. The ingredients on the blockchain are not fully
So far, this approach ensures only pseudonymous transaction operations but no full
anonymity of the transactions and its participants. The public key can be recognized
in the network and all participants are able to see it, while the real world identity
7
of the users cannot be traced back. The algorithm used for the private key hash
creation is based on the SHA256 hash algorithm. While for the public key creation
elliptic curve multiplication is used for cryptographic public keys and it is based on
and the money supply. Optimally, the new issued coin should satisfy two goals:
support inclusiveness and maintain a stable store of value. Even under ideal cir-
cumstances, most cryptocurrencies face two kinds of ination. The rst form of
ination refers to price ination meaning an increase of the general price of level of
goods and services in an economy. The second kind of ination can be related to the
money supply due to the implemented issuance process. Ali et al.(2014) emphasize
that many digital currency forms have pre-set money supply paths regulated by
protocols and a xed total supply in the end. They argue that this procedure can
the rigid money supply are deation of goods and services or increased volatility in
For instance Bitcoin limits its coins to a 21 million xed value covered by its algo-
7 see Appendix for source code based on Python programming language of creating private and
public key hashes
28
rithm until around the year 2100 and reducing the coin mining reward approximately
every four years by half. This mechanism fosters deationary tendencies. Litecoin
will issue 84 million coins while pursuing the same approach of increasing coins in
the system as Bitcoin. In the beginning of cryptocurrency launches, many new coins
were pre-minted. For instance Ixcoin had 580,000 pre-minted coins, or SolidCoin
30,000 pre-minted coins meaning the developers minted the coins themselves for a
period of time before the coin went public for all to mint. However, the pre-mining
process cannot be seen as a fair procedure for all participants in the network and
The total supply and the issuance properties of Ethereum's coins, Ether, is not -
nite. The creation of its tokens is restricted to 18 million per year. While the total
issuance is xed, the monetary ination component will decrease every year. The-
oretically, with this approach at some point in the future, the rate of new created
Ether will equalize the calculated loss of misuse such as lost keys, tokens sent to
wrong addresses or also the death of users. But as aforementioned, the Ethereum
network is going to change its consensus algorithm from a PoW to a PoS method
called Casper. The switch signies more eciency and a need for less mining capaci-
ties. With this change the issuance may be altered, but it is still under investigation
Ripple followed a dierent method for the coin issuance and supply compared to
other cryptocurrencies. The token called XRP has a total supply of 100 billion coins
and was created instantly at its inception in 2013. There were a lot of discussions
regarding how to approach the issuance and supply issue. Ultimately, Ripple did
not issue all coins to the public at once to avoid market ooding and uncertainty
regarding the price volatility. In May 2017, Ripple still owned around 60% of XRP
tokens and announced that it will put more than half of its XRP supply, 55 billion,
into escrow by the end of the year. Furthermore, around 1 billion will be given out
to the users each month. This communication approach should restrict uncertainty
how to give out tokens the best way. Only the respective market capitalization of
the total amount of coins is known. ChoiceCoin will have 42 million coins in total
at the beginning. Out of these 42 million coins one third meaning around 14 million
will be given out in an initial coin oering to all registered participants and the
pre-dened nodes. The remaining 28 million coins will be given out such that the
of Peercoin. Peercoin gives out approximately 1% of coins per year to satisfy the
29
ination argument and uses the PoW meachnism to reward the miners and increase
thereby the coin supply. In ChoiceCoin this increasing supply procedure with the
help of miners is not possible since no PoW method and no miners are needed.
Nevertheless the approach will be based on a lottery system. On the one hand,
50% of the new issued coins will be handed over to the pre-dened nodes, while the
other remaining 50% will be given out to all registered users of the cryptocurrency
network. By using this method the pre-dened nodes also have an incentive to
Those users in the network must have done a transaction before and should be in
the network for at least half a year, since the coin issuance will be based on a 6
month interval. In other words, the coin issuance will take place twice per year and
the users must represent a reliable constituent to avoid inationary account creation
on the platform and possible misuse of the coins. The total money supply will be
reached in the year 2128 if no modications will be pursued. The presented idea
with the cap of 42 million coins is only hypothetical so far and it can be changed
anytime because the coin issuance and the money supply are not hard encoded in
the algorithm and it can be modied if desired by the pre-dened nodes in a voting
Transaction fees
Following the original transaction procedure in the blockchain explanation, there is
a transaction fee will be included. The main reason is to incentivize the pre-dened
of lower transaction fees compared to existing electronic payment services with credit
a mining mechanism, which often times have a subsidy for the miners included.
results in new minted coins for the miner. The degree of the subsidy can have
two sources. The rst one is the actual price of the currency. The other reason
depends on the belief of the mining entity about the currencies' price in the future.
The additional revenue gives miners the possibility for accepting smaller transaction
fees- below the marginal cost of conrming a valid block of transactions. On a short-
term basis, the subsidy with the new created currency enables an incentive for the
miners to support and help making the currency more established. In the long term
the supply of money is xed and the mining process with the subsidy mechanism
will disappear. Those currencies will face competition with other payment networks
on the cost issue. In this case, higher marginal costs of cryptocurrencies could cause
30
a competitive disadvantage to centralized systems which can rely on economies of
scale.
In Solidcoin, the fee amounted to always one coin irrespective whether the transac-
tion was only worth one coin or several coins in total. In Bitcoin, the transaction fee
Coin the transaction fee will depend proportionally on the value of the transaction.
For instance a bigger transaction will have a bigger transaction fee. The standard
fee will amount to 0.5 - 1% of the total transaction size at the beginning and can
be changed anytime if desired by the pre selected nodes. Currently, the average
credit card processing fees are between 1.5 to 2%, while Paypal charges around 2%
on average for its service. The reason for oering such a small fee is that Choice-
Coin can handle from 1000 to 1500 transactions per block in a short period of time.
With that amount of transaction handling, the nodes can rely on the economies
of scale generating revenue that is higher than the marginal costs for the nodes.
Nevertheless, the pre-dened nodes should not prioritize transactions with greater
fees. Thus, they should treat each transaction with the same degree of importance
without the inuence of the fees itself. The receiving node which gets the transac-
tion order will collect the fee before adding the transaction to the transaction list.
Amid pre-dened nodes, a second transaction fee method is possible such that each
pre-dened node will get a pre-determined fee for each consensus round. However,
this method can be introduced at a later point in time if some nodes want to switch
sender or recipient in a general system. A user is not able to decision the sending
network if the associated incentives are greater than the marginal costs of supporting
the reliability of the network. Nevertheless, the associated costs are immense for the
running nodes. Besides the bandwidth and processing power, the costs also include
the reputation risk of the nodes and the right choice of selecting valid transactions
from fraudulent ones. Hiding messages is a crucial part in anonymous networks. The
senders consume anonymity and provide the cover trac that builds the anonymous
structures for other participants. Users have an advantage on broad systems due to
31
the noise provided by others.
A strong anonymity system relies on high trac in the network, while the high
smooth process of messages without any delays that is required on a light trac
network to provide anonymous schemes. However, networks with high trac do not
create the best option to hide at all, because if the degree of trust is too centralized
an extensive system can be targeted by insiders and attackers. The attacks can be
various. For instance attackers can chase for the eciency or reliability of nodes
or raise the cost of the running nodes. Back et al. (2001) make clear that an
anonymous network has to take into account the security objectives that consist of
an ecient, reliable and usable approach with the costs included. The security aim
inuences the size of the users in the network and it makes a reference to the possible
approaches, Acquisti et al.(2003) nd out that providing a solid level of trust, those
systems can have unbearable coordination costs. Those costs could only be faced if
Privacy and anonymity are also two dierent components in this environment. Ishai
et al. (2006) make clear that anonymity specializes on hiding the responsible users
that performed the action. The privacy argument focuses on what action has been
Cryptography does not enable anonymity and privacy automatically. Privacy has
been one goal of cryptography for a long time. Chaum (1985) discusses anonymous
digital cash using blind signatures. While many cryptocurrencies with a decen-
tralized structure, take Bitcoin for instance, do not possess true anonymity. Their
transactions are recorded on the public blockchain. However, the true identity of
the users is not available because only the pseudonymous addresses with hash keys
are used. Additionally, if a user transaction has been identied all of that user's
transactions could be unveiled if they do not use a new pseudonymous address ev-
ery time they make a transaction. In practice, Bitcoin oers only weak anonymous
schemes. In general, Blockchain anonymity and privacy are not easy to reach es-
pecially for public blockchains because those ledgers should make all transactions
visible and should generate the verication of the supply of coins. Anonymity and
privacy mechanisms have to present a solution to both issues that can end up in
conicts between the protection of privacy and the maintenance of public veria-
bility. For these reasons, this thesis will include a discussion regarding additional
32
3.1 Mixing the Funds
One possibility that can be used is to mix the funds with other participants. Imagine
there is one group of users and each user will give the same amount of tokens to a
bucket. After that the tokens in the bucket will be mixed and each user will get back
the same starting value of tokens. The incentive behind this approach is that mixing
tokens will make it more complex to assign the original ownership of the tokens.
Following that logic, this procedure will generate some level of privacy. Existing
cryptocurrencies relying on the mixing approach are Dash and PIVX. However,
PIVX announced it will change to the Zerocoin privacy protocol in the future.
the permanent accessibility of the mixing entities meaning the mixers have to be
online all the time. Furthermore the rst implementations of this method needed to
rely on trust to the third party doing the mixing and not stealing the coins.
a normal transaction consists of inputs and outputs and those transactions can be
seen on the public blockchain. Thus, this concept only provides a low degree of
anonymity(see Figure 19). With the help of the CoinJoin mechanism, it is possible
to mix all inputs and outputs and add them as one transaction to the block. There
are still inputs and outputs available from the sender to the receiver but there is not
The concept of CoinJoin is an advanced form of the mixing approach because steal-
ing the tokens is much harder. Böhme et al. (2017) study the implementation of
CoinJoin into the Bitcoin system. According to them, money laundering can be
pursued on this platform using bitcoins and the authors claim it is the cheapest
33
honest users but lack the trust element regarding market hierarchies simultaneously.
The trust element conicts with the anonymous execution of transactions as these
are getting a design target next to security. But recent research by Goldfeder et
al. (2017) states that a users's wallet can be made transparent even though several
rounds of CoinJoin mixing have been performed. The reason is the browser cook-
ies of the users. The mixing procedure can disguise the transaction path between
Important to notice is that in Bitcoin the CoinJoin procedure is not part of the
and it is built on the Bitcoin software. Its main function is to provide instantaneous
transactions with a high degree of anonymity. Furthermore, the digital currency has
which are responsible to oer a decentralized governance system. Every node can
become a "Masternode" as soon as the node proves to be the owner of 1000 DASH
coins. The "Masternode" can vote on essential issues and new proposals and if
passed the new issues and proposals are introduced on the blockchain immediately.
A further feature of Dash is the InstantX function. This function assures that
Masternodes will send transactions in real time because they can reach consensus
internally whose inputs is reserved for the respective output. Moreover, the Dash
system is governed de-centrally by the blockchain via "Masternodes" and its voting
The core feature providing anonymity in Dash is known as the Darksend function.
network does not need a trusted third party because the mixing service will be
provided within the currency system. "Darksend" needs at least three users to start
of 0.1 DASH, 1 DASH, 10 DASH and 100 DASH. All users should state their inputs
and outputs in the proposed denominations while the collection of transaction fees
should be charged in a separate way. The mixing protocol has a limit of 1000 DASH
tokens per session. The intervals are pre-determined and a user will give out requests
to join other clients with the help of "Masternodes". Before the user's transaction
can be a part of the "Masternode", a queue object is published to the system. This
object will include all necessary details including the user's desired denomination.
Moreover, stronger anonymity can be achieved if multiple sessions are pursued. The
34
network to increase the protection of the user's identity.
"Darksend" improves the privacy element of the Dash ecosystem and the fungibility
of its coins. On the other hand, the mixing protocol needs available users who are
willing to mix for the required denominations otherwise there will be no mix. In
addition to that, the anonymity argument has a limit to the amount of participants
in the mixing process. A typical mixing session needs at least three users with
tures. A ring signature depends on a group of users. Inside this group someone
proved that they signed the transaction but it cannot be stated which user was the
signor. Anyone can verify the signature but it is only a random guess to acknowledge
which user really proved the signature initially. Van Saberhagen (2012) emphasizes
two main properties inspired by Okamoto and Ohta's (1991) description of ideal
for every incoming transaction all senders have an equal probability. Unlinkability
refers to outgoing transactions and the proof of sending it to the same user is not
possible meaning if there are two transactions with receivers A and B, it is not
The process of CryptoNote is also based on ring signatures. A user can make a
transaction and take the outputs of available similar transactions on the blockchain
to create the inputs to a transaction based on ring signatures. With the ring signa-
ture, the input verication of one user can be made non-linkable to the user which
without any extra notications to the users. The prevention of double spends can
be achieved through a traceable ring signature. It does not allow the owner of a
token to give a signature on two ring signatures with an equal public key and no
ring signatures are Aeon, ByteCoin or Monero. ByteCoin was the rst one that in-
troduced the CryptoNote protocol in its implementation in 2012. Since the launch,
the protocol has gotten updated many times, for example a multiple signature trans-
action feature has been added. A further approach and the most famous digital
currency with CryptoNote technology can be investigated with Monero that im-
35
Figure 20: Process of CryptoNote
2014 as a revised version based on Monero and uses the so called CryptoNight-Lite
On the positive side, the technology does not require a mixing entity. An additional
advantage is the well established privacy of the technology with proven records.
within the system. A further advantage is the increase of anonymity with more
time elapsed in the ecosystem. The reason is that the outputs will result in the
new inputs of the next mixing section. A higher transaction size results in a clear
as Shadowcash did not implement the technology properly and its blockchain could
be de-anonymized completely. A further risk factor is the fact that those approaches
rate ecosystem to run. Furthermore, the ring signatures have a limit in their ring
size in most cases. Thus, the anonymity is curbed by the number of users in the
ring.
on the Bitcoin protocol but on CryptoNote protocol. Privacy, fungibility and un-
unveil anonymity. The specic amount on a given transaction can increase the pos-
nd out which user paid that amount at a given time. The second attack involves
the needed transaction properties. A pair ( P ,A) consisting of a public key P and an
amount A is required in ring signatures, while other public keys can have the same
36
amount. Therefore, regarding privacy, Monero relies on ring signatures, RingCT
Those three technologies should ensure that the sending and receiving part and the
amount within transactions are hidden. The transaction is private by default on the
(CT) and it is a mandatory feature for all transactions since September 2017. The
ring signatures ensures multiple inputs and outputs, anonymity, and the prevention
of double spending. Untraceable amounts, origins, and destinations are provided for
transactions on the RingCT protocol. Moreover, the coin creation can be pursued on
a PoW mechanism and it is thereby trustless with a veriable security. On the other
side, the ring size of Monero is limited to four to curtail the size of the transaction.
Thus, the anonymity depends on the number of users in the ring and it might be
transactions can have negative eects on the verication of new coin creation and
the knowledge of the existing coin supply. If anyone can get access to the discrete
logarithm of the RingCT protocol that person would be able to create as many coins
Goldwasser et al. (1985) are some of the rst to come across zero knowledge proofs.
Originally, these proofs can be seen as a convention of two computer programs. One
constituent is known as the Prover, while the other part is called the Verier.
The "Prover" tries to convince the "Verier" that a statement is true. Furthermore,
there are three properties a zero knowledge proof has to satisfy. The rst property is
is the second property and only given a true statement, a "Prover" is able to convince
not get any additional information than that the statement is true. In this context a
zero knowledge proof is a proof that a user has knowledge about something without
giving out extra information regarding how the knowledge has been acquired. The
cryptocurrency Zerocoin and its token Zcoin is built on the concept of zero knowledge
proofs. As stated before, PIVX will also apply the Zerocoin method in the future.
An obvious advantage of the following approach is that the procedure does not need
any mixing entity. Moreover, a high level of anonymity can be guaranteed. The
37
anonymity does not depend on the number of users or the ring size. Every user can
use the anonymity set of a used denomination and apply it achieving much higher
scalability properties regarding transactions. All that is needed is just one min-
ing and spending process, while the transaction linkage between addresses breaks.
Additionally, the concept of zero knowledge proofs can rely on a well established
On the contrary, the proof sizes are quite large and can increase the verication
the transaction scalibilty, the question is also where to store the proofs. The zero
If those parameters are unveiled, attackers can inltrate and leak into the system
performing actions such as creating extra coins. Another drawback has to do with
the deployment of the zero knowledge method. The support of the new mining
cryptocurrency ecosystem.
Green et al. (2013) describe Zerocoin as a distributed e-cash system that extends
be exchanged one-to-one with bitcoins. Any user is able to buy a Zcoin in exchange
for the correct amount of bitcoins. This is done via a new Zerocoin mining transac-
tion on the blockchain. It is important to note that the link of a Zerocoin mining
knowledge proofs. When re-acquiring a Zcoin, one will get a totally dierent bitcoin
than the one that was used to purchase the Zcoin initially. It is dicult to determine
at which place the user took out the conversion due to the mixing and creation of
Zerocoin uses three concepts: digital commitments, a one-way accumulator and zero
knowledge proofs. The structure includes four core randomized algorithms. Those
38
In the following λ indicates an adjustable security parameter and C represents a
λ
set of allowable token values. For the Setup algorithm: Setup (1 ) ⇒ params.
For the input of a security parameter, the output consists of global public param-
eters params and an explanation of the set C. Zerocoin's setup routine is a one-
time strong RSA accumulator by Bernaloh and de Mare (1994) and Camenisch and
of two large prime numbers and are based on the RSA-2048 parameters. They were
created and destroyed immediately and are at present resistant even to quantum
computing power.
A core algorithm is the Mint algorithm: (params) ⇒ (c, skc). The input
Mint
parameter is params, while the output is a coin c ∈ C and a trapdoor value skc. For
mining one Zerocoin, the user has to spend a base coin. Each Zerocoin is committed
because the newly created coin does not show the serial number, it is secret, and
the coin refers to the chosen amount simultaneously. Furthermore, there will be a
randomness factor which will be kept secret all the time. The serial number and the
randomness factor form a hash value of the new Zerocoin and those tokens will get
some value as soon as the hash value can be found on the blockchain.
(π, S). For the spending algorithm the inputs are params, a coin c, the trapdoor skc,
some transaction string R ∈ (0, 1) and an arbitrary amount of coins C . The output
Otherwise the output is nothing. In a spend transaction, the user has to include
the created serial number. The spending transaction's main message is its zero
knowledge proof. The proof includes the following statements: the mentioned and
posted valid Zcoin is on the blockchain and secondly this Zcoin has the serial number
properties include the params, the proof π , a serial number S , the transaction
information R, and a setting of coins C . The output will be 1 if C ⊆ C and
(π, S, R) is valid. If it is invalid the output will be 0. The zero knowledge proof is
crucial. Anyone in the system can verify a zero knowledge proof because any user is
convinced that the respective person minted a Zcoin and it included the respective
serial number S. The verier can also check the existing blockchain if that serial
number has been spent before. In addition to that zero knowledge proofs allow that
the veriers have no knowledge about the spending amount of Zcoins. It only nds
one other Zcoin and converts it back to the base coin on the blockchain, it must not
39
be the same as it was created. If only one user would apply this approach, there
would be no anonymity. The anonymity comes from the zero knowledge proofs based
trusted setup, more resources to store on the blockchain, and more computational
This form builds also on the knowledge of zero knowledge proof schemes with some
additional features. The attribute succinct refers to the property that the proof can
be veried in a few milliseconds and has a transaction size of only a few hundred
bytes. With the structure of non-interactive components, the proof only has one
message sent from the proving element to the verifying element. To date, the only
way of creating zk snark proofs is achieved through an initial setup that creates
a common reference string. The common reference string, also called the public
parameters in most networks, is the sharing point of the prover and the verier. The
The idea of Zerocash is to improve the ground work of Zerocoin's protocol. Zerocoin
can only use pre-determined denominations, while the transaction sizes with around
25kb are quite large. In ZCash and its usage of zk snark technology, the proof
sizes are small and allow a fast verication. Another advantage is that it is a very
the tokens from a base coin to an anonymous one because the coins are exchanged
directly.
On the other hand, a trusted setup has to be used as was the case with Zerocoin.
the setup can result in a forgery of coins. A consecutive argument on that point
is the dicult detection of the forged coins in the system because of a non-visible
tions. It can take almost a minute or even more, aecting the transaction scalability
negatively. Finally, the zk snark technology is a relatively new method and lacks a
40
Ben-Sasson et al. (2014) present Zerocash to build a separate anonymous currency
next to a base currency. In Zerocash's system any user can exchange a base coin into
a Zerocash token called Zerocoins and make transactions by sending those coins to
other users. The Zerocash algorithm has the following main components: "Setup",
Two forms of transactions are used in Zerocash's implementation. The rst trans-
action is called Mint" and gives the user the right to exchange a pre-determined
number of base coins for an equal amount of Zcash and a Zerocash address. The
its coin value, owner address and a serial number. The SHA-256 hash function is
used for the commitment procedure and can make the coin's value and owner ad-
dress invisible. The nodes in the Zerocash environment remain a Merkle tree for
the available token commitments. Because of the decommited values and being a
limited witness as a member in the tree itself, every participant can show that he or
she is the owner through a coin commitment. However, this ownership proof is not
private meaning there is a second transaction to maintain privacy of the user and
A private transaction taking some coins from the user to create new coins is done
via a "Pour" transaction. The pour transaction is based on the zero knowledge
approach, and for instance, for two input tokens and two output tokens it contains
that the user has ownership of the two input coins. Furthermore, every input coin
was a member of a previous mint transaction or each output coin was part of a
previous pour transaction. Additionally, the total sum of input coins has to be
the same as the total sum of output coins. This type of transaction ensures that
input tokens only show the serial numbers but not any information about the value
for the mint transaction can be pursued by any user. As stated before, the pour
transaction can be veried via zero knowledge proofs, in Zerocash's case it is done
by a zk snark-approach.
41
Fn x Fh → Fl is caught by the relationRC = {(x, a) ∈ Fn x Fh : C(x, a) = 0l }; while
The algorithm of the zk-snark technology for a given eld F-arithmetic circuit sat-
λ
polynomial timed algorithms. The KeyGen: KeyGen( 1 , C) → (pv, vk). As in-
parameters there is a proving key pk and any (x, a) ∈ RC . As output, it will give
out a non-interactive proof π for x ∈ LC . Finally the last component is the Verify
algorithm: Verify (vk, x, π) → b. For the input attributes verication key vk , x and
a few more schemes will be presented that do not t into one of the aforementioned
concepts. NAV Coin, created in 2014, consists of a mixture of the Bitcoin blockchain
and its own sub-chain. The transactions are encrypted making the sending amount
of coins untraceable. The technology of NAV Coin uses splitting transactions gen-
several blocks with time delays to provide a maximum level of anonymity. Finally,
the transaction parts will be reconnected and separated one more time to create
The cryptocurrency Verge has its origin in the digital currency named Dodge-
CoinDark. It changed its name to Verge in 2016. Verge builds upon the Bitcoin
blockchain and wants to improve the privacy by adding central anonymity networks
with Tor and i2P technologies. Thereby, the user's transactions are routed through
several global servers. Every server in the ecosystem deletes the information of a
previous server such that the last exit node server does not know from which des-
tination the information originally came. Following this procedure, the users can
continue with their transactions as normal while Verge makes the currency trail
42
untraceable.
Showing the fast development in the cryptocurrency sphere regarding privacy and
was established by a hard fork from ZClassic, while ZClassic originated from Zero-
cash. Zencash's main feature regarding anonymity and privacy is built on the zk
snark technology as in Zerocash. However, the developers are also considering a few
will implement "Secure Nodes" which are responsible to run the system and will get
As aforementioned the anonymity is built mainly on the infrastructure and the dis-
the user's behavior and motivation. The dierent examples of anonymity schemes
show that its way of implementation has numerous variants and each structure
presents advantages and drawbacks depending on the environment and on its main
goal. Referring to ChoiceCoin and its modeled structure, several forms of anonymity
schemes are thinkable. Mixing the funds is one possibility, whereby the transaction
linkage cannot be broken entirely. The ring signature approach is also an oppor-
tunity, however, only the dierent pre-dened nodes could be part of the process
limiting the anonymity argument. The zk snark method is also feasible, but the
technology is quite new and lacks a well established research history, meaning it
could have undiscovered aws which could de-anonymize the environment. Thus,
the anonymity scheme with the zero knowledge approach as used in Zerocoin will
be implemented.
This method can be implemented on the existing protocol, the security parameters
can be created by the terminal and the central entity can pursue the mining trans-
action. Furthermore, the zero knowledge technology has a proven research record
ally, even if pre-dened nodes want to send anonymous transactions to each other
approach a pre-dened node and will allow all transaction details to be known
including the anonymity option. Next, the node gives the transaction list including
the desired anonymous transactions to the terminal overview. On the third point,
43
Figure 23: Process of optional Anonymity
the central entity prepares all transactions and performs a mint transaction for the
the terminal overview transmits the anonymous transaction back to the current node
leader. However, the mining process might take longer than the normal process of
checking transactions by the central entity and the anonymous transaction might
be part of the transaction list after several rounds. In the next step, the node
leader veries the transaction and relays it to the other nodes including all the other
transactions for the following transaction round. After the verication procedure,
the anonymous transaction will be appended on the blockchain and stays there.
Finally, in the spending process of the anonymous transaction, one ChoiceCoin token
can be redeemed on the blockchain with a serial number made public, performing a
A user can make an anonymous transaction with Zerocoins any time, for instance
a few moments before an actual transaction to obfuscate the transaction link even
more. For the spending transaction all that is needed is the serial number and all
members of the network. The recipient of the base coin only knows it can be from
one of the many participants who commissioned a Zerocoin mint process without
unveiling the true identity. Furthermore, there will be a xed denomination rate of
0.25 Zerocoins in a one-to-one exchange with the existing coins in the ecosystem.
For instance, a transaction of ve Choicecoins can be made anonymous, then the
user will give a normal transaction to one of the pre-dened nodes. After that,
with 0.25 Zerocoins each. The user can activate the spend process as soon as the
central entity. The hash value H(S, r) consists of a serial number S and a random
secret r. The serial number will be made public in the spending process later on.
44
However, the random secret r will never be made public to ensure unlinkability.
After the mint transaction and the verication process of the pre-selected nodes,
the hash value will stay on the blockchain. On the blockchain, only the hash value
H will be visible. The input values with the serial number S and the random secret
The user who wants to execute an anonymous transaction can wait as long as desired
because its Zerocoin is on the blockchain with the respective hash value H and can
contact the pre-dened nodes or the terminal to spend it. To redeem a transaction
into ChoiceCoins two components are required: First, the serial number S has to
be included which has been generated and not been spent before. The second
requirement is to create the zero knowledge proof which includes that the users
know a number r such thatH(S, r) is one of the Zerocoins on the blockchain. The
randomness r combined with S picks an arbitrary Zerocoin on the blockchain and
The mint -and spend transactions break the links of the base coin completely and
the process can be seen as a huge laundry network. Selecting an arbitrary Zerocoin
in the spending procedure determines the anonymity in the system as soon as more
than one user relies on the anonymous option regarding transactions. Since r is
a secret no one knows which Zerocoin corresponds to the serial numbers. Even
after serial numbers have been revealed and it was inside the hash value H, nobody
knows which hash value it really was. Moreover, the presented approach should be in
accordance with anonymity and privacy mechanisms that have to present a solution
to both issues between the protection of privacy and the maintenance of public
blockchain and the privacy is not mandatory but it is a possible option for each
participant in the system. The users can weigh the timing and anonymity argument
individually and it allows them to make a choice while providing a exible approach
anonymous transaction scheme as soon as the transaction scalability can reach the
same level as without the anonymous option through a voting decision by the pre-
dened nodes.
4 Conclusion
One of the main goals of this thesis was to build a cryptocurrency from the ground
up with specic properties. Three key components are required for the creation:
45
cryptocurrency can have various spectrums. The core properties as presented in
and an optional anonymous transaction possibility created within the protocol. Fur-
thermore, the terminal overview providing a exible adaptation to change the set
of rules via a voting system by the nodes, and the node leader component congure
ChoiceCoin with unique details that other cryptocurrencies do not oer directly.
authority, in this case the terminal overview, is not available, the transaction pro-
cess cannot be executed. That is a risk factor that all participating users have to
thority and almost no possibility to shut it down by one or several attacks on its
network. The cost of maintenance and support, the limited performance and the
fault tolerance factor aecting the robustness of the ecosystem are clear properties
that inuence the decision making of choosing a blockchain. Blockchains are supe-
rior in the provision of a robust and fault tolerant system, while its shortcomings can
tralized approach for the underlying network, a blockchain is more reasonable than
relying on a databank. One reason is that the 24 pre-dened nodes should verify
the transactions and update its blockhain themselves without any dependency on a
central authority. Furthermore, if one node cannot be reached, there are sucient
nodes available and up-to-date to execute the verication process. The robustness
and research is still at an early stage and it is highly probable that improvements
the network is responsible for providing anonymity and privacy to the participants.
The users have to rely on the system and its operating entities. But participants
resulting in noise for the system. In the cryptocurrency sphere, each anonymity and
privacy structure has its individual set of benets and drawbacks including respective
on the zero knowledge proof method pursued by Zerocoin. The reason to provide
an optional approach only is the transaction scalability which takes longer if a user
46
wants to make an anonymous transaction. Furthermore, anonymousness depends
also on the user's preferences and oering an option between choosing anonymity
A faster anonymous transaction is also possible, for instance with the zk snark pro-
cedure. But the technology is not well established, yet and as anonymity can only
teed as a core property for the underlying ecosystem. Thus, pure zero knowledge
proofs have a detailed research history and a proven record as a resilient and stable
47
A Appendices
A.1 Glossary
51% attack: A mining pool is able to control 51% of the mining power (hash rate)
meaning it can include its own blocks into the blockhain. Additionally, it can pursue
a fork to make an independent branch that can merge with the main blockchain part.
that is custom-designed for just one application for instance Bitcoin or Ethereum
mining.
between nodes. Furthermore, there are no strong assumptions on time and ordered
events.
Byzantine generals' problem: The main idea of this problem is that there are
several generals and every general has the command of its Byzantine army to attack
an enemy city. However, to execute a successful attack, all generals need to reach
agreement on a common battle plan. The generals can only communicate with
messengers. It is possible that those messengers might get captured by the enemy
and the original message does not arrive the others. The main diculty of that
problem is that some generals could be traitors and are interested in sabotaging the
battle plan. Within this environment some generals might send inaccurate messages
but the loyal generals should be unaected tolerating a small fraction of traitors and
should improve the privacy and security of Bitcoin. The transferred amounts will
be visible only to the users in the transaction and to those that verify it. The
data without an increase of transaction size. The idea according to Back (2013) is
PoW and used in Ethereum. The GHOST-protocol was introduced in 2013 to com-
bat the way that quick block time in blockchains suer from a big amount of or-
phaned blocks. This protocol includes orphaned blocks, called uncle blocks, and its
rewards are 87.5% for normal valid blocks, while the nephew, the child of the unlce
i
blocks, gets 12.5% of the rewarded block.
Hash rate: The total amount of existing gear in the network to solve puzzles/ tasks
in a PoW mechanism. In Bitcoin, the hash level changes over time as miners can
join or leave the network. A higher hash rate results in a better network protecting
against attacks.
increased anonymity with an overlay network. The i2P network is a network within a
network. The main goal is to protect the communication within the system from drag
net surveillance by additional parties such as ISPs. The users' trac is encrypted
and runs through several thousand computers worldwide. The nearly unlimited
possibility of trac paths makes it harder to follow for monitoring and surveillance
Latency announces the delay time it takes from an input to a desired outcome within
a system. This term aects the usage especially of communication of network system.
sibility.
ory and not with calculations. Furthermore, it is a property that general purpose
computer hardware is already designed to perform well but it cannot really lead to
ecient results on ASICs. With a resistant algorithm to ASIC, it can prevent large
powerful rms from out taking control of mining power in the Ethereum system.
Denition: A key vector is just a collection ȳ = (y1 , ..., yr ) of public keys with
The rst intention behind the MLSAG is to provide a proof that one of the n signers
knows the secret keys to the complete key vector. In addition to that another
component sketches the MLSAG signature. If a signer uses one of the m signing
ii
keys in a dierent MLSAG signature this means both rings are linked and the second
and satises three key properties: Unforgeability, Linkability, and Signer Ambiguity.
Network File System (NFS): It consists of a distributed le system and gives
users access to a client computer to demand les over a computer system. The NFS
has an open standard form and anyone can implement the protocol.
Protocol: It describes how communication should work and provides several ways
a set while not publishing the individual members of the set entirely. The RSA
data transactions. In this system a user builds and shows a public key based on
two large prime numbers while those prime numbers must be kept secret to mitigate
Elliptic Curve Digital Signature Algorithm (ECDSA) curve. The secp256k1 is used
among others in Bitcoin and its denition can be found in Standards for Ecient
Cryptography (SEC).
separates signature data from bitcoin transactions. It is a soft fork and should make
Segwit 2x: It is a software upgrade and improves the capacity of the Bitcoin
The expected date of the hard fork was November 16th and it should be done when
Bitcoin block 497,784 was mined. However, the date was postponed and the hard
fork took place on December 28, 2017 on the block number 501,451.
Selsh mining: In this form of attack, the attacker gains a lot of mining power
at the cost of his/her short term revenue with the maintenance of an own private
blockchain to the existing blockchain. He/She publishes a lot of blocks at once and
forces the rest of the network to give away their blocks and revenue. This is an
iii
incentive to honest miners to follow the attacker and to increase its revenue that
nally can get the 51% of the network mining power. It is another way of a 51%
attack.
Serenity: It is a name used in Ethereum ecosystem for the last phase to switch
from the PoW mechanism to the PoS mechanism called Casper. The Serenity pahse
will be implemented via a hard fork from the ocial Ethereum blockchain.
In most cases, SDKs have a sample code that supports developers with example
programs and libraries. The developers can create basic programs via SDKs and it
eventually helps them to build more complex applications. Furthermore, SDKs can
Throughput tells the amount of units of information a system can process in a xed
period of time. The response time between single users to request and receive the re-
sponse, and the speed of workload time are related measurements to the throughput
component.
cation. Tor is an overlay network system and provides internet trac with the help
of several thousand relays. The relays are based globally and try to help making the
location and usage of the participants' trac and network surveillance invisible.
The following Python code has been executed on Python version 3.4
iv
i f type ( msg ) != str :
msg = j s o n . dumps ( msg , s o r t _ k e y s=T r u e ) # the keys w i l l be sorted_
to guarantee repeatability
i f s y s . v e r s i o n _ i n f o . m a j o r == 2 :
return ( h a s h l i b . s h a 2 5 6 ( msg ) . h e x d i g e s t ( ) , ' u t f −8 ' )
else :
return h a s h l i b . s h a 2 5 6 ( str ( msg ) . e n c o d e ( ' u t f −8 ' ) ) . h e x d i g e s t ( )
import random
import time
random . s e e d ( 0 )
def m a k e T r a n s a c t i o n ( maxValue = 5 ) :
bPays = −1 * aPays
print ( t i m e s t a m p 1 )
time . s l e e p ( 0 . 1 )
dPays = −1 * cPays
print ( t i m e s t a m p 2 )
# It w i l l always return transactions that respect the conservation_
of tokens .
return { u 'A ' : a P a y s , u 'B ' : bPays , u 'C ' : c P a y s , u 'D ' : d P a y s }
v
# Send the txnList to the central authority
# The central authority w i l l check the defined set of rules and_
rank the transactions in an order regarding the timestamps
for k e y in t x n :
i f k e y in s t a t e . k e y s ( ) :
s t a t e [ key ] += txn [ key ]
else :
s t a t e [ key ] = txn [ key ]
return state
return F a l s e
else :
acctBalance = 0
return F a l s e
return True
vi
random . s e e d ( 0 )
master_node = random . r a n d i n t ( 1 , 2 4 ) ;
print ( " The leader node will be the following node : " + str ( m a s t e r _ n o d e ) )
# The node leader w i l l relay the transaction l i s t to a l l other_
pre defined nodes
# Consensus algorithm
#The consensus mechanism w i l l be explained in the section_
" the consensus algorithm "
# Block creation
# Generating the s t a t e s and the genesis block
state = { u 'A ' : 6 0 , u 'B ' : 6 0 , u 'C ' : 6 0 , u 'D ' : 6 0 }
# Definition of i n i t i a l s t a t e s
genesisBlockTxns = [ state ]
u ' txnCount ' : 1 , u ' t x n s ' : g e n e s i s B l o c k T x n s , ' timestamp ' : time . time ( ) * 1000}
chain = [ genesisBlock ]
print ( c h a i n )
time . s l e e p ( 0 . 1 )
time . s l e e p ( 0 . 1 )
txnCount = len ( t x n s )
blockContents = {u ' timestamp ' : timeStamp , u ' blockNumber ' : blockNumber ,_
blockHash = newHash ( b l o c k C o n t e n t s )
vii
return block
newTxn = t x n R a w L i s t . pop ( )
t x n L i s t . a p p e n d ( newTxn )
else :
print ( " T r a n s a c t i o n is invalid ")
sys . stdout . f lu s h ()
c h a i n . append ( theAddedBlock )
chain [ 0 ]
chain [ 1 ]
print ( c h a i n [ 1 ] )
state
print ( s t a t e )
return
viii
def ch ecki ngBlo ckVa lidi ty ( block , parent , state ):
i f i s V a l i d T x n ( txn , s t a t e ) :
state = u p d a t e S t a t e ( txn , state )
else :
raise Exception ( ' I n v a l i d transaction in block %s : %s ' %_
( blockNumber , txn ) )
blockNumber )
return state
ix
## Data input processing : Verifying that the chain is a list_
of dictionaries
i f type ( c h a i n ) == str :
try :
chain = json . loads ( chain )
state = {}
checkingBlockHash ( chain [ 0 ] )
parent = chain [ 0 ]
parent = block
return state
checkingChain ( chain )
checkingChain ( chainAsText )
#conclusion of a l l together
import copy
x
nodeBlockTxns = [ makeTransaction ( ) for i in range ( 4 ) ]
newAddedBlock = makeBlock ( nodeBlockTxns , n o d e B l o c k c h a i n )
try :
print ( "A new block is in the system and in the verification process ! ")
except :
print ( "No valid block ! Waiting for the next block . . . " )
import bitcoin
key = b i t c o i n . random_key ( )
xi
to get a public key point
public_key = b i t c o i n . f a s t _ m u l t i p l y ( b i t c o i n . G, decoded_key )
if ( public_key_y % 2) ==0:
else :
compressing_prefix = ' 03 '
hex_compressing_public_key = compressing_prefix +_
b i t c o i n . e n c o d e ( public_key_x , 16)
" , hex_compressing_public_key )
The following R source code has bee used for the representation of
gures 17 and 18:
g <− add_e d g e s ( g , c ( 1 , 7 , 2 ,8 , 3 ,9 , 1 0 , 1 3 , 1 1 , 1 4 , 1 2 , 1 5 ,_
# 50% threshold
V( g ) $ c o l o r [ 1 ] <− " w h i t e "
V( g ) $ c o l o r [ 3 ] <− " w h i t e "
# 60% threshold
V( g ) $ c o l o r [ 5 ] <− " w h i t e "
V( g ) $ c o l o r [ 8 ] <− " w h i t e "
# 80% threshold
V( g ) $ c o l o r [ 6 ] <− " w h i t e "
V( g ) $ c o l o r [ 1 2 ] <− " w h i t e "
xiii
References
Acquisti, A., Dingledine, R., Syverson, P. (2003), 'On the Economics of Anonymity',
Volume 2742 of the series Lecture Notes in Computer Science pp. 84-102.
Alwen, J., Fuchshuber, G., Gazi, P., Park, S., Pietrzak, K. (2015), `Spacecoin: A
Androulaki, E., Capkun, S., Karame, G. O., Roeschlin, M., Scherer, T. (2013),`Eval-
uating User Privacy in Bitcoin` Financial Cryptography and Data Security pp. 34-
51.
O'Reilly.
http://radar.oreilly.com/2014/02/bitcoin-security-model-trust-by-computation.html,
Armknecht, F., Karame, G. O., Mandal, A., Youssef, F., Zenner, E. (2015), `Ripple:
Back, A., Möller, U., Stiglic, A. (2001), `Trac Analysis Attacks and Trade-Os in
Barber, S., Boyen, X., Shi, E., Uzun, E. (2012), `Bitter to Better- How to Make
Bitcoin a Better Currency', Financial Cryptography and Data Security pp. 399-
414.
Baran, P., (1962), `On Distributed Communication Networks', The RAND Corpo-
Bech, M., Garatt, R., (2017), `Central bank cryptocurrencies', BIS Quartely Review,
September 2017.
to digital signatures, EUROCRYPT '93, vol. 765 of LNCS, 1994, pp. 274285.
Ben-Sasson, E., Chiesa, A., Garman, C., Green, M., Miers, I., Tromer, E., Virza,
xiv
Ben-Sasson, E., Chiesa, A., Tromer, E., Virza, M . (2015), `Succinct Non-Interactive
cessed: 11.01.2018.
Bonneau, J., Clark, J., Felten, E. W., Kroll, J.A., Miller, A., Narayanan A. (2014),
Brown, A., Godsi, P., Kewell, B., Maull, R., Mulligan, C. (2017), `Distributed
ledger technology: Applications and implications*', 2017 John Wiley & Sons, Ltd
Brown, R. G., Carlyle, J., Grigg, I., Hearn, M., (2016), `Corda: An introduction'.
Böhme, R., Möser, M. (2017), `The price of anonymity: empirical evidence from a
Cachin, C. (2001), `Distributing trust on the internet`, IBM Research Zurich Re-
search Laboratory.
Cachin, C., Liu, S., Viotti, P., Vukolic, M., (2016), `XFT: Practical Fault Toler-
ance beyond Crashes', 12th USENIX Symposium on Operating Systems Design and
Implementation.
xv
Castro, M., Liskov, B. (1999),'Practical Byzantine Fault Tolerance', Proceedings
Big Brother Obsolete', Communications of the ACM, Volume 28 Issue 10, pp. 1030-
1044.
acceseed: 11.01.2018.
cessed: 11.01.2018.
blog.cryptographyengineering.com/2013/04/11/zerocoin-making-bitcoin-anonymous/,
Dolev, D., Lamport, L., Pease, M., Shostak, R. (1987), `The Byzantine Generals',
xvi
Druschel, P., Rowstron, A. (2001), `Pastry: Scalable, Decentralized Ob ject Location,
11.01.2018.
Eyal, T., Gencer, A. E., Sirer, E. G., van Renesse R. (2016), `Bitcoin-NG: A Scalable
Implementation
Eyal, T., Sirer, E. G. (2013), `Ma jority is not enough: Bitcoin mining is vulnerable',
Consensus with One Faulty Process`, Journal of the Association for Computing
Gernandt, A., Gipp, B., Meuschke, N., (2015), `Decentralized Trusted Timestamping
Goldreich, O., Micali, S., Wigderson A. (1991), `Proofs that Yield Nothing But Their
the Association for Computer Machinery, Vol. 38, No. 1, July 1991, pp.691-729.
Goldwasser, S., Micali, S., Racko, C. (1985), `The Knowledge Complexity of Inter-
304.
Gomber, P., Hinz, O., Nofer, N., Schiereck, D. (2017), `Blockchain`, Springer Fachme-
dien Wiesbaden.
Green, M., Garman, C., Miers, I., Rubin, A. D. (2013),` Zerocoin: Anonymous
xvii
Greenspan, G. (2015), `MultiChain Private Blockchain-White Paper`.
d/1Z4M_qwILLRehPbVRUsJ3OF8Iir-gqS-ZYe7W-LE9gnE/edit
Anonymity`.
Johnson, B., Grossklags, J., Laszka, A., Moore, T., Vasek, M. (2014), 'Game-
Bitcoin Research
Kosba, A., Miller, A., Papamanthou, C., Shi, E., Wen, Z. (2016),' Hawk: The
Lamport, L., Pease, M., Shostak, R. (1981), `The Byzantine Generals Problem',
of Technology.
Mazieres, D. (2015),` The Stellar Consensus Protocol: A Federated Model for Internet-
Medium (2017), `Let's Build the Tiniest Blockchain-In Less Than 50 Lines of Python',
https://medium.com/crypto-currently/lets-build-the-tiniest-blockchain-e70965a248b,
2008.
accessed: 11.01.2018.
xviii
CRYPTO '91, LNCS 576, pp. 324-337.
Schwartz, D., Britto, A., Youngs, N. (2014), `The Ripple Protocol Consensus Algo-
Steemit (2017), `An overview of blockchain privacy mechanisms and how Zerocoin
overview-of-blockchain-privacy-mechanisms-and-how-zerocoin-in-zcoin-usdxzc-not-zcash-
Swan, M. (2015), `Blockchain-A blueprint for a New Economy`, O'Reilly Media Inc.
wavesplatform.com/review-of-blockchain-consensus-mechanisms-f575afae38f2, 31.07.2017,
ZCoin (2017), `Understanding how Zerocoin in Zcoin works and how it compares to
zcoin-works-and-how-it-compares-to-other-anonymity-solutions-part-1/, 20.03.2017,
xix