60 comments

[ 3.9 ms ] story [ 121 ms ] thread
Seems like a pretty easy attack, so I expect to see it executed by others for profit.
Is there much profit to be made? To me the recent "stress tests" look very like disgruntled hodlers messing around for shits and giggles, and demonstrating that it costs only a few thousand dollars in bitcoins to break transaction processing.

(Love the crackier theories that /r/buttcoin are banker shills. If only banks could get hold of a few thousand dollars somewhere ...)

surely if you have a large short position on bitcoin, you may profit as people lose confidence?
It's not as easy to take out a short position as it sounds.
With all the bitcoin fanatics who are convinced bitcoins are inherently rare and thus destined to increase in value, there are certainly opportunities for short options.
(comment deleted)
Shorting relies on a fairly complicated and trustworthy financial system. It isn't some easy thing, it's quite a complicated thing to set up to work well enough to serve as a financial product.

This does not actually exist for Bitcoin. Shorting requires trusting an exchange, and statistically trusting a Bitcoin exchange is historically a terrible idea.

So no, you can't just short Bitcoin and expect to make money.

You can sell bitcoin futures. That's equivalent to a short.

Ie you and the counterparty agree on a price today to sell them bitcoins a fixed time later. If both of you keep honouring any margin calls you agree on, the risk is fairly low. No third party necessary.

But yes, it is a more complicated transaction than the spot market.

Is this hypothetical, or are there a few working examples, or are there a lot of working examples, enough that one could casually talk about shorting Bitcoin? How big is this market for Bitcoin shorts and futures, what sort of volume are we talking about at the present time? The only shorting I knew of was on exchanges of questionable trustworthiness.
Sorry, purely hypothetical.

But, it might be worthwhile to make this work. If you implement the margin calls right, there's almost no risk for any party involved. Stand by, while I talk to my bitcoin obsesses friends about a startup idea.

https://www.bitfinex.com/

Large, relatively trustworthy exchange. Costs roughly 3.3% APR to borrow $1m worth of BTC for shorting right now: https://www.bitfinex.com/credit/index/btc

Edit: corrected the interest rate

https://np.reddit.com/r/BitcoinMarkets/comments/3nf3aa/daily...

I have no confidence in Bitfinex's ability to literally run their own systems. Typical Bitcoin system, i.e. cobbled together from cheese and string by amateurs. It's as if financial software and systems never existed.

Blame the government. It's not clear that it's legal to run a Bitcoin margin trading system in the U.S. so you have to make do with less-than-ideal offshore outfits.
Alternately ... don't gamble on Bitcoin!

Gemini is attempting to be as legit an exchange as is possible. Not sure they're offering shorting yet. OTOH, their volume is laughably tiny; everyone else is strongly suspected of frontrunning and Willybots. It turns out that crooks and scammers see an unregulated environment as a golden opportunity, but not for their customers.

> Alternately ... don't gamble on Bitcoin!

It's not gambling if, say, I need to hold Bitcoin in inventory to run my business but I want to short it on Bitfinex to hedge my exposure to currency fluctuations. Not shorting would be the gamble.

> Gemini is attempting to be as legit an exchange as is possible.

Coinbase Exchange is a perfectly legitimate exchange too (I work for Coinbase). But accepting deposits and lending them out to other users to short and/or trade on margin is a whole different regulatory ballgame.

> It turns out that crooks and scammers see an unregulated environment as a golden opportunity

The regulations here are actively hurting consumers as legitimate providers are afraid to step into the space. It's a self-fulfilling prophecy (too many regulations -> only idiots and crooks offer services -> consumers lose money -> more regulation).

Edit: opinions are my own, not Coinbase's, yada yada

I'm interested to hear more about his claims that bitcoin uses more energy than other forms of currency. Can anyone speak to that?
From earlier this year:

> A more fundamental worry is that digital-currency mining, like other sorts of mining, has environmental costs: all that number-crunching uses a lot of electricity, and not all of it comes from renewable sources, as it does in Boden. The rapid development of the ASICs chips has made the machines more efficient, but even if all mining worldwide were carried out in modern facilities like Boden’s, the combined electricity consumption would be 1.46 terawatt-hours per year—the consumption of about 135,000 average American homes.

