Content uploaded by Ian Grigg
Author content
All content in this area was uploaded by Ian Grigg on Oct 03, 2016
Content may be subject to copyright.
Bitcoin Verification Latency
TheAchillesHeelforTimeSensitiveTransactions
KenGriffith&IanGrigg
DineroLtd
Abstract.Bitcoinhasahighlatencyforverifyingtransactions,bydesign.Averaging
around8minutes,suchhighlatencydoesnotresonatewiththeneedsoffinancialtraders
forspeed,anditopensthedoorfortimebasedarbitrageweaknessessuchasmarket
timingattacks.Althoughperhapstractableinsomemarketssuchaspeertopeer
payments,theAchillesheeloflatencymakesBitcoinunsuitablefordirecttradingof
financialassets,andventuresseekingtoexploitthemarketforfinancialassetswillneed
toovercomethisburden.
Bitcoinhasahighlatencyforverifyingtransactions.Thisisbydesign.
WheneveraBitcointransactionisreceived,itisnecessarytogetconfirmationfromothernodes
onthenetworkthatthetransactionwasindeedvalid.Thisrequiresperformingthehashing
calculationsthatserveastheproofofworkthatistheheartoftheBitcoinsystem.
TheBitcoinrulesautomaticallyadjustthedifficultyofthehashingalgorithminordertoproduce
newblocksatarateof1newblockeverytenminutes.
Sinceblockcreationisthewaythattransactionsareverified,thismeansthattheaverage
transactionconfirmationtimeshouldbeabouthalfthetimeittakestocreateanewblockwhich
is10minutes.Thereforeaverageconfirmationtimeshouldbeabout5minutes.
Thechartbelowshowstheaveragetransactionconfirmationtimeinminutesfortheyear2013.
Confirmationhasaveragedabout8minutes,butspikesashighas19minuteshavenotbeen
uncommon.Asexpected,fiveminutesisthefloorforaverageverificationtime.
Chart1BitcoinAverageConfirmationTimefor2013
Whenwecomparethe5minuteconfirmationtimeforBitcointothe70mssettlementtimeof
professionaltradingplatformslikeRicardoitbecomesobviousthatBitcoinisanextremely
inefficientsettlementmechanism.Ricardoisover4000timesfasterforreliablesettlementof
trades.
The Arbitrage Problem
Arbitrageisinherenttotrading.Arbitrageissimplybuyinglowandsellinghigh,ormore
specifically,findingandexploitingapricediscrepancyforthesamegoodsindifferentmarkets,or
exploitingdiscrepancyinpriceinthesamemarketatdifferenttimes.
Withtheadventofalgorithmdrivenexchangetrading(“algos”),thereisaracebetween
algorithmstofindandexploitarbitrageopportunitiesbeforeanyoneelsedoes.Onthecomexand
Nasdaqalgosareinfiercecompetitiontoshaveoffafewmillisecondsontrades.
TheuncertaintythatsurroundsBitcointransactionconfirmationmakesitunsuitableasaplatform
forexchangetradingwhichrequireimmediateconfirmation.
Bitcoin’s Vulnerability to Market Timing Attacks
Fortimesensitiveapplicationssuchascurrencyexchangeandstocktradingaswellas
gambling,latencyontheorderofminutesexposestheexchangetomarkettimingattacks.
Markettimingattackswerebroadlyusedinthe2003MutualFundScandal intheUSA.Atrader
1
1http://en.wikipedia.org/wiki/2003_mutual_fund_scandal
usingamarkettimingattackplacestradesintoahighlatencymarket,waitstoseewhichway
themarkethasmoved,andthencancelslosingtradesbasedonthatinformation.2
Onetypeofmarkettimingattackrequirestheattackertomakeapairofoppositetradesorbets.
Assoonasenoughtimehaselapsedtoseewhichisthewinningtrade,theattackerattemptsto
cancelthelosingtrade.Iftheattackerisunsuccessfulincancelingthelosingtrade,hisopposite
tradescanceleachotherout,eliminatingriskoflosstotheattacker.
WithBitcointherearethreeknowndoublespendingattacksthatcanbeusedbyanattackerto
effectivelyreverseapaymentwithareasonablyhighchanceofsuccess:thesearetheRace
Attack ,theFinneyAttackandtheVector76Attack whichisacombinationofthefirsttwo.
3 4 5
MarkettimingwillenableattackerstotakeadvantageofBitcoin’shighconfirmationlatencyto
monetizeBitcoindoublespendingattacks,enablinganattackertoplacebets(onaBitcoin
gamblingsite)orpairedoppositetrades(onacurrencyexchange)anduseadoublespendto
reversethelosingbet.
ThistypeofattackwassuccessfullyperformedmultipletimesagainstBetCoinDicein
September2013.6
Unlessthelatencyproblemcanbesolved,Bitcoin’svulnerabilitytomarkettimingattacksmakes
itunsuitableforuseindirectexchangetrading.
However,thelatencyproblemisafunctionofBitcoin’sverysoultheproofofwork.Iflatency
couldbereducedtonearzero,theproblemisnolongerverydifficulttosolveandwehaven’t
provedmuchwork.
TheconfirmationlatencyofBitcoinishalfthetimeittakestogenerateanewblock.Sincethisis
regulatedbydesignoftheBitcoinsoftwaretobeoneblockeverytenminutesitisimpossibleto
reducethelatencywithoutincreasingtheblockgenerationrate.
ThereforelatencyisadesignfeatureofBitcointhatprobablycannotbereducedwithoutbreaking
theentireplatform.
2Grigg,Nesfield,MutualFunds&FinancialFlaws,U.S.SenateCommitteeonGovernmentalAffairs,
SubcommitteeonFinancialManagement,theBudget,andInternationalSecurity,OversightHearingon
MutualFunds:HiddenFees,MisgovernanceandOtherPracticesthatHarmInvestors,Jan17,2004,
http://iang.org/papers/mutual_funds.html
3Karame,Androulaki&Capkun,TwoBitcoinsforthePriceofOne,http://eprint.iacr.org/2012/248.pdf
4InitialDescriptionofVector76Attack,
https://bitcointalk.org/index.php?topic=36788.msg463391#msg463391
5GavinAndresson,[BitcoinDevelopment]Fromtheforums:oneconfirmationattack,18Aug2011,
http://sourceforge.net/mailarchive/message.php?msg_id=27963970
6GHash.IOanddoublespendingagainstBetCoinDice,https://bitcointalk.org/index.php?topic=327767.0
ColoredCoins & MasterCoin
TherearetwoBitcoinrelatedstartupsthatseektoextendtheBitcoinprotocoltoenable
usercreatedcurrenciesordigitalinstrumentsbackedbyrealworldassets.
BothMastercoinandColoredCoinsplantousetheBitcoinblockchaintostoredataconcerning
balancesandtradesforusercreatedaltcurrencies.BothColoredCoinsandMastercoinuse
thememofieldofultralowvalueBitcoins(ie.0.00000001Btc)tostoremetadatatorepresent
realworldassetssuchasagramofgold,redeemablefromthebackerofthataltcurrency.This
enablesthemtousetheblockchainasapublicledgerofaccountsforthingsthatarenot
Bitcoins.
BoththeMastercoinandColoredCoinsprotocolsintendtoenableblockchainbasedbid/offer
trades,usingBitcoinitselfastheexchangemechanism.
Forthereasonselaboratedabove,Bitcoin’shighconfirmationlatencyexposesthenetworkto
markettimingattacks.BothColoredCoinsandMastercoinmayfindtheyhaveplayedintothis
vulnerabilitybyusingBitcoinitselfasaplatformforexecutingtrades.
An Algorithm for Market Timing Attack on Mastercoin/ColoredCoin
Ascitedabove,amarkettimingattackhasalreadybeensuccessfullydemonstratedagainst
BetCoinDice.However,thereareveryfewhighvaluetradesorbetsthatcurrentlycanbe
executedwithrawBitcoin,becausemostexchangesandcasinosthatacceptBitcoinfor
paymentparkitincoldstorageandthenmaintaintheirownorder/betbooksinhousewith
instantclearing.Thisistheonlysensiblewaytohandlethelatencyproblem.
However,bothMastercoinandColoredCoinsareplanningtocreatehighvaluetradingsystems
thatworkdirectlyontheBitcoinblockchainmakingthemperfecttargetsformarkettiming
attacks.Bitcoinhackerswillbeeternallygratefultothecreatorsofthisopportunity.
Hereiswhattheattackerneedsinordertoperpetratesuccessfulhighvaluemarkettiming
attacks:
1.WaitforMastercoin,ColoredCoinsoranotherentitytocreateamarketinreasonablyhigh
valuedigitalassetsthataretradeddirectlyontheBitcoinblockchain.
2.Acquireanidenticalpairofhighpoweredminingrigsinordertohaveenoughhashingpowerto
getasubstantialheadstartontheunluckycounterpartytothetrade(s)youplantoreverse.
3.Markyourtargetsanalyzetheissuersoftheopenbuy/sellordersinthemarkettoidentify,as
muchaspossible,theweaktradersintermsofhashingpowerandconnectionstoothernodes.
UseVector76methodologytomakedirectconnectionstoyourmarks,aswellasthehighest
poweredminingrigsonthenetwork.
4.Writeanalgorithmtodothefollowing:
a.Placeapairofoppositetradesorbetsonthemarketinquestionwiththeintentof
matchingtradeswithpreviouslyidentifiedweaktargets.
b.Immediatelypassadoublespendonbothtradestoyourminingrigs,tocreatetwo
alternateblocks,whereyouspendthevalueofeachtradetoanotherbitcoinaccountthat
youcontrol.Keeptheseblocksanddoublespendssecret,buthashasfaraheadas
possiblewithothervalidtransactionswhilewaitingforthemarketsignal.
c.Waitafewminutesforenoughmarketdatatodeterminewhichtradewasthewinning
bet,andwhichwasthelosingbet.Thelongeryoucanwaitthemorethemarketcan
potentiallymove.However,thelongeryouwait,theloweryourchancebecomesto
successfullyreverseoneofyourtrades.
d.Deployyourdoublespendblocktoreversethelosingtradebyhavingyourminingrig
preferentiallypostthatblocktoseveralhundredotherminers.Discardthedoublespend
blockforthewinningtrade.
e.Ifyourdoublespendtoyourselfissuccessfullychosenaspartofthe
longerblockchain,youwin!Youhavecanceledthelosingtrade.
Thecleverthingaboutamarkettimingattackisthatifyoufailtoreversethelosingtrade,thetwo
tradescanceleachotheroutmeaningthereisnoriskoflosstotheattacker.Thismakes
markettimingaperfectwayforamindlessalgorithmtoattemptthousandsoflowriskattacks
perdayevenwithlowchancesofsuccessfullyreversingatransactionprovidedthata
sufficientlylargeBitcoinmarketexistsonwhichtouseit.
Why Bitcoin Market Timing Attacks Are Presently Uncommon
WhiletheBitcoinnetworkdependsonthemajorityofnodesbeing“honest”,thedependabilityof
theparticipantsinthenetworkisfarmorelikelytobedeterminedbypragmaticcostbenefit
analysisthanbysomestrongmoralcommitmenttotheidealsoftheBitcoincommunity.
ThefinancialincentiveforBitcoinminersistodeploytheirmininghardwareinthemostprofitable
manner.Thereasonthatmarkettimingattacksarepresentlyuncommonispartlybecausethey
requiretheassistanceofminingequipmentinordertohaveahighchanceofsuccess,andthere
arenotalotofopportunitiesintheBitcoinNetworktoconducttwowaymarkettradeswithraw
Bitcoin.
Currentlytheblockchainrewardformininganewblockis25bitcoins.Atcurrentpricesthevalue
oftherewardfallsintheballparkof$25,000.
Aslongastheblockrewardishighandtheavailableopportunitiesfortwowaytradingonthe
BitcoinNetworkarefew,themostprofitableuseofminingrigsistofocusonminingnewblocks.
However,thissituationislikelytochangeinthefutureforseveralreasons.
Why Bitcoin Market Timing Attacks Will Eventually Become Worthwhile
TheBitcoinblockrewardiscutinhalfevery210,000blocks(roughlyfouryears).Oncetheblock
rewardapproacheszerotherewardsofminingwillbepaidentirelybyvoluntarytransactionfees.
ThiswillshiftthecostoftheBitcointransactionprocessingfromdilution(everyonesharesthe
cost)totheusermakingthetransaction.Itisunlikelythatuserswillvoluntarilypaythe$50per
transactionthatminersarecurrentlybeingpaid,sotherewardperblockwilleventuallyfalltoa
smallfractionoftheirpresentlevel.
AtthesametimethatBitcoinminingwillbedecreasinginprofitability,Bitcoinembeddedmarkets
suchasMastercoinandColoredCoinswillbecreatingtradingmarketsthatusetheblockchain
asthesettlementmechanism.Asthevalueofthesemarketsincreases,apointwillbereached
whereitbecomesmoreprofitabletouseaminingrigtoperformtimingattacksontradesthanit
istominenewblocks.
AmassiveincreaseinthevalueofBitcoinsmaydelaythedaywhenitbecomesmoreprofitable
toperformmarkettimingattacksthanitdoestomineBitcoinbutwithenoughrewardhalving
iterationsthatdaywillinevitablyarrive.
Conclusion
ThoughBitcoin’sdecentralizedtransactionregistermakesitreliableandrobustasawayof
storingandtransmittingvalue,thelatencyinherenttotheBitcoinverificationmechanismmakes
itapoorchoiceofplatformforrealtimeexchangesettledtransactions.
CompaniesororganizationsthatattempttousetheBitcoinBlockchainasatradingplatformare
likelytoeventuallyfindthemselvesandtheircustomersbroadlytargetedbymarkettiming
attacks.