BOMBARCHIVE
Explore

A living reference collection. Written in the wiki, preserved in Git.

The archiveBitcoin

Transaction malleability

Transaction malleability is the possibility of changing a Bitcoin transaction's serialized form, and therefore its transaction identifier (txid), without necessarily changing which coins it spends or who receives them. Historically, some changes could be made by a third party without the signing keys. That distinction made transaction tracking and contracts depending on an unconfirmed transaction ID more fragile. The subsequent history links signature encoding, Bitcoin payment channels, Segregated Witness, and eventually Inscriptions. Pieter Wuille, BIP 62 — 2014 proposal · Bitcoin Core — January 2016 explanation

Malleability is not synonymous with transaction replacement. A replacement transaction may deliberately change its outputs or fees and compete for the same inputs. The narrower historical malleability problem includes alternate, equally valid encodings of substantially the same payment. In both cases a previously observed txid can fail to be the identifier eventually confirmed, but the mechanisms and motivations are different.

Where the malleability came from

In legacy Bitcoin spends, the input's scriptSig sits inside the serialized transaction from which the txid is calculated. Yet the signature-checking rules do not simply sign the finished scriptSig as data. In consequence, certain substitutions in the unlocking script could preserve successful validation while changing the identifier. BIP 62 — taxonomy of malleability sources

BIP 62's source catalogue names several distinct mechanisms:

  • Signature encodings: an ECDSA signature could have alternative encodings accepted by the then-used OpenSSL parser. Moreover, an ECDSA pair (r,s) can have the mathematically equivalent (r,n−s), giving a different signature byte string without recovering the private key.
  • Script encoding: alternative push operations, unnecessarily padded numbers or superfluous stack operations could leave the effective unlocking conditions satisfied.
  • Ignored data: a script that discards an input can allow changes to data it never inspects. The historical OP_CHECKMULTISIG extra dummy stack element was a particularly concrete case.
  • Signer-authorized changes: people holding the signing keys can create a fresh signature, and some signature-hash modes deliberately leave parts of a transaction unspecified. These are not solved merely by forbidding known third-party encoding tricks.

This is a catalogue from a 2014 proposal, not a list of nine consensus rules Bitcoin adopted. Its authors explicitly distinguished fixable sources from cases that signing participants or permissive scripts could still create. BIP 62 — motivation and rule proposals

A child transaction identifies an output by its parent's txid and output number. If the parent was rewritten with equivalent unlocking data and the alternate version confirmed, a previously signed child referring to the old identifier would not spend the confirmed output. The payment's economic result might be the same, while the dependent transaction's reference is wrong. This is why the problem extended beyond a wallet occasionally displaying an unfamiliar hash. Bitcoin Core — downstream dependency example

February–March 2014: exchange claims and the first comprehensive proposal

In February 2014, Mt. Gox publicly attributed its withdrawal difficulties to transaction malleability. Its explanation became part of the story of the exchange's collapse, but attribution was controversial even at the time.

Christian Decker and Roger Wattenhofer published Bitcoin Transaction Malleability and MtGox on 26 March 2014. This is original '''research based on the authors' own network observations''', not Mt. Gox's internal accounting or a forensic reconstruction of its private wallets. Their monitoring began in January 2013. In the period before Mt. Gox halted withdrawals on 7 February 2014, they detected 421 conflicting-transaction sets representing 1,811.58 BTC, most of which did not result in confirmed malleated transactions. They estimated that at most roughly 386 BTC in their observed period could have been obtained through successful malleability attacks across Mt. Gox or other services. Decker and Wattenhofer, 26 March 2014 — authors' paper

The study strongly challenged malleability as a sufficient explanation for the exchange's enormous reported deficit. It did not identify who controlled every conflicting transaction, prove a 386 BTC theft at Mt. Gox, or observe every peer on the network. The researchers were explicit that attacks before their January 2013 collection and conflicts not visible to their peers lay outside the direct dataset. A broad finding that the company needed another explanation should not be converted into an omniscient account of all its losses. Paper — method and conclusion · ETH Zurich publication record

Pieter Wuille's BIP 62, assigned 12 March 2014, proposed a set of script and signature constraints to limit the recognized forms of malleability. That is a contemporary standards artifact identifying the engineering problem, not evidence that the entire package was ever activated. The maintained BIP is now marked Closed; Bitcoin Core's January 2016 explanation described the earlier proposal as withdrawn in favor of SegWit's different approach. Those labels describe the document's status at different times, not two deployed rule sets. BIP 62 — canonical proposal and current status · Bitcoin Core — contemporary reassessment

2015: strict DER becomes a consensus rule

BIP 66, assigned 10 January 2015, narrowed what encoding an ECDSA signature may use when passed to signature-verifying script operations. This was both a partial reduction in encoding malleability and a consensus-engineering change: Bitcoin had inherited OpenSSL's acceptance behaviour, which was not designed to provide stable, bit-for-bit blockchain validity rules across library versions. BIP 66 codified strict DER acceptance as a Bitcoin rule. Transactions using non-DER signatures had already been non-standard for ordinary relay since Bitcoin Core 0.8.0; relay policy and consensus enforcement were separate stages. BIP 66 — author, motivation and specification · Bitcoin Core 0.10.0 — first-party release notes

