808bits

How close the new SHA-256 collision gets to breaking Bitcoin

2026-11-22 · 6 min · incidents

Two 128-byte messages published this month give the same digest under SHA-256 cut down to its first 38 steps. I ran them myself. With 39 steps the digests have nothing in common, and with the full 64 steps that Bitcoin uses they are 4c42ae94... and 879f2967....

The pair comes from A collision for 38-step SHA-256 by Omer Goldzweig, received by the IACR preprint archive on 16 November. It is the first real collision at 38 steps from the standard starting state. Earlier attacks on 38 steps were cost estimates, the first of them 2^104.3 in June. This paper claims 2^54.8 and reports that the search took 53 hours of rented GPU time, about US$95, after a lucky hit at a tenth of the expected work. The first page also says the work is “predominantly AI-generated”, done by Claude agents under the author’s direction.

Bitcoin hashes block headers, transactions, scripts and signed messages with SHA-256, so I wanted to know how much of that a result like this touches. I started with the pair and then went through each place the hash is used.

The pair, rerun

I wrote the compression function from the standard with the step count as a parameter and checked it against Python’s hashlib at 64 steps. Then I ran the paper’s two messages at every count from 1 to 64. The digests match for 1 to 7, where the messages have not yet started to differ, and for 38. They match nowhere else.

The paper says so itself. Its conclusion reads: “a collision for more steps needs a different characteristic.” To see where the 38 comes from I kept the second block running past step 37 and marked each step where the two executions disagree, once for the message word fed in and once for the internal state:

step   0         1         2         3         4         5         6
       0123456789012345678901234567890123456789012345678901234567890123
word   .......XX.X....X.......XX.............XXXXXXXXXXXXXXXXXXXXXXXXXX
state  .......XXXXXXXXXXXXXXXXX..............XXXXXXXXXXXXXXXXXXXXXXXXXX

The messages differ in four of their sixteen words (7, 8, 10 and 15). From word 16 on nobody chooses anything: SHA-256 computes each further word from earlier ones. The attack arranges for the differences to cancel inside the state by step 24, with help from the computed words 23 and 24, and then it needs every later word to come out identical in both messages. Words 25 to 37 do. Word 38 does not, and from there the two runs never agree again.

So the last fourteen steps of the collision cost the attacker nothing, and they exist because the word schedule happens to stay silent for that long with this choice of differences. A 64-step version of the same idea would need it silent for 39 words in a row.

Mining

Proof of work asks for a header whose double SHA-256 falls below a target. Two inputs with the same hash are of no use to a miner. In the words of the Hashcash page of the Bitcoin wiki, it “relies only on the hash partial preimage resistance property”.

Preimage attacks on SHA-256 are a separate line of research, and a much slower one. The record stood at 45 steps from 2012 until a EUROCRYPT paper this year reached 47. The 45-step attack costs 2^255.5 against 2^256 for trying inputs at random, which is a saving of about 30%.

A full collision

Suppose the same kind of collision existed for all 64 steps. The attacker would hold two inputs of his own making with one hash. He could not match a hash that somebody else had already published, so no confirmed transaction, existing block or funded address would be affected. Giechaskiel, Cremers and Rasmussen worked through this case in 2016: “Collisions are also not useful, as both values are controlled by the attacker, so cannot alter existing blocks.”

I went through eleven places where Bitcoin uses SHA-256, and a collision does damage in the ones where two parties build something together. A pay-to-witness-script-hash address (P2WSH) is the SHA-256 of a script. Someone who contributes to that script could prepare a second script with the same hash that pays only him, let the others fund the address, and spend with the second. The same trick applies to the hash that a signature covers. Two blocks or two transactions with one identifier could also be shown to different halves of the network.

Bitcoin’s designers knew this risk from the older address format, whose 160-bit hash gives only 80 bits of collision security. BIP 141 moved scripts to a 256-bit hash because “2^80 work is not infeasible anymore”. Today the bar is 2^128. The network computes about 2^94.7 header hashes a year at 1.04 ZH/s (mempool.space, 22 November), so 2^128 is ten billion years of it, and mining hardware cannot run a collision search anyway.

The bounty

There is an on-chain test for all of this. In September 2013 Peter Todd funded addresses that pay anyone who presents two different messages with the same hash, one address per hash function. No signature is needed.

The SHA-1 address was emptied on 23 February 2017 at 13:08 UTC, the day Google and CWI published the first SHA-1 collision. The claiming transaction paid out 2.48 BTC, and the first message in it begins %PDF-1.3.

The SHA-256 address holds 0.27734251 BTC in ten outputs, none of them spent as of block 977,036. Four of the ten arrived later on that same 23 February, 0.12572363 BTC from people who had just watched the first bounty go. The rules cap messages at 520 bytes. The messages in this paper are 128.

Seven steps, two years

The objection I would raise is the trend. The longest real collision was 28 steps in 2013 and 31 in December 2024. This year brought 35, 36 and now 38, and the stated cost at 38 steps fell by about fifty bits between June and November. Draw a line through that and it crosses 64 uncomfortably soon.

I do not think the line is the right reading. The 2013 paper that held the 28-step record also contained a 38-step collision for an attacker who may pick the starting state, which the real hash function does not allow. Goldzweig’s messages differ in the same four words as that one. The 2026 results are real collisions catching up with a frontier drawn thirteen years ago, and that frontier has moved by one step since, to 39 in 2024.

SHA-1 is the comparison people will reach for, and it points the other way. A collision attack on the full 80 steps of SHA-1 was announced in February 2005 at 2^69, twelve years before anyone produced a collision. Nothing of the kind exists for SHA-256 at any cost below 2^128. What I checked is the pair. The 2^54.8 is the paper’s own figure, and I found no public review of it when I looked on 22 November. I also found no alarm to correct: one Hacker News submission with one point, and nothing on the Bitcoin developer list.

What bothers me more than the step count is the method. An author with no listed affiliation directed AI agents to a result that the field’s own estimates had put about fifty bits away five months earlier. If that repeats, the next estimate for 39 or 40 steps deserves less trust as a floor than it would have had last year.

Bitcoin’s answer to this paper is 26 steps and a different property. The 0.277 BTC is still there.