Transaction Malleability Explained

Now that SegWit has been activated and the way for innovation has been paved, there has been an improvement under the hood that solves the problem of ‘transaction malleability’. This article will discuss the problem of transaction malleability and why solving it is of great importance.

What is Transaction Malleability?

To understand transaction malleability, it is important that Bitcoin is viewed as a global ledger where transactions serve as bank checks. This analogy is explained in a previous article.

A transaction hash, with which a transaction can be identified, can be seen as a fingerprint. This hash is therefore unique for each transaction. If something changes in a transaction, this fingerprint will also change, because the transaction is no longer the same as before.

Where bank checks must be signed with a signature, bitcoin transactions must be signed with a digital signature. Like a signature of the human hand, a digital signature can also show minimal deviations when it is typeset, after which it is still considered valid.

Because the aforementioned transaction hash contains all the data of a transaction, it also changes if the signature changes. Any signature changes can only happen when they have been sent over the network, but not yet confirmed in a block. Once confirmed, the transaction is established, and the attached signature of that transaction is considered to be the correct one.

Since the signature and hash have not yet been determined until that confirmation, it is possible to make changes to the signature after the transaction has been sent, which will then also change the hash.

This can be compared to replacing a signature on a check. The amount and other information remains the same, only a different signature is added. Subsequently, the hash will also change, as it is a fingerprint of both the amount, the information and the signature. Because this fingerprint is used to check the correctness of all subsequent transactions, and the entire blockchain builds on this, changing this fingerprint is not desirable. If it turns out afterwards that a transaction halfway through the list was incorrect (an incorrect hash because the signature was changed later), the following transactions will also be invalid because they were based on the hash of the transaction that was changed afterwards.

SegWit and transaction malleability

Changing the signature of transactions therefore results in a changed transaction hash, which means that subsequent transactions will not be valid either. With SegWit transactions, the validity of transactions is no longer based on the signature. This means that even if the signature of a transaction changes, the hash remains the same and subsequent transactions are also valid. After all, all new transactions are still based on the fingerprint of the previous transaction.

It’s not that the signatures are now superfluous; these are still being checked. However, they are no longer used to generate the fingerprint that makes a transaction identifiable.

This article was written based on articles published by Jimmy Song. Jimmy Song is a Bitcoin developer, entrepreneur and former developer for bitcoinwallet Armory. In his Bitcoin Tech Talk series, he lets the reader watch the developments surrounding the technical aspects of Bitcoin.

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *

© 2024 Cryptocoin