Skip to main content

Atomically Trading with Roger: Gambling on the Success of a Hardfork

  • Conference paper
  • First Online:
Data Privacy Management, Cryptocurrencies and Blockchain Technology (DPM 2017, CBT 2017)

Part of the book series: Lecture Notes in Computer Science ((LNSC,volume 10436))

Abstract

We present atomic trade protocols for Bitcoin and Ethereum that can bind two parties to swap coins in the event that two blockchains emerge from a single “pre-fork” blockchain. This work is motivated by a bet between two members of the Bitcoin community, Loaded and Roger Ver, to trade 60,000 bitcoins in the event that Bitcoin Unlimited’s planned hardfork occurs and the blockchain splits into two distinct forks. Additionally we study several ways to provide replay protection in the event of hardfork alongside a novel mechanism called migration inputs. We provide a detailed survey and history of previous softforks and hardforks in Ethereum and Bitcoin.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Institutional subscriptions

Notes

  1. 1.

    A schism has previously occurred in the case of Ethereum, whose TheDAO hardfork precipitated a split into Ethereum and Ethereum Classic.

  2. 2.

    Loaded is a pseudonym used by a person on the bitcointalk forums.

  3. 3.

    The user can choose which blockchain can accept their newly signed transaction.

  4. 4.

    Emerged in July 2016 after Ethereums’s TheDAO hardfork.

  5. 5.

    The hash of the transaction’s nonce and the creator’s Ethereum accounts address.

  6. 6.

    The community disputes whether BIP50 (deployed in response to BIP34’s accidental split) should be considered a hardfork, and therefore to what degree Bitcoin governance has established a precedent of avoiding hardforks.

  7. 7.

    OP_CHECKSEQUENCEVERIFY [13] and a new consensus rule was introduced to only check for relative lock times if the transaction version number is two or higher [3].

  8. 8.

    A marker in the transaction input to specify how to construct the transaction’s hash before verifying the signature. For example, the transaction hash can contain no transaction outputs, all transaction outputs, or a 1:1 mapping of inputs/outputs.

  9. 9.

    Previous transaction hash as 32 bytes, the previous transaction output index as 4 bytes, the length of the script as 1 byte and the sequence number as 4 bytes.

  10. 10.

    The activation time can be determined by a publicly announced flag day (i.e. similar to Bitcoin Cash [31]). There is a signalling process outlined in BIP9 [40], but this is designed for softforks. If the signalling process is used, then this atomic trade must be set up after the new rules are locked in.

  11. 11.

    Both parties deposit a sufficient number of coins in this output to cover a future transaction fee.

  12. 12.

    Table 6 highlights that each transaction output in the Funding Transaction has a Cancel condition. For example, Alice’s deposit can be spent if Cancel(\(PK_{A_{3}},PK_{B_{3}})\) is satisfied and the Cancel Timer can be spent if Cancel\((PK_{A_{2}},PK_{B_{2}})\). is satisfied.

