Gulden PoW2
Gulden PoW2
Gulden PoW2
Malcolm J. MacLeod
malcolm@gulden.com
Gordons Bay, South Africa
Abstract
“Great engineering is the art of intelligent compromise” - Dan Watts
The release of Bitcoin and the blockchain technology that powers it has
ushered in an exciting new era for digital currencies and distributed computing,
seemingly bringing into existence what many had thought impossible; a trustless
decentralised currency. However like many great inventions in the past, this
progress was achieved not by breaking any rules of nature or limitations that
people imagined stood in the way, but rather by taking a long hard look at the
requirements and then coming up with a clever new compromise.
Most inventions of any significance contain many compromises and Bitcoin is
no exception, as with most groundbreaking new systems, it would be naive and
unrealistic to expect that the first iteration would get everything 100% right. It
stands to reason that there is room for improvement.
It has been over 8 years since Bitcoin burst onto the scene and numerous
competitors have since come and gone, some of them bringing some minor im-
provements to the table, but overall very little meaningful progress has been
achieved in core areas. It is my belief that a sober and proper reflection on the
current shortcomings, as well as real solutions to some of them are necessary, or
this promising new technology may easily falter while still in its infancy. This
article attempts to pinpoint what I believe are the shortfalls and compromises
of current blockchain technology, and analyse them in search of ways to improve
the system, with the goal of implementing these improvements in our virtual
currency Gulden.
Keywords: Blockchain, Gulden, Bitcoin, Distributed consensus, Hashcash,
Proof of Stake, Proof of Work, PoW²
but without having a central authority in the system that decides on or controls
this order, where all peers in the system are essentially equal and none of them
have any special control over the system.
The blockchain is not a perfect trustless distributed system, but it is a trust-
less distributed system. It achieves this compromise by relaxing one of the cri-
teria slightly, namely instead of history being 100% incorruptible/unforgeable
it settles instead for a history that would be incredibly difficult to tamper with
or forge with the assumption that when applied to a monetary system this re-
quirement is sufficient. I will touch more on this later in the paper, first I want
to focus on the great benefits that this allows:
1. No centralized point of failure, there is no single piece of infrastructure
that can be taken down that can cause an interruption of service or a loss
of history. Traditional alternatives are very susceptible to this, and we
have seen numerous cases in history of banks losing peoples transaction
history or e.g. of the Visa network going down and being temporarily
unusable.
2. No centralized control, nobody can control the network and tell it what to
do, everyone must play by the same rules. This eliminated the possibility
for corruption and embezzlement that has plagued the banking industry
in the past.
3. No oversight required – In most countries today it is not possible to open
a new bank or payment service without complying to mountains of le-
gal requirements and oversight from government, and not without good
reason. Without such oversight the central authority can easily make off
with everyone’s money1 . Due to (1) and (2), a blockchain based service
bypasses the need for all this legislation, allowing for services to be rolled
out internationally, faster and cheaper.
While blockchains are certainly not limited to payment systems, or currencies,
and there has been of late many attempts to use the same concept for numerous
other use cases, this paper is written from the perspective of Gulden a digital
currency and therefore everything that follows is in the specific context of de-
centralised virtual currencies and specifically Gulden, and should therefore be
read as such.
2. The problems
1 Not an uncommon thing when one looks for instance at pension funds, and even with the
technologies.
2.1 Double spends 3
have already become visible/obvious to the public on larger currencies like Bit-
coin and some of them may only become obvious at a later date3 . Many of these
problems are inherent or a side effect of the distributed nature of a blockchain
and therefore may at best be mitigated, while others are only limitations of the
initial implementations and could potentially be overcome. The first step of
course is to identify these problems. Below is not a comprehensive list of all
possible problems, but a list of problems that the Gulden team considers to be
the most important to look at, at this point in time.
3 As the number of users grow and/or the blockchain or transaction numbers on it grow
a 0-conf transaction or one that has already entered the blockchain, more information on the
various methods in the subsections that follow.
6 Straight after the next block is mined, or even as soon as the conflicting transaction reaches
them.
7 Online targets like exchanges are ideal targets if they are foolish enough to accept 0-conf.
2.1 Double spends 4
have the same luxury. For younger virtual currencies like Gulden a more viable
solution is needed here than to pretend that everything is okay and hope that
we grow past the point where it is an issue.
• Censorship; The attacker can deny specific transactions access into the
blockchain by not mining or acknowledging any blocks that contain the
transaction.
• Denial of service; The attacker can mine empty blocks (2.7.2) thereby
denying service to the network.
• Double spend; The attacker can out mine the network with relative ease
and thus execute double spends (2.1) at will.
Thus it is relied upon that at all times obtaining 50% or more8 of the hash
rate should be difficult or impossible to achieve. For Bitcoin which is the most
famous and largest blockchain based currency this is easy to achieve but for
other newer coins this can be difficult.
8 Actually even as much as 30% can be a problem after factors like selfish mining are taken
into account.
2.4 Side chains 6
as long as he wishes9 , but he can immediately start mining a second block that
refers to the currently found block even though he has not broadcast it yet. This
process is known as selfish mining, in the simplest of cases it can be used by a
large miner to gain a slight advantage, by delaying broadcast of all blocks found
by even a few seconds a miner increases his chances of finding blocks compared
to the rest of the network. However this can also be abused in more sinister
ways10 – a miner with approximately 33% hash rate engaging in selfish mining
could in theory (with a bit of luck) obtain enough advantage to execute a >50%
attack i.e. a >50% attack does not necessarily actually require >50% of the
hash rate. Eyal and Sirer [9] Garay et al. [10]
9 The only restriction being that somebody else might get a block out first.
10 A ’side-chain’ for the purposes of a >50% attack is really in a way just a specialised form
of selfish mining.
11 One that is larger than the main chain.
12 Brief details in the subsections below.
13 For Gulden 2.5 minutes, 10 minutes for Bitcoin.
2.7 Transaction capacity limitation 7
14 Which are provably unsafe and ultimately a sad story waiting to happen.
15 Bitcoin clients reject any blocks that have a timestamp more than 2 hours in the future.
16 Timestamp is limited to 1 minute in future, and median of the last 3 blocks.
17 Which brings with its own unique problems that we will discuss later in the paper.
18 Or blocks if the difficulty algorithm is slow to adjust.
19 For Gulden/Bitcoin 1Mb.
2.8 Sybil attack 8
Even at the worst points where over 170 000 unconfirmed transactions were
pending on the network, some miners were still mining completely empty blocks
blockchain.info [4, 5]. As long as miners can do this there is the possibility that
service can be denied simply by mining empty blocks. While there were some
arguments in the past that the network could just refuse empty blocks (for
instance) the reality is that this is problematic as it opens up other possible
ways to attack the network. What is certain is that any coin that is to scale
larger and succeed in the long term needs to address this design flaw.
people who implement blockchain based systems to be aware of, rather than a
serious underlying issue with blockchains themselves. More in depth information
on the concept can be obtained in the following paper: Douceur [8]
23 Some better thought out and implemented than others, which might be said to be more
Litecoin was in its infancy there were fewer people with the knowledge required
to execute a >50% attack and less financial motivation to do so as there was a
lot less capital being thrown around. This ’early mover’ advantage, therefore,
means that the same can’t necessarily work for other virtual currencies, and real
world experience has shown that indeed for most it doesn’t.
There are several other problems that a new algorithm brings which need to
be considered:
• If inventing a brand new algorithm, the new algorithm could have flaws
that can be exploited. If the hash is not completely randomly/evenly
distributed for example an attacker could manipulate the input blocks to
gain an advantage. If a flaw were found an attacker could exploit it to
hash at a significantly faster rate than anyone else. To make a new hashing
algorithm that is proven to be reasonably secure and randomly distributed
in a proper way is a huge undertaking one that usually involved multiple
experts over a large period of time29 ; it is something out of the reach of
most if not all virtual currencies in terms of budget and practicality.
1. Assuming the same block size limit more transactions per second can be
processed if blocks occur more frequently. Allegedly solving 2.7.
2. The average time a user has to wait to have their transaction confirmed
is lower if blocks come in more frequently.
These arguments do hold true to an extent, the faster a user’s transaction enters
a block the less likely users/merchants are to resort to trusting 0-conf transac-
tions. A 1 Mb block every 2.5 minutes instead of every 10 minutes does imply
four times the transaction capacity limit. However, there are limitations to how
far this can be pushed; a 1 Mb block takes a certain amount of time to propa-
gate to all nodes on the network based on latency between the nodes, the time
it takes to verify the block before it can be passed on, and the time it takes to
transfer the 1 Mb of data. This time fluctuates depending on the CPU speed of
nodes, the bandwidth between nodes, the number of nodes in the network and
various other factors. More in-depth analysis Decker and Wattenhofer [7].
Long block propagation times can have very negative consequences for the
network; in the best case it can lead to a higher orphan/fork rate which in
turn can lead to a centralisation of mining with likelihood of this increasing as
the propagation time rises, in the worst case the propagation time can start
to exceed the block target at which point the entire decentralised network can
begin to splinter and consensus breaks down. A comfortable margin should be
allowed so that on occasions where the network operates slower than normal
problems do not occur as a result.
More frequent blocks also mean a lower difficulty target per block and there-
fore lower security per block, combined with the increase in forking this means
the number of confirms users should wait for is much more than the recom-
mended 530 that users should usually wait for a Bitcoin transaction.
Another side effect with faster block times is the increased overhead of all
the extra header data. While it sounds like a small thing the size of a few million
headers quickly starts to add up and bloats the blockchain size, this can have
a very negative impact on mobile SPV wallet users that have to fetch all the
headers. It can also have an impact on people trying to use full nodes as more
hard-drive space is required and a longer chain download, inevitably this means
less full nodes are available which in turn has further detrimental effects on the
network.
Sadly many virtual currency authors31 have opted for faster block targets
than this, as it makes for a good story to sell and good press if their currency can
make claims such as “We can handle as many transactions per second as Visa”,
what adds to this problem is that the problems are not immediately obvious to
users, as long as the network only receives a small amount of transactions per
block32 the propagation times will remain fast so it will appear as if everything
works fine. Only later on in the currencies life if/when the transaction volume
grows will it be revealed that the claims are essentially bogus.
This is not to say that 10 minutes is the optimal time and that there is no
room for changes at all, Gulden operates with a 2.5-minute target which is a
good compromise. 2.5 minutes gives a faster 1-conf and more regular confirms
without massively increasing the number of confirms a user should wait for
and leaving enough room that propagation times should not become an issue,
though with less margin for error than what Bitcoin has. It is my belief that
there is not room to go a lot lower than this, 2 minutes should still be okay,
below this starts to head into dangerous territory in cases where the network
operates slower than normal and anything below 1 minute is a disaster waiting
to happen. Any block target faster than 2.5 minutes should come with techno-
logical advances that improve on propagation time in order to be sustainable,
and even at 2.5 minutes propagation improvements are definitely on the agenda
for future Gulden development.
3.3.3. Bribing
Due to 3.3.2 it becomes possible38 for an attacker to bribe otherwise ’honest’
miners to participate in their attacks, by paying the miners a slightly higher fee
than they would earn otherwise.
1. Select eligible miners via a deterministic ’lottery’ like algorithm, where the
blockchain acts as ’random’ entropy and a winner (or winners) is selected
using an algorithm based on this entropy.
2. Let eligible miners compete to mine a hash for the block, in a regular PoW
like manner, with their stake giving them a ’discount’ on the difficulty of
the hash that they need to find.
This process becomes the obvious point for an attacker to try and find an
exploit or advantage. Stake grinding is one such flaw, which works as follows,
an attacker uses processing power to repeatedly alter/generate a vast amount of
’alternate’ histories going back one or more blocks, until he finds one for which
his stake will win more often, an attacker can generate multiple alternate chains
in this manner for ’free’ limited only by his processing power. At worst if one
party does this it allows that party the potential to gain a huge advantage and
thereby attack the chain if he desires, at best all miners do this and the PoS has
now essentially degenerated into a somewhat difficult to use and erratic PoW
that is at best ’as good’ as PoW but realistically worse as it is not designed to
operate in this manner.
40 Once again revolving around time which is an important and difficult issue in distributed
computing.
3.3 Proof of stake 15
things that they are no longer using, and also are unlikely to understand or
care that their empty accounts may still have a value to an attacker; as such
they are unlikely to maintain proper security or erase old wallet copies that held
money in the past but are now empty. If an attacker can gain access to such
a wallet41 they can use this to perform an attack while expending almost no
upfront resources of their own.
1. As a claim that this solves 3.3.2 because ’coin age’ is now the ’something
at stake’ - these claims are however dubious.
2. As a claim that this makes mining more fair in that people with fewer
coins have a larger chance of eventually staking, thereby allegedly avoiding
a situation of ’centralisation’ whereby the ’rich’ generate more income by
staking and eventually come to dominate all coins as a result.
3. So that users can only log in occasionally to stake instead of trying to
work constantly, working around the problem described here: 3.3.1
Unfortunately while ’coin age’ sounds like a nice idea, and some of the stated
benefits are nice, it introduces an unexpected flaw into the system. It is worth
remembering that in order to perform a >50% attack an attacker does not need
to out mine the system on a constant basis, but only for a period of time long
enough to carry out the attack, if an attacker who ordinarily would only have
10% of the hash can temporarily somehow gain a larger weight he can perform
an attack regardless. Coin age unfortunately allows exactly this, by carefully
creating several addresses and then leaving the coins in them to build up weight
an attacker can slowly ’build up’ his attack capacity and then wait for the right
moment to attack.
A second possible problem with coin age42 is that users are deterred from
using their money as if they do they lose their coin age and thus cannot stake,
it is often argued that this leads to a situation whereby all users of a PoS coin
’hoard’ their coins leading to poor liquidity, poor distribution and ultimately an
undesirable currency.
41 Inthe worst case the old wallet of a large exchange for instance.
42 Not specifically a technical problem but an economic one, however in the case of
blockchains the two overlap.
3.4 Combined PoS/PoW 16
winning one. This has the side effect that SPV wallets, the wallet implemen-
tation used by most lightweight mobile wallets can not be used in conjunction
with PoS. In order to have functioning mobile wallets for a PoS based coin it is
necessary to make use of 3.7 and/or other potentially not desirable trade-offs.
Some coins like Peercoin – combine PoS and PoW – the theory being that
this makes the coin twice as secure. However, in reality, this doesn’t hold true,
the problem is that the PoW and PoS miners are competing with each other
to generate blocks.43 This, in turn, means more orphans and fewer profits for
miners, which means reduced hash rate. This at best means the gains are much
less than expected and at worst means that it actually makes the security worse.
If multiple PoS blocks in a row is a common sight then only PoS is required to
perform an attack, and vice-versa if multiple PoW blocks in a row is a common
sight then only PoW is required to perform an attack. In short instead of being
as strong as both; it is instead only as strong as the weakest of the two, thus
opening the coin up to more attacks44 and not less.
3.5. Multi-algorithm
• Improves decentralisation.
While this sounds good on paper, when examined closer it seems these claims
don’t really hold up, a non-exhaustive list of problems:
43 Taking a quick look at a block explorer for Peercoin shows cases where 7 or more PoS
attack.
3.5 Multi-algorithm 17
45 Except with increased orphaning and other loses explained in the following points that
world/universe.
47 Not always picking the best block and thereby not obtaining optimal network security.
48 If one of the weightings is incorrect then an attacker can gain a huge advantage by focusing
While this works well as a solution for 3-conf or more50 , and can be used to
ensure that larger targets like exchanges are operated safely from >50% attack
it does not provide a solution for regular users who need faster confirmations,
or users who don’t understand the risks involved. Despite the downsides we
see running a checkpoint server as an absolute necessity for any smaller virtual
currency at this point, any small virtual currency that does not do this is not
acting responsibly and is putting their users at large risk, we do however hope
we can remove our checkpoint server in the near future and this is one of the
primary purposes of this paper.
50 Assuming you are willing to accept the decentralised aspect of it, and depending on the
block times as stable as what ours are now, with their blocks per day wildly swinging between
400 and 800. cryptoid.info [6]
53 This difficulty drop is done in a careful manner that is cognisant of the maximum block
After much consideration of the various issues above, and much trial and
error, I have come up with what I consider the most viable/ideal solution to
the various issues above, or at least as many of the issues as possible. It is my
belief this represents a giant leap forward in the area of decentralised virtual
currencies. This solution is being implemented for Gulden in our next release56
which is due out shortly after this paper and is where the solutions presented
in this paper have been trialed.
54 A drastic improvement from before when we had at times 7 hour blocks (for instance) but
by no means perfect.
55 At the best of times, utterly wrong at others.
56 Code-name, Prime I for those who have been awaiting it.
57 Involving the stake that users of the system have in the process of securing the system
58 In order to better emphasize the role, they play in the system.
4.1 PoW² - an improved successor to PoW 21
• When receiving a pre-witnessed block an eligible witness will sign the block
using his private key converting it into a witnessed block.60
• The first step of witnessing involves adding additional data to the block,
this includes a witness timestamp61 , any additional transactions62 (subject
to the existing block size limit) and a transaction to pay out the witness
fee.63
• Once peers receive a witnessed block they add it to the tip of the chain as
usual and everything proceeds as normal from here, PoW miners attempt
to mine a new block on top of the new tip of the chain, and the cycle
repeats.
The above is a relatively simple change to how things work currently, however
it has a larger and more important impact than one might think at first read
through. Below the key impacts on the system:
• Witnesses can add transactions to empty or non-full blocks and get fees
for it. Unlike PoW miners, witnesses must actively hold a portion of the
currency and as a result they have a vested interest in a healthy network;
this acts as an additional incentive to keep witnesses honest. Witnesses
are therefore highly incentivised to add transactions to blocks they witness
whenever possible. This means that the network will almost always be able
to operate at full efficiency in terms of transaction capacity/throughput
and will not be hampered by empty blocks 2.7 in cases where transactions
are waiting to be added to blocks.66
59 Like a legal document that has been drawn up but not yet signed
60 In a constant-time; near instant process, or as near instant as possible.
61 Allowing for a massive improvement in 2.6.2
62 Acting as a countermeasure to 2.7.2
63 Which includes also the transaction fee for any transactions added by the witness.
64 In a manner that can best be compared as similar to existing PoS systems, except using
a witness selection system that has some unique properties including: constant time, minimal
latency/delay, deterministic
65 Note that it isn’t really necessary to rebroadcast the PoW part of the block to peers that
already have it, only the additional Witness portion needs to be broadcast. So there is no
additional overhead here, the block doesn’t have to be sent between all peers twice.
66 It is true that empty blocks are still possible, but it would require both the miner and the
witness to participate in not adding transactions. For both of them to by chance manage to
mine the same block, without a conspiracy among a huge majority of miners and witnesses,
the probability of this is incredibly small.
4.1 PoW² - an improved successor to PoW 22
67 In order to have a block witnessed the miner will first need to broadcast to the network
at which point everyone will know about it. While it is true that a miner could theoretically
witness his own blocks I will detail later why this is not realistically possible.
68 For the same reason as above, and with the same caveat.
69 Actually as little as 33%
70 The intersection of disjoint probabilities x and y is equal to the probability of x multiplied
by the probability of y.
71 Assuming a well-distributed coin, enough coin holders willing to participate in the wit-
nessing process and a few other things that can be guarded against in a proper client imple-
mentation - enough connected peers that are not spoofed for instance.
72 Thereby helping to reduce instances of 2.1.1.
4.1 PoW² - an improved successor to PoW 23
into the system, and extra complexity always means more room for error.
However the added complexity is not great, the functioning of the system
is still simple and elegant enough that it can be properly reasoned about
and evaluated, so I do not feel like this is a cause for concern. Unlike for
instance with some of the PoS solutions out there.
exchanges, whose owners never open their wallets, or are otherwise not
available. Without the ability to measure the total number of staking
coins it becomes harder to gauge the expense of a possible attack and
thus impossible to really know how secure the network is at any given mo-
ment. Worse people who have no intention of staking might be selected
to stake74 leading to erratic block times as a result. An improvement can
therefore be had by changing to an opt-in system for witnessing, whereby
only coins in ’special’ addresses can be selected as witnessing, the total
number of coins securing the network can then be easily enumerated, sus-
picious activity monitored for and witnesses selected only from the eligible
pool.
2. Time-based participation - Two arguments often leveled against PoS is
that it gives too much power to large coin holders and that unlike PoW
(which burns electricity) nothing of value is “at stake” in a PoS system.
There is no expense to a staker when he signs a block so what is to stop
him from signing competing blocks? One way of dealing this, which ties in
with Opt-in participation above is to introduce a time concept to staking
accounts. When placing coins in a staking account a user can pick a time
period for which the funds will be locked (similar to how in regular banking
systems you have fixed period savings accounts), the user will be unable
to spend coins from the account until the lock time has expired but will
be able to stake, by doing this the user now has something real “at stake”
namely the liquidity of his money.
The time period is factored into the equation determining the stake weight
for the account, so users who choose to lock their funds for longer periods
of time will stake more frequently, this gives an opportunity for users with
fewer coins to out-stake those with more coins, helping to level the playing
field to some extent.
This is also beneficial for the network, users who are willing to lock their
coins for long periods of time are more likely to have the long term health
of the network in mind and therefore are less likely to attack the network,
by allowing such users to stake more frequently the security of the network
is therefore improved. For an attacker to succeed in attacking the network
he would likely have to lock his coins for a long period of time which is not
desirable for an attacker and acts as yet another obstacle for an attacker
to contend with.
Finally with users tying a portion of their wealth up for a fixed term,
the decrease in the number of coins that are 100% liquid should bring
positive impacts for the currency as a whole. As users are unable to
rapidly exchange all of their coins in moments of panic or hysteria, this
should lead to a slightly more stable market with a currency that is much
less prone to giant spikes and dumps in price and attract users with a more
long term mindset. If the reward is well balanced and not excessive these
• Witnessing will be opt-in, users will create and transfer funds into a ’wit-
ness account’ in order to participate in the process.
• These accounts will use special address scripts on the blockchain that serve
as an indicator to the network that they are intended to participate in
witnessing, special network rules will apply to these addresses to facilitate
the process of witnessing. More details in Appendix A on page 33.
• Witness addresses will be derived from two key pairs instead of one, the
network will allow only normal spend operations with the first key and
only special witness related operations with the second. Thereby allowing
wallets to always witness blocks when their wallet is open without exposing
their funds to any risk of theft or having to enter a password at any point.75
75 Spending-key remains encrypted in memory, as all other wallet keys normally would
4.1 PoW² - an improved successor to PoW 26
• The algorithm via which witnesses are selected will be a random but de-
terministic lottery style system, and not a competitive system (like regular
PoW or PoS) as the latter is prone to grinding attacks. More details in Ap-
pendix A on page 33.
• Witness addresses that have not witnessed for a certain period of time81 ,
will be temporarily removed from the pool of eligible addresses and will
be required to perform a ’refresh’ transaction (at a fee) in order to become
eligible again. This will prevent a build up of non-participating systems
that could cause the system to stall.
• The block reward for PoW miners will be lowered from 100 to 80 with the
remaining 20 allocated to witnesses, thereby leaving the overall reward
unchanged, this can potentially82 lead to a slight drop in the overall mining
power available for PoW mining on the network.83
• Only transactions included in a PoW portion of a block will be consid-
ered as having 1 confirmation, transactions in a witness portion will be
considered by wallets as having 0 confirmations until such time as a sub-
sequent PoW block is mined.84 For some purposes it may be worthwhile
to consider transactions in the witness portion as having 12 a confirma-
tion, however, we will not implement this concept yet it is something for
consideration at a later date.
• SPV wallets will also only recognise transactions as having 1 confirmation
once they have been verified by a PoW portion of a block, note that this
is anyway the case with normal wallets but for SPV this is for different
reasons as an SPV wallet cannot confirm the witness portion as they don’t
keep a full blockchain. Due to the fact that potential witnesses are only
drawn from the last 10000 blocks and there is a fixed upper bound on
memory/complexity in the process, it may be possible for some SPV peers
to verify the witness portion as well in future; though more development
is still required in that area and will not be pursued for the initial launch.
An additional concept of ’trusted peers’ will also be introduced into our
SPV wallets in future which will aid with both this as well as general
protection against Sybil attacks (2.8).
factors that determine the selection. Maintaining a high overall PoW hash rate is crucial to the
functioning of this system so the PoW reward needs to attract as much hash rate as possible
from a theoretically infinite ever growing pool of global hash rate. The witness reward on the
contrary only needs to be high enough to attract enough witnesses from a finite coin supply
to participate, it doesn’t need to attract an infinite amount. An overly high witness reward
can also be detrimental market effects like hoarding, the PoW portion acts as an important
means of coin distribution and liquidity.
84 More information why in 4.1.5.
4.1 PoW² - an improved successor to PoW 28
• The difficulty adjustment algorithm will make use of the timestamp from
the witness portion instead of the PoW portion to enable better accu-
racy and remove from PoW miners the ability to tamper with the PoW
difficulty.85
• DoS via mining of empty blocks (2.7.2) - Difficulty of achieving this greatly
increased, essentially not possible.
• PoS insecure private keys (3.3.1) - Private keys secured at all times.
• PoS Stake buildup (3.3.7) - No coin age is involved in the process so the
system is immune to this.
• PoS stake grinding (3.3.4) - Grinding can only be achieved via mining new
PoW blocks, as a substantial PoW hash rate is involved grinding becomes
infeasible.
• PoS old private keys (3.3.6) - Old private keys effectively hold no attack
value, as the amount of PoW hash power required to perform an attack
with old keys would be substantial.
85 The timestamp from both will be used for block acceptance but the witness timestamp
1. As the witness algorithm selects only one winner there exists the likelihood
that at times the winner will not be available to perform his witness duty.
The obvious way to address this is to introduce multiple winners into the
system as redundancy, this would be more similar to what other previous
systems have tried, and unfortunately vastly weakens the system opening
it up to grinding attacks and other vulnerabilities.
Instead, we rely on the PoW miners. When PoW miners find a block they
do not stop mining but continue attempting to create competing blocks
until they receive news of a witnessed block, as each new block mined will
randomly select a new single witness this provides the variation required to
overcome stalling without introducing the vulnerabilities that come with
multiple witnesses. Ordinarily, there would be concerns about how long
this process might take. If for example 3 witnesses in a row were not
present and each block takes 5 minutes then we have a 15-minute wait, if
10 witnesses in a row are missing 50 minutes etc. It would seem that there
is potential here both for accidental stalls as well as perhaps a deliberate
DoS attack. However, our difficulty adjustment algorithm; Delta, is not
ordinary and already has a special mechanism built into it to safely lower
the difficulty in cases where block times are overly long. This assures us
that as the wait becomes longer the quantity of PoW blocks mined will
become more and more frequent, thereby minimising the delay in such
situations.86 This reduces the stalling to at worst a minor inconvenience
instead of a major attack vector.
The opt-in nature of the system, the various mechanisms that make having
a large percentage chance of being selected difficult/expensive, as well as
the fact that non-participating witnesses are regularly ’pruned’ from the
system and need to pay a fee to re-enter the system. All work together
to ensure a pool of the ’fittest’ witnesses and would make any long-term
sustained attempt at achieving a DoS attack in this way impractical and
costly.
2. As the selected witness does not need to perform any expensive work to
perform the signing, the possibility exists for a witness to attempt a DoS
attack on the network by signing multiple blocks all with varying trans-
actions/data and sending them out to different peers. It is worth noting
that this is not specifically unique to PoW² but could also be conducted
on a normal PoS coin simply by using more powerful hardware like an
ASIC miner. It is the case here that an existing flaw has just been made
a bit more obvious. Thankfully, it is not overly difficult to deal with this
situation simply by putting some network rules in place.
• Clients should not request witness blocks when the headers contain
the same base PoW block as those of a header/block they have al-
86 This subtle detail turns out to be one of the important puzzle pieces that make this concept
possible, and the lack of this feature previously is quite possibly what prevented PoW² from
appearing sooner.
30
ready received.
• Clients should not forward multiple headers containing the same base
PoW block.
• Clients should assign a misbehaviour score for each subsequent header
containing the same base PoW block.
• Clients should eventually ban peers after multiple such blocks.
In the case where different nodes end up with a different witness block, the
network will quickly come to consensus again when the next PoW block
is mined.87
.
3)
.
4)
. .
.
5)
.
6)
.
7)
.
87 Occasional brief forking is part of how blockchains work so should not be cause for alarm.
31
.
.
.
Let us evaluate the chances of success, in order to succeed an attacker will
need to do the following:
1) .
2) .
3)
.
The probability
.
32
6. Conclusion
This paper has looked at various of the challenges faced by Gulden as well
as other virtual currencies, the strength and weaknesses of the blockchain in its
current form as well as the various solutions that have been offered by some as
possible ways to counter these weaknesses. I have looked at both the positive
aspects of these solutions, where such aspects exist, as well as their shortcom-
ings.
Based on this I have proposed an exciting new way forward PoW², which I
consider the next generation step, building on top of these solutions something
that while simple in description manages to not only significantly improve on
many of the weaker aspects of a traditional PoW blockchain but also drastically
enhance the network security; doing so in a way that feels natural and does not
introduce massive complexity or new failure modes. I have also briefly touched
on some exciting future possibilities that PoW² enables, including a way of al-
lowing secure 0-conf transactions to be enabled on the network. The suggestions
of this paper will be implemented into Gulden over the coming months starting
first with the PoW² and secure 0-conf following shortly afterward.
33
The most critical part of PoW² is the algorithm that determines the selection
of the witness for a mined block. The process has the following requirements:
1. It needs to be random.
2. It needs to be deterministic, i.e. should not rely on additional network
communication.
3. It should be resistant to grinding attacks, not possible to gain a mechanical
advantage.
4. It should not be possible to gain any advantage by having multiple ac-
counts.
5. It should not be possible to predict the winner in advance.
6. It should be as light on resources as possible.
7. It should lead to as few forks in the blockchain as possible.
8. It needs to be fast and efficient and should not exhaust huge amounts of
memory, it should introduce as little delay into the system as possible.
I have discarded the possibility of a hashcash (Back [1]) based system as this
fails to meet criteria 3, 5 and 7. Aside from hashcash the remaining possibility is
some kind of random selection using the blockchain as a seed, existing computer
science literature has an algorithm that is perfect for the task, used mostly in
genetic algorithms and known as ’Roulette wheel selection’ (Bäck [2]) it is a
perfect fit for the task. See image on page 35 for a brief understanding of
how such a selection works. The algorithm will thus work as follows - note
that all in program arithmetic is done using appropriate sized integer types
and appropriate basing so as to keep precision while avoiding floating point
or other inprecision that can be a source of indeterminism between different
architectures.In this paper we do not deal with this aspect of things to keep the
math simpler to follow and understand:
88 Constant time requirement to scan backward in the chain does not prohibit pruning of
the UTXO.
89 Subject to adjustment in future.
34
• Witness inputs that have been newly created, or are the result of a previous
witnessing operation within the last 100 blocks are excluded.
• Witness inputs are inserted into the array in a deterministic fashion, first
by age and second90 by the quantity and finally91 by block order.
• Witness inputs are assigned a weighting based on their quantity and the
amount of time (in blocks) that they are unspendable.92 The weighting is
designed in such a way that it is in most cases93 more financially beneficial
for a user to gather more of their coins into a single account than it would
be for multiple accounts94 , and needs to accomodate the fact that larger
accounts are more heavily penalised by the 100 block wait than smaller
ones are in order to do this, there are many possible weighting formulas
that could be used for this each with various pros and cons under various
situations (large coin participation, small coin participation and so forth.
The formula settled on for Gulden is: W eight = ((Quantity+(Quantity 2 /100000))×
T ime
(1 + 576×365 ))95 See Appendix G on page 41 for the rationale behind this
formula.
• A second pass through of all values is done, any inputs that are older than
eworkW eight × 2), 200) are removed from consideration.
max(( T otalNW eight 96
• A third and final pass through all values is done, any witness whose weight
exceeds 1% of the overall weighting as taken from the second pass, is
reduced to 1% of this weighting.97
• The sha256 hash of the PoW block is converted to a 256-bit seed integer.
The use of the normal scrypt PoW hash for this is deliberately avoided to
prevent any theoretical manipulation that could be attempted by means
of varying the difficulty within certain ranges.98
• A roulette wheel selection is then done to select the winning witness from
the array, with the spin always starting from 0 to allow for more efficient
calculation.99
rule.
94 This is important to diminish the effect an attacker can have on the network
95 In actual code implementations, calculation must be rebased to avoid floating point and
therefore the implementation is a bit more complex than this, however left as is here for clarity.
96 This is to prevent stale inactive witnesses from stalling the chain repeatedly.
97 As this change affects the final overall weighting the actual result will be slightly different
than 1%, but this is fine no attempt is made to adjust for this.
98 Even though this is unlikely and the only legitimate case I can think of is when the
version
previous block hash
merkle root hash
time bits nonce
n ··· ··· ···
coinbase transaction
···
transaction 1
···
transaction n
PoW² combines regular PoW along with the witnessing power of coin holders,
in a way that should lead to a minimal drop in PoW hash rate while at the same
time substantially enhancing the blockchain security and also bringing some
other desirable properties to the table. As it is difficult to grasp how significant
the change is, it is best to have a proper visualisation. To illustrate this I’ve
taken code from Nakamoto [11] (see Appendix C), modified it slightly for our
purposes103 and run it to generate a visualisation on page 39.
For this process, I am using the following figures, taken at the time of writing,
they are not 100% accurate but for our purposes are more than sufficient:
• The cost to rent scrypt mining rigs, 20 gh/s for four hours of rental =
$132104 , i.e $6.6 per gh/s.
• We will assume a 10% reduction in network hash rate for PoW² to accom-
modate the fact that a portion of the reward will go to PoS miners, there
are legitimate reasons to believe that the drop in hash rate may actually
be less than this.106 However, for the sake of comparison we want to make
things as bad for PoW² as we possibly can.
• We will ignore the market effect that buying larger amounts of coins, in
order, to attack PoW² would have on the coin price.107 This would drive
up the cost of acquiring further coins for the attack, as well as affect the
network hash rate.108 Therefore the cost estimates for the various PoW²
attacks, especially the ones involving larger amounts of coins are likely
vast underestimates and would cost drastically more in reality.
of more than 3 000 000 coins is likely to have a measurable impact on the market price
108 The more coins are worth the more network hash rate is attracted.
109 And this is actually an underestimate on the price as this many coins would really cost
For the same attack price point110 as a >50% attack on the PoW network,
the PoW² network yields less than a 1% chance of success to the attacker, leading
to what I am terming ’secure 1-conf’ transactions111 for most purposes and
2 or 3 confirmations being reasonably secure for all but the most sensitive of
transactions.
The astute will notice that we have of course ignored a possibility above.
Instead of opting for e.g. 60% of the PoW hash and 60% of the witness coins
an attacker could instead attempt a grinding attack. He could aim to have four
times the network hash rate and 10% of the coins (a total cost of somewhere
around $1 257 765112 ). Mining 4 times the PoW blocks will give him four chances
at being selected as the witness for each block instead of 1. The probability is
as follows:
A roughly 35% chance of signing a single block, instead of the 10% his coins
would normally entitle him to, however at a substantial expense compared to
a plain >50% attack. While grinding is possible to an extent with PoW², it is
resilient to it to the point that it is not likely to be effectual when reasonable
network hash rates are involved; in this particular case the grinding attempt
costs slightly more than the “60% PoW/60% Witness” attack and has a lower
probability of success.113
network hash rate and so forth; so it may vary which of the two is cheaper at any given time.
39
30
20
10
1 2 3 4 5 6 7 8 9
Number of blocks with transaction in
The below code (borrowed and adapted from Nakamoto [11]) calculates115
in function AttackerSuccessProbability the chances of success an attacker has
when attacking a chain of depth q for probability z; for PoW we feed in the
percentage hash rate as the probability, for PoW² we use P (P oW ∩ W itness) =
P (P oW ) × P (W itness). Ignores that a Witness cannot witness various blocks
in a row, further reducing the probability for each subsequent block as well as
various other enhancements discussed in the paper, therefore results are biased
in favour of PoW.
#i n c l u d e <i o s t r e a m >
#i n c l u d e <iomanip>
#i n c l u d e <math . h>
double pricePerGh = 5 4 0 0 . 0 ;
double networkHashRate = 5 0 . 0 ;
double pricePerCoin = 0 . 0 2 ;
double networkNumCoins = 8 8 8 8 2 7 8 0 . 0 ;
double A t t a c k e r S u c c e s s P r o b a b i l i t y ( double q , i n t z )
{
double p = 1.0 − q ;
d o u b l e lambda = z ∗ ( q / p ) ;
d o u b l e sum = 1 . 0 ;
int i , k ;
f o r ( k = 0 ; k <= z ; k++) {
d o u b l e p o i s s o n = exp(−lambda ) ;
f o r ( i = 1 ; i <= k ; i ++)
p o i s s o n ∗= lambda / i ;
sum −= p o i s s o n ∗ ( 1 − pow ( q / p , z − k ) ) ;
}
r e t u r n sum ∗ 1 0 0 ;
}
v o i d printPOWAttack ( d o u b l e p e r c e n t a g e )
{
s t d : : c o u t << ” [PoW] ” << ( i n t ) ( p e r c e n t a g e ∗ 1 0 0 ) << ”% hash \n ” ;
s t d : : c o u t << A t t a c k e r C o s t ( p e r c e n t a g e , 0 . 0 ) << ”\n ” ;
f o r ( i n t i =0; i <10; i ++){
s t d : : c o u t << ” ( ”
<< s t d : : f i x e d
<< s t d : : s e t p r e c i s i o n ( 1 2 )
<< i << ” , ”
<< A t t a c k e r S u c c e s s P r o b a b i l i t y ( p e r c e n t a g e , i ) << ” ) \ n ” ;
}
}
i n t main ( )
{
printPOWAttack ( 0 . 0 5 ) ; printPOWAttack ( 0 . 1 ) ;
printPOW2Attack ( 0 . 0 1 , 0 . 0 1 ) ; printPOWAttack ( 0 . 1 5 ) ;
printPOW2Attack ( 0 . 0 2 , 0 . 0 2 ) ; printPOWAttack ( 0 . 3 ) ;
printPOW2Attack ( 0 . 0 4 , 0 . 0 4 ) ; printPOWAttack ( 0 . 5 1 ) ;
printPOW2Attack ( 0 . 0 7 , 0 . 0 7 ) ; printPOW2Attack ( 0 . 1 5 , 0 . 1 5 ) ;
printPOW2Attack ( 0 . 6 , 0 . 1 ) ; printPOW2Attack ( 0 . 3 , 0 . 3 ) ;
printPOW2Attack ( 0 . 5 1 , 0 . 5 1 ) ; printPOW2Attack ( 0 . 6 , 0 . 6 ) ;
r e t u r n −1;
}
Nomenclature
PoW² Proof of Work 2 (or Proof of Work squared). The name for our new
system that achieves massive security gains by multiplying together
the security of Proof of Work and of the Witness signatures.
Witness In the context of PoW² a witness is a holder of the coin who places his
coins into a special time locked account and then uses these locked
coins to sign PoW blocks as valid.
References
[3] BitcoinWiki. Block size limit controversy - Bitcoin Wiki. URL https:
//en.bitcoin.it/wiki/Block_size_limit_controversy.
[10] Juan Garay, Aggelos Kiayias, and Nikos Leonardos. The Bitcoin Back-
bone Protocol: Analysis and Applications, pages 281–310. Springer
Berlin Heidelberg, Berlin, Heidelberg, 2015. ISBN 978-3-662-46803-6.
doi: 10.1007/978-3-662-46803-6_10. URL http://dx.doi.org/10.1007/
978-3-662-46803-6_10.