Side Chains
Side Chains
Side Chains
This work was partially supported by Blockstream, a company founded by several of the authors. Many of the concepts
discussed in this paper were developed before Blockstream existed; sidechain technology is an open proposal by the authors
themselves.
1
Contents
1 Introduction 3
2 Design rationale 7
3 Two-way peg 8
3.1 Denitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3.2 Symmetric two-way peg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3.3 Asymmetric two-way peg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
4 Drawbacks 11
4.1 Complexity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
4.2 Fraudulent transfers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
4.3 Risk of centralisation of mining . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
4.4 Risk of soft-fork . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
5 Applications 14
5.1 Altchain experiments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
5.1.1 Technical experimentation . . . . . . . . . . . . . . . . . . . . . . . . . . 14
5.1.2 Economic experimentation . . . . . . . . . . . . . . . . . . . . . . . . . . 15
5.2 Issued assets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
6 Future directions 16
6.1 Hashpower attack resistance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
7 Acknowledgements 17
A Federated peg 17
B Efcient SPV proofs 19
C Atomic swaps 21
License. This work is released into the public domain.
2
1 Introduction
David Chaum introduced digital cash as a research topic in 1983, in a setting with a central server
that is trusted to prevent double-spending[Cha83]. To mitigate the privacy risk to individuals from
this central trusted party, and to enforce fungibility, Chaum introduced the blind signature, which he
used to provide a cryptographic means to prevent linking of the central servers signatures (which
represent coins), while still allowing the central server to perform double-spend prevention. The
requirement for a central server became the Achilles heel of digital cash[Gri99]. While it is
possible to distribute this single point of failure by replacing the central servers signature with
a threshold signature of several signers, it is important for auditability that the signers be distinct
and identiable. This still leaves the system vulnerable to failure, since each signer can fail, or be 10
made to fail, one by one.
In January of 2009, Satoshi Nakamoto released the rst widely used implementation of peer-
to-peer trustless electronic cash[Nak09], replacing the central servers signature with a consensus
mechanism based on proof of work[Bac02], with economic incentives to act cooperatively.
Bitcoin tracks payments by aggregating them into blocks, each with an associated blockheader,
which cryptographically commits
1
to: the contents of the block, a timestamp, and the previous
blockheader. The commitments to previous headers form a blockchain, or chain, which provides a
well-dened ordering for transactions.
We observe that Bitcoins blockheaders can be regarded as an example of a dynamic-
membership multi-party signature (or DMMS), which we consider to be of independent interest as 20
a new type of group signature. Bitcoin provides the rst embodiment of such a signature, although
this has not appeared in the literature until now. A DMMS is a digital signature formed by a set of
signers which has no xed size. Bitcoins blockheaders are DMMSes because their proof-of-work
has the property that anyone can contribute with no enrolment process. Further, contribution is
weighted by computational power rather than one threshold signature contribution per party, which
allows anonymous membership without risk of a Sybil attack (when one party joins many times and
has disproportionate input into the signature). For this reason, the DMMS has also been described
as a solution to the Byzantine Generals Problem[AJK05].
Because the blocks are chained together, Bitcoins DMMS is cumulative: any chain (or chain
fragment) of blockheaders is also a DMMS on its rst block, with computational strength equal 30
to the sum of the strengths of the DMMSes it is composed of. Nakamotos key innovation is the
aforementioned use of a DMMS as a signature of computational power rather than a signature of
knowledge. Because signers prove computational work, rather than proving secret knowledge as
is typical for digital signatures, we refer to them as miners. To achieve stable consensus on the
blockchain history, economic incentives are provided where miners are rewarded with fees and
subsidies in the form of coins that are valuable only if the miners form a shared valid history,
incentivising them to behave honestly. Because the strength of Bitcoins cumulative DMMS is
directly proportional to the total computational power contributed by all miners[Poe14a], it becomes
1
A commitment is a cryptographic object which is computed from some secret data, but does not reveal it, such that the
data cannot be changed after the fact. An example of a commitment is a hash: given data x, one can publish H(x) where H
is a hash function, and only later reveal x. Veriers can then conrm that the revealed value is the same as the original value
by computing H(x) themselves.
3
infeasible for a computational minority to change the chain. If they try to revise the DMMS-secured
ledger, they will fall behind and be continually unable to catch up to the moving target of the 40
progressing consensus blockchain.
Because the miners do not form an identiable set, they cannot have discretion over the rules
determining transaction validity. Therefore, Bitcoins rules must be determined at the start of its
history, and new valid transaction forms cannot be added except with the agreement of every
network participant. Even with such an agreement, changes are difcult to deploy because they
require all participants to implement and execute the new rules in exactly the same way, including
edge cases and unexpected interactions with other features.
For this reason, Bitcoins objective is relatively simple: it is a blockchain supporting the
transfer of a single native digital asset, which is not redeemable for anything else. This allowed
many simplications in the implementation, but real-world demands are now challenging those 50
simplications. In particular, current innovation is focused around the following areas:
1. There are trade-offs between scalability and decentralisation. For example, a larger block
size would allow the network to support a higher transaction rate, at the cost of placing more
work on validators a centralisation risk.
Similarly, there are trade-offs between security and cost. Bitcoin stores every transaction in
its history with the same level of irreversibility. This is expensive to maintain and may not be
appropriate for low value or low-risk transactions (e.g. where all parties already have shared
legal infrastructure in place to handle fraud).
These trade-offs should be made for each transaction, as transactions vary widely in value
and risk prole. However, Bitcoin by construction supports only a one size ts all solution. 60
2. There are many more trade-offs for blockchain features. For example, Bitcoins script could
be more powerful to enable succinct and useful contracts, or could be made less powerful to
assist in auditability.
3. There are assets besides currencies that may be traded on blockchains, such as IOUs and
other contracts, as well as smart property [Sza97].
4. There is a risk of monoculture: Bitcoin is composed of many cryptographic components, any
one of whose failures could cause a total loss of value. If possible, it would be prudent not to
secure every bitcoin with the same set of algorithms.
5. New technology might enable new features not imagined when Bitcoin was rst developed.
For example, privacy and censorship-resistance could be improved by use of cryptographic 70
accumulators[Mou13], ring signatures[vS13], or Chaumian blinding[Cha83].
6. Even if there is a pressing need to do so, there is no safe upgrade path for Bitcoin, in the sense
that all participants must act in concert for any change to be effected. There is consensus
amongst Bitcoin developers that changes to Bitcoin must be done slowly, cautiously, and
only with clear assent from the community.
4
The fact that functionality must be broadly acceptable to gain adoption limits participants
personal freedom and autonomy over their own coins. Small groups are unable to implement
features, such as special-purpose script extensions[jl213], because they lack broad consensus.
An early solution to these problems with Bitcoin has been the development of alternate
blockchains, or altchains, which share the Bitcoin codebase except for modications to address 80
the above concerns. However, implementing technical changes through the creation of independent
but essentially similar systems is problematic.
One problem is infrastructure fragmentation: because each altchain uses its own technology
stack, effort is frequently duplicated and lost. Because of this, and because implementers
of altchains may fail to clear the very high barrier of security-specic domain knowledge in
Bitcoin[Poe14c], security problems are often duplicated across altchains while their xes are not.
Substantial resources must be spent nding or building the expertise to review novel distributed
cryptosystems, but when they are not, security weaknesses are often invisible until they are
exploited. As a result, we have seen a volatile, unnavigable environment develop, where the most
visible projects may be the least technically sound. As an analogy, imagine an Internet where 90
every website used its own TCP implementation, advertising its customised checksum and packet-
splicing algorithms to end users. This would not be a viable environment, and neither is the current
environment of altchains.
A second problem is that such altchains, like Bitcoin, typically have their own native
cryptocurrency, or altcoin, with a oating price. To access the altchain, users must use a market to
obtain this currency, exposing them to the high risk and volatility associated with new currencies.
Further, the requirement to independently solve the problems of initial distribution and valuation,
while at the same time contending with adverse network effects and a crowded market, discourages
technical innovation while at the same time encouraging market games. This is dangerous not only
to those directly participating in these systems, but also to the cryptocurrency industry as a whole. 100
If the eld is seen as too risky by the public, adoption may be hampered, or cryptocurrencies might
be deserted entirely (voluntarily or legislatively).
It appears that we desire a world in which interoperable altchains can be easily created and used,
but without unnecessarily fragmenting markets and development. In this paper, we argue that it is
possible to simultaneously achieve these seemingly contradictory goals. The core observation is that
Bitcoin the blockchain is conceptually independent from bitcoin the asset: if we had technology
to support the movement of assets between blockchains, new systems could be developed which
users could adopt by simply reusing the existing bitcoin currency
2
.
We refer to such interoperable blockchains as pegged sidechains. We will give a precise
denition in Section 3, but for now we list the following desired properties for pegged sidechains: 110
1. Assets which are moved between sidechains should be able to be moved back by whomever
their current holder is, and nobody else (including previous holders).
2. Assets should be moved without counterparty risk; that is, there should be no ability for a
dishonest party to prevent the transfer occurring.
2
We use bitcoin as an example because its strong network effects make it likely that users will prefer it over other, newer
assets. However, any altcoin can be adapted to be usable with sidechains.
5
3. Transfers should be atomic, i.e. happen entirely or not at all. There should not be failure
modes that result in loss or allow fraudulent creation of assets.
4. Sidechains should be rewalled: a bug in one sidechain enabling creation (or theft) of assets
in that chain should not result in creation or theft of assets on any other chain.
5. Blockchain reorganisations
3
should be handled cleanly, even during transfers; any disruption
should be localised to the sidechain on which it occurs. In general, sidechains should ideally 120
be fully independent, with users providing any necessary data from other chains. Validators
of a sidechain should only be required to track another chain if that is an explicit consensus
rule of the sidechain itself.
6. Users should not be required to track sidechains that they are not actively using.
An early solution was to transfer coins by destroying bitcoins in a publicly recognisable way
4
,
which would be detected by a new blockchain to allow creation of new coins[Bac13b]. This is a
partial solution to the problems listed above, but since it allows only unidirectional transfers between
chains, it is not sufcient for our purposes.
Our proposed solution is to transfer assets by providing proofs of possession in the transferring
transactions themselves, avoiding the need for nodes to track the sending chain. On a high level, 130
when moving assets from one blockchain to another, we create a transaction on the rst blockchain
locking the assets, then create a transaction on the second blockchain whose inputs contain a
cryptographic proof that the lock was done correctly. These inputs are tagged with an asset type,
e.g. the genesis hash of its originating blockchain.
We refer to the rst blockchain as the parent chain, and the second simply as the sidechain.
In some models, both chains are treated symmetrically, so this terminology should be considered
relative. Conceptually, we would like to transfer an asset from the (original) parent chain to a
sidechain, possibly onward to another sidechain, and eventually back to the parent chain, preserving
the original asset. Generally we can think of the parent chain as being Bitcoin and the sidechain as
one of many other blockchains. Of course, sidechain coins could be transferred between sidechains, 140
not just to and from Bitcoin; however, since any coin originally moved from Bitcoin could be moved
back, it would nonetheless remain a bitcoin.
This lets us solve the problem of fragmentation described in the previous section, which is good
news for cryptocurrency developers who want to focus solely on technical innovation.
Furthermore, because sidechains transfer existing assets from the parent chain rather than
creating new ones, sidechains cannot cause unauthorised creation of coins, relying instead on the
parent chain to maintain the security and scarcity of its assets
5
.
Further still, participants do not need to be as concerned that their holdings are locked in a single
experimental altchain, since sidechain coins can be redeemed for an equal number of parent chain
coins. This provides an exit strategy, reducing harm from unmaintained software. 150
3
A reorganisation, or reorg, occurs locally in clients when a previously accepted chain is overtaken by a competitor chain
with more proof of work, causing any blocks on the losing side of the fork to be removed from consensus history.
4
This is also known as a one-way peg, to contrast with two-way peg, which we introduce later on.
5
Of course, sidechains are able to support their own assets, which they would be responsible for maintaining the scarcity
of. We mean to emphasise that they can only affect the scarcity of themselves and their child chains.
6
On the other hand, because sidechains are still blockchains independent of Bitcoin, they are
free to experiment with new transaction designs, trust models, economic models, asset issuance
semantics, or cryptographic features. We will explore many of the possibilities for sidechains further
in Section 5.
An additional benet to this infrastructure is that making changes to Bitcoin itself becomes
much less pressing: rather than orchestrating a fork which all parties need to agree on and implement
in tandem, a new changed Bitcoin could be created as a sidechain. If, in the medium term, there
were wide agreement that the new system was an improvement, it may end up seeing signicantly
more use than Bitcoin. As there are no changes to parent chain consensus rules, everyone can switch
in their own time without any of the risks associated with consensus failure. Then, in the longer 160
term, the success of the changes in the sidechain would provide the needed condence to change
the parent chain, if and when it is deemed necessary to do so.
2 Design rationale
Trustlessness is the property of not relying on trusting external parties for correct operation,
typically by enabling all parties to verify on their own that information is correct. For example, in
cryptographic signature systems trustlessness is an implicit requirement (signature systems where
an attacker can forge signatures would be considered utterly broken). While this is not typical for
distributed systems, Bitcoin does provide trustless operation for most parts of its system
6
.
A major design goal of pegged sidechains is to minimise additional trust over Bitcoins model.
The hard part is securing transfers of coins between sidechains: the receiving chain must see that the 170
coins on the sending chain were correctly locked. Following Bitcoins lead, we propose solving this
using DMMSes. Although it is possible to use a simple trust-based solution involving xed signers
(see Appendix A) to verify locking of coins, there are important reasons to avoid the introduction
of single points of failure:
Trusting individual signers does not only mean expecting them to behave honestly; they must
also never be compromised, never leak secret key material, never be coerced, and never stop
participating in the network.
Because digital assets are long-lived, any trust requirements must be as well. Experience has
shown that trust requirements are dangerous expectations even for timespans on the order of
months, let alone the generational timespans we expect nancial systems to last. 180
Digital currencies were unable to gain traction until Bitcoin was able to eliminate single
points of failure, and the community is strongly averse to the introduction of such weaknesses.
Community mistrust is reinforced by nancial events since 2007; public trust in the nancial
system and other public institutions is likewise at historical lows.
6
This is true for almost all aspects of Bitcoin: a user running a full node will never accept a transaction that is directly or
indirectly the result of counterfeiting or spending without proving possession. However, trustless operation is not possible
for preventing double spending, as there is no way to distinguish between two conicting but otherwise valid transactions.
Instead of relying on a centralised trusted party or parties to take on this arbitration function like Bitcoins predecessors,
Bitcoin reduces the trust required but does not remove it by using a DMMS and economic incentives.
7
3 Two-way peg
The technical underpinning of pegged sidechains is called the two-way peg. In this section we
explain the workings thereof, beginning with some denitions.
3.1 Denitions
A coin, or asset, is a digital property whose controller can be cryptographically ascertained.
A block is a collection of transactions describing changes in asset control. 190
Ablockchain is a well-ordered collection of blocks, on which all users must (eventually) come
to consensus. This determines the history of asset control and provides a computationally
unforgeable time ordering for transactions.
A reorganisation, or reorg, occurs locally in clients when a previously accepted chain is
overtaken by a competitor chain with more proof of work, causing any blocks on the losing
side of the fork to be removed from consensus history.
A sidechain is a blockchain that validates data from other blockchains.
Two-way peg refers to the mechanism by which coins are transferred between sidechains and
back at a xed or otherwise deterministic exchange rate.
A pegged sidechain is a sidechain whose assets can be imported from and returned to other 200
chains; that is, a sidechain that supports two-way pegged assets.
A simplied payment verication proof (or SPV proof
7
) is a DMMS that an action occurred
on a Bitcoin-like proof-of-work blockchain.
Essentially, an SPV proof is composed of (a) a list of blockheaders demonstrating proof-of-
work, and (b) a cryptographic proof that an output was created in one of the blocks in the list.
This allows veriers to check that some amount of work has been committed to the existence
of an output. Such a proof may be invalidated by another proof demonstrating the existence
of a chain with more work which does not include the block which created the output.
Using SPV proofs to determine history, implicitly trusting that the longest blockchain is also
the longest correct blockchain, is done by so-called SPV clients in Bitcoin. Only a dishonest 210
collusion with greater than 50% of the hashpower can persistently fool an SPV client (unless
the client is under a long-termSybil attack, preventing it fromseeing the actual longest chain),
since the honest hashpower will not contribute work to an invalid chain.
Optionally, by requiring each blockheader to commit to the blockchains unspent output set
8
,
anyone in possession of an SPV proof can determine the state of the chain without needing to
7
Named after the section Simplied Payment Verication in [Nak09]
8
In Bitcoin, only the set of unspent transaction outputs (UTXOs) is needed to determine the status of all coins. By
constructing a Merkle tree[Mer88], we can commit to every element of the UTXO set using only a single hash, minimising
the blockheader space used.
8
replay every block. (In Bitcoin, full veriers need to do this when they rst start tracking
the blockchain.)
As we will discuss in Appendix B, by including some additional data in Bitcoins block
structure, we can produce smaller proofs than a full list of headers, which will improve
scalability. Still, these proofs will be much larger than ordinary Bitcoin transactions. 220
Fortunately, they are not necessary for most transfers: holders of coins on each chain may
exchange them directly using atomic swaps[Nol13], as described in Appendix C.
3.2 Symmetric two-way peg
We can use these ideas to SPV peg one sidechain to another. This works as follows: to transfer parent
chain coins into sidechain coins, the parent chain coins are sent to a special output on the parent
chain that can only be unlocked by an SPV proof of possession on the sidechain. To synchronise
the two chains, we need to dene two waiting periods:
1. The conrmation period of a transfer between sidechains is a duration for which a coin must
be locked on the parent chain before it can be transferred to the sidechain. The purpose of this
conrmation period is to allow for sufcient work to be created such that a denial of service 230
attack in the next waiting period becomes more difcult. A typical conrmation period would
be on the order of a day or two.
After creating the special output on the parent chain, the user waits out the conrmation
period, then creates a transaction on the sidechain referencing this output, providing an SPV
proof that it was created and buried under sufcient work on the the parent chain.
The conrmation period is a per-sidechain security parameter, which trades cross-chain
transfer speed for security.
2. The user must then wait for the contest period. This is a duration in which a newly-transferred
coin may not be spent on the sidechain. The purpose of a contest period is to prevent double-
spending by transferring previously-locked coins during a reorganisation. If at any point 240
during this delay, a new proof is published containing a chain with more aggregate work
which does not include the block in which the lock output was created, the conversion is
retroactively invalidated. We call this a reorganisation proof.
All users of the sidechain have an incentive to produce reorganisation proofs if possible, as
the consequence of a bad proof being admitted is a dilution in the value of all coins.
A typical contest period would also be on the order of a day or two. To avoid these delays,
users will likely use atomic swaps (described in Appendix C) for most transfers, as long as a
liquid market is available.
While locked on the parent chain, the coin can be freely transferred within the sidechain without
further interaction with the parent chain. However, it retains its identity as a parent chain coin, and 250
can only be transferred back to the same chain that it came from.
When a user wants to transfer coins fromthe sidechain back to the parent chain, they do the same
thing as the original transfer: send the coins on the sidechain to an SPV-locked output, produce a
9
Parent Chain Sidechain
.
.
.
.
.
.
Send to SPV-locked output
Wait out conrmation period
SPV Proof
k=0
100
k
e
100
k!
(1(0.1)
1000k
) 10
196
To contrast, the same attacker in the same time can produce a single block proving 1000 blocks
worth of work with probability roughly 10%, a much higher number.
A detailed analysis of this problem and its possible solutions is out of scope for this document.
19
For now we will describe an implementation of compact SPV proofs, along with some potential 580
solutions to block this sort of attack while still obtaining signicant proof compaction.
Note that we are assuming a constant difculty. We observe that Bitcoins difculty, while non-
constant, changes slowly enough to be resistant to known attacks[Bah13]. We therefore expect that
corrections which take into account the adjusting difculty can be made.
Implementation. The inspiration for compact SPV proofs is the skiplist [Pug90], a probabilistic
data structure which provides log-complexity search without requiring rebalancing (which is good
because an append-only structure such as a blockchain cannot be rebalanced).
We require a change to Bitcoin so that rather than each blockheader committing only to the
header before it, it commits to every one of its ancestors. These commitments can be stored
in a Merkle tree for space efciency: by including only a root hash in each block, we obtain a 590
commitment to every element in the tree. Second, when extracting SPV proofs, provers are allowed
to use these commitments to jump back to a block more than one link back in the chain, provided the
work actually proven by the header exceeds the total target work proven by only following direct
predecessor links. The result is a short DMMS which proves just as much work as the original
blockchain.
How much smaller is this? Suppose we are trying to produce an SPV proof of an entire
blockchain of height N. Assume for simplicity that difculty is constant for the chain; i.e., every
block target is the same. Consider the probability of nding a large enough proof to skip all the way
back to the genesis within x blocks; that is, between block N x and block N. This is one minus
the probability we dont, or 600
1
x
i=1
Ni
Ni +1
= 1
Nx
N
=
x
N
The expected number of blocks needed to scan back before skipping the remainder of the chain
is thus
N
x=1
x
N
=
N+1
2
Therefore if we want to skip the entire remaining chain in one jump, we expect to search only
halfway; by the same argument we expect to skip this half after only a quarter, this quarter after
only an eighth, and so on. The result is that the expected total proof length is logarithmic in the
original length of the chain.
For a million-block chain, the expected proof size for the entire chain is only log
2
1000000 20
headers. This brings the DMMS size down into the tens-of-kilobytes range.
However, as observed above, if an attacker is able to produce compact proofs in which only
the revealed headers are actually mined, he is able to do so with non-negligible probability in the 610
total work being proven. One such strategy is for the attacker to produce invalid blocks in which
every backlink points to the most recent block. Then when extracting a compact proof, the attacker
simply follows the highest-weighted link every time.
We can adapt our scheme to prevent this in one of several ways:
20
By limiting the maximum skip size, we return to Bitcoins property that the likelihood of
a probabilistic attack decays exponentially with the amount of work being proven. The
expected proof size is smaller than a full list of headers by a constant (proportional to the
maximum skip size) factor.
By using a maximum skip size which increases with the amount of work being proven it is
possible to get sublinear proof sizes, at the cost of subexponential decay in the probability of 620
attack success. This gives greater space savings while still forcing a probabilistic attackers
likelihood of success low enough to be considered negligible.
Interactive approaches or a cut-and-choose mechanism may allow compact proofs with only a
small security reduction. For example, provers might be required to reveal random committed
blockheaders (and their connection to the chain), using some part of the proof as a random
seed. This reduces the probability of attack while only increasing proof size by a constant
factor.
If we expect many transfers per sidechain, we can maintain a special output in the parent chain
which tracks the sidechains tip. This output is moved by separate SPV proofs (which may be
compacted in one of the above ways), with the result that the parent chain is aware of a recent 630
sidechains tip at all times.
Then transfer proofs would be required to always end at this tip, which can be veried with only
a single output lookup. This guarantees veriers that there are no missing links in the transfer
proofs, so they may be logarithmic in size without increased risk of forgery.
This makes the total cost to the parent chain proportional to the number of sidechains and their
length; without this output, the total cost is also proportional to the number of inter-chain transfers.
This discussion is not exhaustive; optimising these tradeoffs and formalising the security
guarantees is out of scope for this paper and the topic of ongoing work.
Appendix C Atomic swaps
Once a sidechain is operational, it is possible for users to exchange coins atomically between chains, 640
without using the peg. In fact, this is possible with altcoins today, though the independent prices
make it harder to organise. This is important, because as we have seen, direct use of the peg requires
fairly large transactions (with correspondingly large fees) and long wait periods. To contrast, atomic
swaps can be done using only two transactions on each network, each of size similar to ordinary
pay-to-address transactions.
One such scheme, due to Tier Nolan[Nol13], works as follows.
Suppose we have two parties, A and B, who hold coins on different blockchains. Suppose also
that they each have addresses pk
A
and pk
B
on the others chain, and that A has a secret number a.
Then A can exchange coins for Bs as follows:
1. On one chain, A creates a transaction moving coins to an output O
1
which can only be 650
redeemed with (a) a revealing of a and Bs signature, or (b) both A and Bs signatures. A
does not yet broadcast this.
21
A creates a second transaction returning the coins from O
1
to A, with a locktime
14
of 48 hours.
A passes this transaction to B to be signed.
Once B signs the locked refund transaction, A may safely broadcast the transaction moving
coins to O
1
, and does so.
2. Similarly, B creates a transaction moving coins to an output O
2
on the other chain, which can
only be redeemed by (a) a revealing of a and As signature, or (b) both A and Bs signatures.
B does not yet broadcast this.
B creates a second transaction returning the coins from O
2
to B, with a locktime of 24 hours. 660
B passes this transaction to A to be signed.
Once A signs the locked refund transaction, B may safely broadcast the transaction moving
his coins to O
2
, and does so.
3. Since A knows a, A is able to spend the coins in O
2
, and does so, taking possession of Bs
coins.
As soon as A does so, a is revealed and B becomes able to spend the coins in O
1
, and does
so, taking possession of As coins.
14
In Bitcoin, a transactions locktime prevents it from being included in the blockchain until some timeout has expired.
This is useful for creating refunds in interactive protocols which can only be redeemed if the protocol times out.
22
References
[AJK05] J. Aspnes, C. Jackson, and A. Krishnamurthy, Exposing computationally-challenged
Byzantine impostors, Tech. Report YALEU/DCS/TR-1332, Yale University, 2005,
http://www.cs.yale.edu/homes/aspnes/papers/tr1332.pdf.
[And12a] G. Andresen, BIP16: Pay to script hash, Bitcoin Improvement Proposal, 2012,
https://github.com/bitcoin/bips/blob/master/bip-0016.mediawiki.
[And12b] , BIP34: Block v2, height in coinbase, Bitcoin Improvement Proposal, 2012,
https://github.com/bitcoin/bips/blob/master/bip-0034.mediawiki.
[Bac02] A. Back, Hashcash a denial of service counter-measure, 2002, http://
hashcash.org/papers/hashcash.pdf.
[Bac13a] , bitcoins with homomorphic value (validatable but encrypted), 2013,
BitcoinTalk post, https://bitcointalk.org/index.php?topic=305791.0.
[Bac13b] , Re: [Bitcoin-development] is there a way to do bitcoin-staging?, 2013,
Mailing list post, http://sourceforge.net/p/bitcoin/mailman/message/
31519067/.
[Bah13] L. Bahack, Theoretical Bitcoin attacks with less than half of the computational power
(draft), arXiv preprint arXiv:1312.7013 (2013).
[BSCG
+
13] E. Ben-Sasson, A. Chiesa, D. Genkin, E. Tromer, and M. Virza, SNARKs for C:
Verifying program executions succinctly and in zero knowledge, Cryptology ePrint
Archive, Report 2013/507, 2013, http://eprint.iacr.org/2013/507.
[Cal12] M. Caldwell, Sustainable nanopayment idea: Probabilistic payments, 2012,
BitcoinTalk post, https://bitcointalk.org/index.php?topic=62558.0.
[Cha83] D. Chaum, Blind signatures for untraceable payments, Advances in Cryptology
Proceedings of Crypto 82 (1983), no. 3, 199203.
[Fri14] M. Friedenbach, [Bitcoin-development] compact SPV proofs via block header
commitments, 2014, Mailing list post, http://sourceforge.net/p/bitcoin/
mailman/message/32111357/.
[FT13] M. Friedenbach and J. Timn, Freimarkets: extending bitcoin protocol with
user-specied bearer instruments, peer-to-peer exchange, off-chain accounting,
auctions, derivatives and transitive transactions, 2013, http://freico.in/docs/
freimarkets-v0.0.1.pdf.
[Ges16] Silvio Gesell, The natural economic order, Peter Owen Ltd. 1958., London, 1916,
https://archive.org/details/TheNaturalEconomicOrder.
[GH12] I. Gerhardt and T. Hanke, Homomorphic payment addresses and the pay-to-contract
protocol, CoRR abs/1212.3257 (2012).
23
[Gri99] Ian Grigg, Email correspondence, 1999, http://cryptome.org/jya/digicrash.
htm.
[jl213] jl2012, OP_CHECKCOLORVERIFY: soft-fork for native color coin support, 2013,
BitcoinTalk post, https://bitcointalk.org/index.php?topic=253385.0.
[Lam79] L. Lamport, Constructing digital signatures from a one-way function, Tech. Report
SRI-CSL-98, SRI International Computer Science Laboratory, October 1979.
[Lie01] B. Lietear, The future of money, Random House, London, January 2001.
[Max11] G. Maxwell, Deterministic wallets, 2011, BitcoinTalk post, https://bitcointalk.
org/index.php?topic=19137.0.
[Max14] , User:gmaxwell/alt ideas, https://en.bitcoin.it/wiki/User:
Gmaxwell/alt_ideas. Retrieved on 2014-10-09., 2014.
[Mer88] R.C. Merkle, A digital signature based on a conventional encryption function, Lecture
Notes in Computer Science, vol. 293, 1988, p. 369.
[Mil12] A. Miller, The high-value-hash highway, 2012, BitcoinTalk post, https://
bitcointalk.org/index.php?topic=98986.0.
[MLJ14] A. Miller and J. J. LaViola Jr, Anonymous Byzantine consensus from moderately-hard
puzzles: A model for Bitcoin, Tech. Report CS-TR-14-01, UCF, April 2014.
[Mou13] Y. M. Mouton, Increasing anonymity in Bitcoin ... (possible alternative to Zerocoin?),
2013, BitcoinTalk post, https://bitcointalk.org/index.php?topic=290971.
[MP14] G. Maxwell and A. Poelstra,
Output distribution obfuscation, https://download.wpsoftware.net/bitcoin/
wizardry/brs-arbitrary-output-sizes.txt, 2014.
[Nak09] S. Nakamoto, Bitcoin: A peer-to-peer electronic cash system, 2009, https://www.
bitcoin.org/bitcoin.pdf.
[Nol13] T. Nolan, Re: Alt chains and atomic transfers, https://bitcointalk.org/index.
php?topic=193281.msg2224949#msg2224949, 2013.
[Poe14a] A. Poelstra, ASICs and decentralization FAQ, 2014, https://download.
wpsoftware.net/bitcoin/asic-faq.pdf.
[Poe14b] , Is there any _true_ anonymous cryptocurrencies?, Bitcoin.SE, 2014, http:
//bitcoin.stackexchange.com/a/29473.
[Poe14c] , A treatise on altcoins, 2014, Unnished, https://download.
wpsoftware.net/bitcoin/alts.pdf.
24
[Pug90] W. Pugh, Skip lists: A probabilistic alternative to balanced trees, Communications
of the ACM 33 (1990), no. 6, 668, ftp://ftp.cs.umd.edu/pub/skipLists/
skiplists.pdf.
[Sza97] N. Szabo, The idea of smart contracts, 1997, http://szabo.best.vwh.net/idea.
html.
[Tod13] P. Todd, Fidelity-bonded banks: decentralized, auditable, private, off-chain
payments, 2013, BitcoinTalk post, https://bitcointalk.org/index.php?
topic=146307.0.
[vS13] N. van Saberhagen, Cryptonote v 2.0, https://cryptonote.org/whitepaper.
pdf, 2013.
[Wui14] P. Wuille, BIP62: Dealing with malleability, Bitcoin Improvement Proposal, 2014,
https://github.com/bitcoin/bips/blob/master/bip-0062.mediawiki.
25