References

  1. Andresen, G.: Block v2, Height in Coinbase, July 2012. https://github.com/bitcoin/bips/blob/6925e66aa092d97f8273e4bab15bb0d4c63f9ac9/bip-0034.mediawiki

  2. Andresen, G.: March 2013 Chain Fork Post-Mortem, March 2013. https://github.com/bitcoin/bips/blob/master/bip-0050.mediawiki

  3. BitcoinCore. Accept Transaction version 2 or more, June 2017. https://github.com/bitcoin/bitcoin/blob/1088b02f0ccd7358d2b7076bb9e122d59d502d02/src/consensus/tx_verify.cpp#L45

  4. blockchain.info. Blockchain charts, March 2017. https://blockchain.info/charts

  5. Buterin, V.: Bitcoin Network Shaken by Blockchain Fork, March 2013. https://bitcoinmagazine.com/articles/bitcoin-network-shaken-by-blockchain-fork-1363144448/

  6. Buterin, V.: Blockhash refactoring, April 2016. https://github.com/ethereum/EIPs/issues/98

  7. Buterin, V.: Long-term gas cost changes for IO-heavy operations to mitigate transaction spam attacks, September 2016. https://github.com/ethereum/EIPs/issues/150

  8. Buterin, V.: Simple replay attack protection, October 2016. https://github.com/ethereum/eips/issues/155

  9. Buterin, V.: Removal of intermediate state roots from receipts, February 2017. https://github.com/ethereum/EIPs/pull/210

  10. coinmarketcap.com. CryptoCurrency Market Capitalizations: Bitcoin, March 2017. https://coinmarketcap.com/currencies/bitcoin/

  11. Dashjr, L.: OP_CHECKBLOCKATHEIGHT, September 2016. https://github.com/luke-jr/bips/blob/bip-cbah/bip-cbah.mediawiki

  12. Deadalnix. Add spec for UAHF, June 2017. https://github.com/Bitcoin-UAHF/spec/blob/master/replay-protected-sighash.md

  13. Friedenbach, M., BtcDrak, Dorier, N., Kinoshitajona: Relative lock-time using consensus-enforced sequence numbers, May 2015. https://github.com/bitcoin/bips/blob/master/bip-0068.mediawiki

  14. Goldfeder, S., Bonneau, J., Gennaro, R., Narayanan, A.: Escrow protocols for cryptocurrencies: how to buy physical goods using bitcoin. In: Financial Cryptography and Data Security. Springer (2017)

    Google Scholar 

  15. Harding, T.: [bitcoin-dev] Proposal: Hard fork opt-out bits, July 2016. https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2016-July/012917.html

  16. Hertig, A.: Ethereum Executes Blockchain Hard Fork to Return DAO Funds, July 2016. http://www.coindesk.com/ethereum-classic-explained-blockchain/

  17. Hertig, A.: How Developers Are Responding to Ethereum’s Unexpected Fork, December 2016. http://www.coindesk.com/developer-response-ethereum-fork/

  18. Hertig, A.: The Blockchain Created By Ethereum’s Fork is Forking Now, October 2016. http://www.coindesk.com/ethereum-classic-blockchain-fork-ddos-attacks/

  19. Hertig, A.: Ethereum Classic Freezes ‘Difficulty Bomb’ With ‘Diehard’ Fork, January 2017. http://www.coindesk.com/ethereum-classic-diehard-fork/

  20. S. Higgins. Bitcoin Exchanges Unveil Hard Fork Contingency Plan, March 2017. http://www.coindesk.com/ethereum-executes-blockchain-hard-fork-return-dao-investor-funds/

  21. Kerin, T., Friedenbach, M.: Median time-past as endpoint for lock-time calculation, August 2015. https://github.com/bitcoin/bips/blob/master/bip-0113.mediawiki

  22. Lau, J.: [bitcoin-dev] Anti-transaction replay in a hardfork, January 2017. https://github.com/bitcoin/bips/blob/master/bip-0068.mediawiki

  23. Loaded. @RogerVer lets make a deal. At least 60k, my BTU for your BTC, March 2017. https://bitcointalk.org/index.php?topic=1836672.0

  24. Lombrozo, E., Lau, J., Wuille, P.: Segregated Witness (Consensus layer), December 2015. https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki

  25. Maersk, N.: The DAO Hard Fork Oracle, July 2016. https://github.com/veox/solidity-dapps/blob/TheDAOHardForkOracle-v0.1/TheDAOHardForkOracle/TheDAOHardForkOracle.sol

  26. Maxwell, G.: Capacity increases FAQ, December 2015. https://bitcoin.org/en/bitcoin-core/capacity-increases-faq#roadmap

  27. Maxwell, G., Wilcke, P.W.: Conversation on Bitcoin Wizards, April 2017. https://botbot.me/freenode/bitcoin-wizards/2017-04-20/?msg=84304042&page=3

  28. McCorry, P., Shahandashti, S.F., Hao, F.: A smart contract for boardroom voting with maximum voter privacy. In: Financial Cryptography and Data Security. Springer (2017)

    Google Scholar 

  29. Nakamoto, S.: Bitcoin: a peer-to-peer electronic cash system (2008). https://bitcoin.org/bitcoin.pdf

  30. Poon, J., Dryja, T.: The bitcoin lightning network, February 2015. https://lightning.network/

  31. Song, J.: Timeline, The Bitcoin Cash: What Will Happen When. https://www.coindesk.com/bitcoin-cash-what-expect-fork-10000-foot-view/

  32. Spagni, R.: A formal approach towards better hard fork management (2015). https://forum.getmonero.org/4/academic-and-technical/303/a-formal-approach-towards-better-hard-fork-management

  33. Tier, N.: Re: Alt chains and atomic transfers, May 2013. https://bitcointalk.org/index.php?topic=193281.msg2224949#msg2224949

  34. Todd, P.: OP_CHECKLOCKTIMEVERIFY, October 2014. https://github.com/bitcoin/bips/blob/master/bip-0065.mediawiki

  35. ViaBTC. Miner guide: how to safely hard fork to bitcoin unlimited, October 2016. https://medium.com/@ViaBTC/miner-guide-how-to-safely-hard-fork-to-bitcoin-unlimited-8ac1570dc1a8

  36. Wilcke, J.: Homestead Release, February 2016. https://blog.ethereum.org/2016/02/29/homestead-release/

  37. Wood, G.: State trie clearing (invariant-preserving alternative), October 2016. https://github.com/ethereum/EIPs/issues/161

  38. Wuille, P.: Duplicate transactions, February 2012. https://github.com/bitcoin/bips/blob/6925e66aa092d97f8273e4bab15bb0d4c63f9ac9/bip-0030.mediawiki

  39. Wuille, P.: Strict DER Signatures, January 2015. https://github.com/bitcoin/bips/blob/6925e66aa092d97f8273e4bab15bb0d4c63f9ac9/bip-0066.mediawiki

  40. Wuille, P., Todd, P., Maxwell, G., Russell, R.: Version bits with timeout and delay, October 2015. https://github.com/bitcoin/bips/blob/master/bip-0009.mediawiki

  41. Zander, T.: Replay Protection Guidance, March 2017. https://bitco.in/forum/threads/replay-protection-guidance.1930/