Its July 2015 activation exposed a different danger. The Bitcoin.org notice dated 4 July 2015, later updated through 15 July, recorded a six-block invalid branch followed by a three-block invalid branch. Some miners had signalled readiness for the new rules but were producing blocks without fully validating their parents. This incident was a consensus-validation and miner signalling failure, not evidence of a malleability theft. Bitcoin.org — contemporaneous warning and subsequent updates

2015–2017: changing what a txid commits to

Segregated Witness took a structurally different approach. Pieter Wuille presented the design on 7 December 2015; BIP 141 was assigned later that month. Rather than trying to canonicalize every possible unlocking script, the upgrade separated witness data from the non-witness bytes used to calculate the txid. It also defined wtxid, the hash of the witness-inclusive serialization. The deployed rules became active at Bitcoin block 481,824 on 24 August 2017. BIP 141 — consensus specification · Bitcoin Core — first-party deployment explanation

For a transaction spending only SegWit inputs, changes confined to its witness no longer change its txid. They can still alter the witness-inclusive wtxid, assuming such a variation is otherwise valid. Bitcoin Core's January 2016 explanation explicitly warned that a transaction with even one legacy input does not receive the same blanket protection. It also did not promise that a signer could not intentionally issue a different transaction. Bitcoin Core — mixed-input qualification · BIP 141 — txid and wtxid definitions

Two adjacent proposals underline why proposal status matters:

  • BIP 146, assigned 16 August 2016, proposed LOW_S and NULLFAIL consensus constraints to remove remaining ECDSA witness-related malleability. Its canonical status is Closed; the whole proposed package was not deployed as BIP 146. A proposed standard must not be read backward as an enforced consensus rule. BIP 146 — closed proposal
  • BIP 147, assigned 2 September 2016, required an empty OP_CHECKMULTISIG dummy stack element (NULLDUMMY). It was deployed with SegWit, applying to the old and witness forms of those scripts. Its author specifically identified changes to wtxid as a remaining relay-efficiency concern even when txid was protected. BIP 147 — deployed rule · Bitcoin Core — null-dummy explanation

These records do not support a story in which BIP 62 was gradually switched on in its entirety. Different proposals survived, changed or closed, and their effects must be checked against actual activated consensus rules.

Why payment channels needed this distinction

An early channel could assemble a settlement or refund spending a funding transaction before the funding transaction had confirmed. If a third party changed the funding transaction's txid while keeping its outputs intact, those pre-signed descendants could refer to an outpoint that never existed on the confirmed chain. This endangered constructions that assumed the future outpoint identifier was stable. Bitcoin Core — channel benefits · Lightning paper — maintained source

The history is not simply “SegWit created Lightning.” Earlier one-way channels and prototypes existed; time locks, dispute rules, interoperable protocols and actual software releases have separate dates. SegWit addressed a major obstacle to safer channel construction and simpler dependent transactions. Bitcoin payment channels and Lightning Network preserve the rest of that chronology.

Why an Ordinals or Bitmap indexer should care

An inscription ID uses a reveal transaction's txid plus a parser-assigned inscription index. A standard Taproot reveal is a witness spend, so its identifying txid is independent of the witness serialization. That is valuable for stable outpoint references, but it does not mean that a bare txid independently proves the inscription's body, or that a mempool candidate is an established historical inscription. The witness and the relevant block's witness commitment still matter. BIP 141 — witness commitment · ord — inscription IDs and reveal construction

BOMB's 0.bitmap preservation work provides an especially concrete local example: its reproducible proof checks both the reveal's transaction-Merkle inclusion and a separate witness-commitment path. The accompanying audit deliberately changes the purported witness contents while leaving the legacy txid the same; the altered bytes fail witness verification. This is an archive verification test, not proof that an attacker could substitute an arbitrary inscription body into a valid Taproot spend. BOMB review — provenance and verification limits · BOMB — proof source records

A confirmed reveal has a chain location; a pending reveal can still be displaced by a conflicting spend or never confirm. Its contents, transaction identity and ordinal meaning must be reconstructed from the actual confirmed transaction and witness. Transaction replacement follows the separate mempool-policy story.

From the archivist's desk

What first looks like a technical nuisance turns out to be a dispute about identity. Two transaction byte strings could accomplish the same payment but carry different names. A contract that treated the first name as destiny could break even when nobody had changed the payee.

The fixes did not all do the same job. Some rejected alternate encodings; one changed which bytes formed the transaction's name; another committed separately to the witnesses. Stable reference, valid spend and authenticated content are different promises. That separation remains useful long after the original malleability disputes.

Open research

Open question
Recover the earliest securely dated public discussion or source-level demonstration of third-party transaction malleability rather than dating its discovery solely from later recollections or a 2014 paper's related-work section.
Open question
Preserve a reproducible pair of historical conflicting transaction serializations that performed the same payment and a proof of which one confirmed; distinguish it from ordinary fee-based replacement.
Open question
Audit historical network observations and contemporaneous Mt. Gox statements side by side, without treating the 2014 research sample as the exchange's internal accounting ledger.