http://www.economist.com/news/business/21638124-minting-digi...

The whole consensus network of Bitcoin is based around burning so much energy/space/infrastructure on hashing that a single actor wouldn't be able to invest a bunch of money and take a controlling majority.

I can't speak to how much energy we burn with ACH systems, paper money, etc., but those are much bigger than Bitcoin in terms of usage. If you add up the total energy consumed by every bank and mint in the world, you might get a higher absolute number. In terms of energy used per amount of value transferred, the traditional currencies almost certainly win.

>The whole consensus network of Bitcoin is based around burning so much energy/space/infrastructure on hashing that a single actor wouldn't be able to invest a bunch of money and take a controlling majority.

If you have the time and you don't mind, could you elaborate on that? It just doesn't sound right to me. What is the mechanism that discourages big investments? As far as I can tell, there seem to be some economies of scale, that's why there are mining farms.

From the bitcoin wiki "Attacker has a lot of computing power":

"Since this attack doesn't permit all that much power over the network, it is expected that no one will attempt it. A profit-seeking person will always gain more by just following the rules, and even someone trying to destroy the system will probably find other attacks more attractive. However, if this attack is successfully executed, it will be difficult or impossible to "untangle" the mess created -- any changes the attacker makes might become permanent."

[1] https://en.bitcoin.it/wiki/Weaknesses#Attacker_has_a_lot_of_...

It's not that an attacker can't win that way, the point is to play in the bitcoin world, miners must spend a lot of time doing intentionally inefficient things. They spend a lot of energy calculating the hashes, by default. playing by the rules means doing lots of calculations that get thrown away.
Sure, I understand that. My problem is with this statement:

>The whole consensus network of Bitcoin is based around burning so much energy/space/infrastructure on hashing that a single actor wouldn't be able to invest a bunch of money and take a controlling majority.

I just don't think that's true. The only thing keeping one big player from taking over the network is scale. I really don't think that the "whole consensus network of Bitcoin is based around" what he says it is, since it's not necessary. Yes, there is a proof of stake, but it has nothing to do with "burning so much energy/space/infrastructure on hashing that a single actor wouldn't be able to invest a bunch of money and take a controlling majority". It's just a way to create the right incentives for people to want to mine.

Perhaps your point is more subtle than i'm catching on to, but this is right out of the bitcoin paper abstract:

"The longest chain not only serves as proof of the sequence of events witnessed, but proof that it came from the largest pool of CPU power. As long as a majority of CPU power is controlled by nodes that are not cooperating to attack the network, they'll generate the longest chain and outpace attackers." https://bitcoin.org/bitcoin.pdf

So, literally the group that burns the most energy/space/infrastructure is correct, as far as the system is concerned. if an attacker can burn more cpu, generate a longer chain, they win.

Maybe my wording is exaggerated. But the huge scale you'd need for a majority attack is the reason it's not viable, and the network is designed to encourage mining to drive that scale up.

As the wiki points out, potential gains aren't total control: you get to reverse transactions but can't directly steal coins out of someone else's wallet.

With a system of independent agents all trying to game the system to make money, it comes down to a cost/benefit analysis. If Bitcoin weren't designed to have the network scale that it does, the cost of making that attack could be cheap enough for it to be worth doing.

But since the mining incentives are made to drive terawatt-hours of energy used in huge datacenters, the attack doesn't make economic sense. That's what I mean by saying the consensus system is built around having a huge network.

I see your point, thanks.
The way I see it, it is certainly possible for one entity to gain enough computing power to control 51% of the Bitcoin network. However, once you do that, if you actually do any of the bad things that you could do, people will notice, and consequently trust Bitcoin less, so the value goes down. So why make the huge investment to control Bitcoin for nefarious purposes if you will make it worthless in the process?
The proof-of-waste system means that, at market equilibrium, the cost of burning electricity to mine one block and get the 25 bitcoin reward should be equal to the cost of buying it on the open market.

Currently this works out as about $7 of electricity per transaction. https://blockchain.info/charts/cost-per-transaction

That is per block yes? And each block has upto 01Mb of transactions?
People are increasing the transaction limit.
I hear this is encoutering resistance as it reduces the likelihood of people giving non-trivial fees to miners?
This has been talked about for over a year now and the miners have made it pretty clear they're not going to adopt it, especially given that these failing "stress tests" generate more profit for them. Even XT adoption is abysmal.
> miners have made it pretty clear they're not going to adopt it

Source?

Commercial miners make the vast majority of their money on the block reward which has nothing to do with the size of the block. If anything, they'll make more money with less variance with a larger block (since small miners with worse connectivity will have a higher orphan rate).

The only people I've seen opposing a block size increase are idealists who are afraid of further centralization of mining power as hobbyist/small miners will have a more difficult time participating (you'll need faster internet and larger hard drives).

My money is on a block size increase in the next 1-2 years.

How much money, and what odds are you offering?
I'd put $100 on it but I'm not sure what the prevailing odds are or where we might place the bet.

Are there any legitimate prediction markets still operating where we might be able to do this? I googled around a little for it and stumbled across Augur (http://www.augur.net/) but it seems too alpha for such a long term bet right now.

Want to do an escrow? I'll take your money.
Where, specifically?
The miners shot down the four proposals to increase block size, even the tiny 2MB increase.

Increased competition to get in on the smaller blocks leads to larger transaction fees. Miners benefit from people competing to have their transactions hashed in the next block.

If the userbase scales, the competition goes up and transaction fees go higher. If everyone could get their transactions through on a larger block, they're going to pay almost no fee and miner's make less.

It's 25 BTC + miner fees per block. According to the website linked, it's about 20-30 BTC per block, so at $250 USD/BTC, that's ~$12,000 USD per block of electricity.
As fryguy says, that's $7 per transaction, $12,000 per block.

Amusingly as bitcoin gets more successful and the price rises, the system gets less efficient to compensate.

(comment deleted)
That is not how it works. The system gets more efficient as transaction volume increases. The only reason the cost of running the network relative to the number of transactions currently comes out to $7 per tx is that much of the revenue miners earn is from the block subsidy of 25 BTC per 10 minutes. The subsidy is a constant, and therefore as tx volume increases, the total cost of running the network relative to the number of txs decreases.
No, that's not how it works.

Transaction volume doesn't increase with efficiency. Blocksize is capped at 1MB, and any new efficiency goes into the hashing algorithms, not the size. The Bitcoin network has always only been able to handle 1 MB of transactions every 10 minutes (~7 tx/s) and always will at this rate.

No, it is not. Efficiency increases with transaction volume. That transaction volume is currently capped at 1 MB is a separate issue from whether efficiency improves with transaction volume.

It's possible there is a misunderstanding here with me interpreting "gets more successful" as seeing its transaction volume increase, and you interpreting it to mean something else.

You can't fit more transactions into 1,048,576 bytes with more efficiency. It's pretty clear.
> $12,000 per block

If that's true, then why the hell is anyone mining? Bitcoin is currently trading at $240 or so which is half of break-even if the block reward is 25BTC.

e: Nevermind, I see fryguy's comment now:

> It's 25 BTC + miner fees per block. According to the website linked, it's about 20-30 BTC per block, so at $250 USD/BTC, that's ~$12,000 USD per block of electricity.

I wasn't aware miner fees made up such a large portion of the reward these days.

Indeed.

To nitpick a little and add some more information: the 25 bitcoins isn't necessarily the cost of electricity, it's the reward, and the expenses incurred to reap that award approach 25 but likely sit slightly below it to allow for some profit, and the expenses aren't all electricity either but in large part also hardware and overhead.

So what does the split look like in expenses (electricity, hardware, overhead etc). Well in the past few years hardware had a tremendous turnover rate as the industry essentially built an application specific integrated circuit for one particular hash, and then tried to catch up with decades of moore's law (I think they're now at 14nm), seeing extreme exponential growth of hashing power and some hardware going obsolete after a few months and not even being able to break even on their cost (i.e. the hardware:reward ratio was positive, which gives you a sense of how much was spent on hardware), meaning most money probably went to building new chips rather than burning electricity. Take January 2013 to January 2014 for example, hashing power increased from about 25k to 12.m, or 500x in 1 year. That meant if you were reaping 10% of the rewards in early 2013, a year later your setup could only reap 0.02% of the total rewards, necessitating tremendous investments to keep up with competition, investments that are obviously capped by bitcoin block reward, thus electricity was just a fraction of total expenditures.

Of course this changes over time, they're now hitting some real walls and combined with a price stagnancy of bitcoin the hashing power. January 2014-2015 saw just a 21x increase in hashrate for example. So it's safe to say that today, a much greater share of the block reward goes to electricity than before. But even now, much is spent on replacing old equipment and on buying hardware that's just as powerful but uses less electricity than before, meaning even today not the entire 25 bitcoins are spent on electricity and thereby not the entire $7 either.

Beyond that I think it's a bit misleading to state $7 per transaction, even though it's obviously correct in a certain sense that if you take the total expenditures and divide them by the units, you get an average. But if I run an automated subway between two parts of town for $100 per trip that leaves every 10 minutes regardless of occupancy, and it has a max capacity of say 1000 people, it'd be a bit misleading to say if one person took the subway and paid a $1 ticket that it costs $100 per person even though that's the average. No it costs $100 per subway trip whether it has 0 or 1000 people, and if 1 person gets on then it still costs just $1 per person. The fixed costs are $100, regardless of occupancy. Now bitcoin specifically does have a max 'occupancy' (transactions per block) which are close to $7, but bitcoin has 1mb blocks every 10 minutes. That's the bandwidth, 1.7 kb per seconds. We could have 100mb blocks and the 'electricity per transaction' would drop to 7c, while the bandwidth would still be just 170kb/s. As storage, bandwidth and cpu gets cheaper and bigger, we could eventually get to 1 gigabyte blocks and beyond. And as 1 transaction is just some data in a ledger, we could even use 1 transaction (i.e. some data) to represent pairs of multiple transactions. In short, while you're completely correct in citing the $7 figure, I think it's misleading to anyone who doesn't know anything about bitcoin because it tells this story of a ridiculously expensive and inefficient system, without mentioning a context where blocks are like a digital subway (referencing the above analogy) that we can make much bigger with the stroke of a keyboard (there are some genuine technical challenges but they're surmountable), a digital subway that's pretty much in the 56k modem stage and whose scaling up is long overdue, and thereby whose cost per transaction is way exaggerated. The biggest topic in bitcoin right now ...

Bitcoin uses a proof of work system as a form of security in a decentralised system. At the end of the day, there's a certain cost per block, which approaches the reward for mining that block. Today you can fit hundreds of transactions into one such block, imagine a block like a mail package that holds all the world's transactions of the last 10 minutes or so, which is sent to everyone else who record those transactions, and imagine posting that package has a price. It's technically an incorrect analogy but it's just that, an analogy. But here's the thing, the block is digital and as bandwidth, storage and CPU inevitably scales up, you can eventually fit millions of transactions in that block, making each individual transaction much cheaper (despite the fact block rewards go up, too). And that's been the trend so far, every year transaction costs drop and electricity costs per value of money sent drops. It's quite likely that if bitcoin does become a popularly used worldwide digital ledger that the cost of electricity would be pretty trivial, to register any entry on the ledger (which could represent say 0.0001 bitcoin, but it could also represent a barrel of oil, or a million barrels of oil or a billion dollars, if you wanted to. Once you have a ledger you can write to you can make it represent anything you want really).

In short, the claim isn't incorrect today, it uses a lot of energy relative to its utility as a value network, but it's one of those things where the theory on paper, and the current trends in practice, show that the problem will solve itself over time. It reminds me of the endless stream of journalists decades ago who kept saying solar had no future because its embodied energy was more than it could generate, which was a partial truth in the 1980s and one that was rarely mentioned alongside the fact in theory it didn't have to be this way and in practice the trend showed it was getting solved over time. Today payback times of embodied energy went down from 50 years (for panels with a 20 year lifespan) to a fraction of a single year. Funny enough, you can still find people saying these things to this very day, ah well.

If you want to know the rough numbers... well money spent on getting x reward will approach x. Assuming 75% of the money miners spend on getting the block reward (the other 25% going to manufacturing or procuring the hardware, management etc etc), and knowing the price of a bitcoin is $240 and every day roughly 3600 coins are mined, then electricity expenditure is about $650k per day worldwide. Worldwide electricity consumption is about $3 billion (very much a back of the envelope calculation) a day at a hypothetical 10c a kwh, for the US alone total energy expenditures exceed a trillion a year. Bitcoin today is relatively wasteful for the utility it provides today that's for certain, but it's looking pretty good for the future, and in the grand scheme of things it's a really tiny operation in absolute terms.

What's interesting is that a lot of the bitcoin mining has sought out cheap electricity, e.g. Iceland where renewables are between 99 and 100% of electricity, there's a limited environmental impact to mining there and as prices are so cheap, multiple big miners have set up shop there in the past.

Finally it's important to realise that the cost of validating a transaction is pretty much near zero. The electricity waste is in the proof of work, which is hashing and it's just as hard whether you hash 1 or 1 trillion transactions. Further, the amount wasted is based on the block reward which is ridiculously high in the first years of bitcoin because of its distribution system. When the block reward drops, the amount of waste drops, and every day this inches closer to a more market-driven price of a transaction, thereby reward for mining and thereby the cost of waste invested to reap that reward. In short we're seeing, by design, a few years of ridiculously high waste-per-value transmitted...

Can you share your thoughts on the downward pressure the miners put on the price of a bitcoin because they have to sell their rewards to pay for electricity? That seems to be compensated right now by some growth in public interest but won't the price fall instantly if growth stagnates? (In turn causing more miners to stop and the security (thus interest) of the network to fall as well?)
The downward pressure is self-limiting: if less people mine, mining difficulty drops automatically.
... which makes the network less secure and thus less interesting?
Mining difficulty drops, giving the remaining miners more bitcoin per hash.
> Can you share your thoughts on the downward pressure the miners put on the price of a bitcoin because they have to sell their rewards to pay for electricity?

There's not a lot to say you haven't already said. Mining is literally an increase of the money supply that devaluates each unit of that money, in this case. If the price remains the same, that must mean that its offset by an equal increase in demand. And indeed if the public interest stagnates, that offset won't happen and bitcoins will devaluate, you're absolutely right about that. But I'm not sure if there's some interesting 'snowball' effect going on here. Generally people withdraw their money from any investment that does not grow and has stagnated because there's no ROI there, so even if there was no bitcoin block rewards it's likely that if public demand for bitcoin stagnated to nothing that it'd still lead to people saying there's no ROI in bitcoin for me and as public interest has waned the utility of bitcoin won't grow either so I'm selling off my holdings. Such a mass sell-off would cause the price to fall, too. It's no different from say if there were 5 million people on Facebook and all of them only had 3-4 friends on there and public interest stagnated, people would leave and the value of FB would drop. Bitcoin block rewards aren't really a necessary aspect of that failure scenario, it can fail without it. If bitcoin can't beat inflation (which is at 9% per year), i.e. bitcoin isn't growing by 9% a year or so in adoption, then it's dead in the water regardless of inflation because that means that say assuming there are 5 million bitcoin users in the world, that in 10 years there'll be only 12m, and that's just nothing, imagine Facebook took 10 years to grow from 5m to 12m users, it'd have long been acquired by some other company or shut down and would have made no waves whatsoever. So bitcoin mining or not, if public interest stagnates for long enough, bitcoin's dead.

When I say 'dead' I mean as in 'insignificant because it's so small even if it's still alive', dead like myspace or something like that. If the price drops, miners will leave, but that makes mining for others easier. So it reaches a new equilibrium where the incentives to secure the system are lower, but the rewards to cheat the system are, too. Security doesn't really change much in bitcoin as it just finds a new equilibrium and as the incentives for security and anti-security move in the same direction. So it could still be secure, but if public interest stagnates and there's no adoption, no investment, no companies looking to build products and services etc etc, then it's insignificant anyway and will continue to decline until its fully usurped by alternatives.

An interesting idea is that inflation is set to halve in about 10 months from about 9% today to 4.2% or so. Assuming that new demand (due to companies like Coinbase continuing to grow) remains the same, while inflation halves, then we might see price increases again. And bitcoin sort of revolves around those, every time the price is set to increase you get this obvious flock of people investing short-term, a bubble emerging and that's when its in the headlines, when the message boards are flooded, when VCs invest more money etc. Without those bubbles bitcoin would probably have faded into obscurity by now. A lot of that block reward halving already priced in, in theory, but it'll be fun to see how it plays out this time around. Anyway so to answer your question, I don't think bitcoin has to worry about security if growth stagnates long enough, it'd be a bit similar to worrying about whether typewriters are ergonomic enough in a world where its completely irrelevant. Bitcoin has to grow, if it doesn't then its dead and its security isn't very important (although as I mentioned earlier, it'd just settle at a new level. Securi...

But you can run the calculations anywhere, like a solar powered data centre in the desert, so it's not really a inescapable problem.
Somewhat unrelated - for those who don't know Alistair MacLean[1] was a novelist, mostly war thrillers, adventures. My grandpa - a voracious reader and a retired judge spent most of his retirement reading and walking, he turned me on to Alistair MacLean by describing his experience of reading Ice Station Zebra (based on the north pole) as if "you feel the chill in your bones as you read it". So I read that, and ever sing book Alistair MacLean has authored. These were the first novels I read in English. After going through entire works of Alistair MacLean, I went through pretty much any other book I can get my hands on. And the _best_ part was finishing something, going downstairs to grandpa's room and telling him, his response was almost always - "oh yes, I read that in 19XX, love the character X doing something with Y".

Reading the title of the post was a pang of nostalgia, I can still remember him telling me about Ice Station Zebra, Night Without End, Where Eagles Dare, Guns of Navarone, Force 10 from Navarone. I miss him.

[1] https://en.wikipedia.org/wiki/Alistair_MacLean

Is there source code for the attack script anywhere? It would be interesting to see if a decentralized currency can stand up to a decentralized attack.
I've never seen a more FUD headline than that. Got to love the journalistic sensationalism at play here.

To clear this up: the technique in the article is literally what we use in unit tests to check that our TX-based event code won't break under malleability. It's something that Bitcoin developers have been writing code around forever (and warning about just as long.) So truly: if there's anyone out there still writing code that assumes static TXIDs they really do deserve what's coming to them.

As I see it: the attack reaches critical mayhem in a similar way to accepting zero-conf transactions in that what you have is a consensus problem. The specific fix for TX malleability is to watch transactions based on their meaning, not their TXID (in this case "meaning" is looking at the inputs, outputs, version, timelock, etc to produce equivalent transactions.) And of course: don't accept zero-confirmation transactions.

Here's some of my ultra-1337 Python code for producing the "attack" just for laughs:

def mutate_tx(tx_hex):

    """
    Mutates a raw transaction using TX malleability in the scriptSig (specifically, the OP codes.) This function shouldn't be used beyond testing as it uses an ugly eval() hack.

    https://en.bitcoin.it/wiki/Transaction_Malleability
    """
    tx = CTransaction.deserialize(binascii.unhexlify(tx_hex))
    script_sig = repr(tx.vin[0].scriptSig)[9:]
    script_sig = eval("CScript([OP_1, OP_DROP, " + script_sig)
    tx.vin[0].scriptSig = script_sig
    return b2x(tx.serialize())
As you can see, there's nothing to it. Just a clueless attention whore claiming to an even more clueless journalist that he can break Bitcoin.
I think the article is confusing two different issues, the malleability attacks and the dust attacks. Amaclin seems to be behind the dust attack, which is a cheap way to DoS the blockchain by causing blocks to reach the maximum number of SIGOPS with dust transactions, preventing real transactions from going through.

More details here: https://bitcointalk.org/index.php?topic=1166928.0