Download references

Acknowledgements

We thank Nick Johnson for bringing to our attention hardfork oracles, Tadge Dryja for his comments and criticisms, Roger Ver for allowing us to use his name in the paper’s title, Iddo Bentov for insightful discussions and #bitcoin-wizards IRC channel for answering questions regarding forks. Patrick McCorry is supported by EPSRC grant EP/N028104/1, Ethan Heilman is supported by NSF 1350733.

Author information

Authors and Affiliations

Authors

Corresponding authors

Correspondence to Patrick McCorry , Ethan Heilman or Andrew Miller .

Editor information

Editors and Affiliations

Appendices

A TierNolan’s Atomic Cross-Chain Trading Protocol

Table 4 presents the protocol proposed by TierNolan in 2013. The TierNolan protocol allows two parties to atomically exchange coins across two blockchains. Such protocols are called Atomic Swaps because the two transactions happen atomically i.e., either swap occurs or it does not. It requires both parties to deposit coins in separate blockchains and for one of the parties to trigger the exchange.

Table 4. Atomic Cross-Chain Trading Protocol. This protocol allows two parties to atomically exchange coins across two distinct blockchains
Table 5. Bitcoin’s Hard Fork Atomic Cross-Chain Trade if transaction malleability is fixed. Both parties authorise the atomic trade transactions prior to signing and broadcasting the funding transaction \( T^{Fund} \). Both trade transactions can be accepted into their respective blockchain after the hard-fork activation time \(\varDelta _{FORK}\).

Brief overview. Consider two blockchains, the first blockchain we denote as \(\textsc {Fork}\text {-}1\), the second blockchain we denote as \(\textsc {Fork}\text {-}2\). Alice wants to trade her coins on blockchain \(\textsc {Fork}\text {-}1\) for coins which Bob controls on blockchain \(\textsc {Fork}\text {-}2\). First, Alice picks a random value \(S_{A}\), hashes it to \(H(S_{A})\) and deposits her coins into a transaction \(T_{1}\) which is confirmed on \(\textsc {Fork}\text {-}1\). Bob can claim the funds in \(T_{1}\) if and only if he learns the value \(S_{A}\). However if the coins in \(T_{1}\) are still unspent by \(\varDelta _{A}\) Alice can refund the coins in this transaction back to herself.

B Proposed Bitcoin Protocol if Transaction Malleability is fixed

Table 5 presents the Bitcoin hard-fork atomic cross-chain protocol if transaction malleability is fixed. It assumes that both parties can use replay protection to dictate if a transaction can be accepted into \(\textsc {Fork}\text {-}1\) or \(\textsc {Fork}\text {-}2\). As we will soon see this variation is significantly simpler compared to the protocol outlined in Sect. 3.

Briefly, both parties co-operatively create a Funding Transaction \( T^{Fund} \) and the two trade transactions \( T^{A \rightarrow B}_{FORK1} , T^{B \rightarrow A}_{FORK2} \). Next, both parties must exchange signatures for the trade transactions before signing and broadcasting the funding transaction. Finally, both parties wait until after the hard-fork activation time \(\varDelta _{FORK}\) to claim both deposits in their respective blockchain.

Table 6. Bitcoin’s Hard Fork Atomic Cross-Chain Trade. Our proposed protocol commits both Alice and Both to the trade prior to the hardfork’s activation

This approach follows a similar style to payment protocols such as Duplex Micropayment Systems and Lightning as the off-chain’s transactions are signed prior to the funding transaction. The order of signing off-chain transactions does not necessarily matter as these transactions are only valid if the funding transaction is accepted into the blockchain. Furthermore, it is worth highlighting that this approach does not require one party (i.e. Alice) to reveal a pre-image \(S_{A}\) or to sign cancel/forfeit transactions.

Rights and permissions

Reprints and permissions

Copyright information

© 2017 Springer International Publishing AG

About this paper

Cite this paper

McCorry, P., Heilman, E., Miller, A. (2017). Atomically Trading with Roger: Gambling on the Success of a Hardfork. In: Garcia-Alfaro, J., Navarro-Arribas, G., Hartenstein, H., Herrera-Joancomartí, J. (eds) Data Privacy Management, Cryptocurrencies and Blockchain Technology. DPM CBT 2017 2017. Lecture Notes in Computer Science(), vol 10436. Springer, Cham. https://doi.org/10.1007/978-3-319-67816-0_19

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-67816-0_19

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-67815-3

  • Online ISBN: 978-3-319-67816-0

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics