<oembed><type>rich</type><version>1.0</version><author_name>npub1wtx5qvewc7pd6znlvwktq03mdld05mv3h5dkzfwd3dc30gdmsptsugtuyn</author_name><author_url>https://nostr.ae/npub1wtx5qvewc7pd6znlvwktq03mdld05mv3h5dkzfwd3dc30gdmsptsugtuyn</author_url><provider_name>njump</provider_name><provider_url>https://nostr.ae</provider_url><html>📅 Original date posted:2015-10-20&#xA;📝 Original message:On Tue, Oct 20, 2015 at 12:23 AM s7r via bitcoin-dev &lt;&#xA;bitcoin-dev at lists.linuxfoundation.org&gt; wrote:&#xA;&#xA;&gt; So what exactly is used to create the normalized txid (sha256 hash of&#xA;&gt; what data)? I&#39;ve read in the linked BIP draft that it will strip the&#xA;&gt; &#39;malleable parts&#39; but didn&#39;t understand what exactly will be used to&#xA;&gt; calculate the normalized transactions ids and how will the change apply&#xA;&gt; retro-active for the transactions so deep buried in the blockchain?&#xA;&gt;&#xA;&#xA;The normalization involves two steps:&#xA; - strip the scriptSig scripts in the inputs, i.e., the only part whose&#xA;integrity is not guaranteed by the signature itself, by replacing the&#xA;scripts with empty strings (var length string of size 0)&#xA; - replace the hashes referencing the outputs being spent with the&#xA;normalized hashes of the transaction that created the outputs. This is done&#xA;recursively down to the first v2 transactions.&#xA;&#xA;The second part is not yet explained in the draft, but I will amend it as&#xA;soon as possible.&#xA;&#xA;&#xA;&gt; Pubkeys (addresses) can be reused infinitely so what guarantees us&#xA;&gt; unique normalized txids all the time and protection against replay&#xA;&gt; attacks? The question is not if this issue is covered or not, I know it&#xA;&gt; is, I am just asking how, in simpler terms.&#xA;&gt;&#xA;&#xA;Non-coinbase transactions can still not be replayed since the normalized&#xA;transaction still includes a the normalized transaction hashes of claimed&#xA;outputs, hence any attempt to replay a transaction would fail since the&#xA;outputs were already spent. For coinbase transactions it is indeed possible&#xA;that we create multiple transactions with the same hash (only one of which&#xA;would be spendable), hence we do not strip coinbase transactions and rely&#xA;on BIP 34 to make the coinbase transactions unique (except for blocks 91842&#xA;and 91880 which are the reason we introduced BIP 34 in the first place).&#xA;Clarifying the way the normalized transaction ID is computed should remove&#xA;any ambiguities I hope.&#xA;&#xA;&#xA;&gt;&#xA;&gt; SCRIPT_CHECKSIGEX_NORMALIZE could be explained better in the document.&#xA;&gt;&#xA;&gt; Will it also fix &gt; third level malleability (a tx which spends from&#xA;&gt; another unconfirmed tx which spends from yet another unconfirmed tx)?&#xA;&gt;&#xA;&#xA;Yes, if the computation of the normalized transaction ID includes replacing&#xA;input hashes with their normalized counterpart makes a chain of any depth&#xA;non-malleable.&#xA;&#xA;HTH,&#xA;Christian&#xA;&#xA;&gt;&#xA;&gt;&#xA;&gt; On 10/19/2015 6:23 PM, Tier Nolan via bitcoin-dev wrote:&#xA;&gt; &gt; On Mon, Oct 19, 2015 at 3:01 PM, Christian Decker via bitcoin-dev&#xA;&gt; &gt; &lt;bitcoin-dev at lists.linuxfoundation.org&#xA;&gt; &gt; &lt;mailto:bitcoin-dev at lists.linuxfoundation.org&gt;&gt; wrote:&#xA;&gt; &gt;&#xA;&gt; &gt;     As with the previous version, which was using a hard-fork, the&#xA;&gt; &gt;     normalized transaction ID is computed only considering the&#xA;&gt; &gt;     non-malleable parts of a transaction, i.e., stripping the signatures&#xA;&gt; &gt;     before computing the hash of the transaction.&#xA;&gt; &gt;     &lt;https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&gt;&#xA;&gt; &gt;&#xA;&gt; &gt;&#xA;&gt; &gt; Is this proposal recursive?&#xA;&gt; &gt;&#xA;&gt; &gt; *Coinbase transaction&#xA;&gt; &gt; *&#xA;&gt; &gt;&#xA;&gt; &gt; * n-txid = txid&#xA;&gt; &gt;&#xA;&gt; &gt; *Non-coinbase transactions&#xA;&gt; &gt; *&#xA;&gt; &gt; * replace sigScripts with empty strings&#xA;&gt; &gt; * replace txids in TxIns with n-txid for parents&#xA;&gt; &gt;&#xA;&gt; &gt; The 2nd step is recursive starting from the coinbases.&#xA;&gt; &gt;&#xA;&gt; &gt; In effect, the rule is that txids are what they would have been if&#xA;&gt; &gt; n-txids had been used right from the start.&#xA;&gt; &gt;&#xA;&gt; &gt;&#xA;&gt; _______________________________________________&#xA;&gt; bitcoin-dev mailing list&#xA;&gt; bitcoin-dev at lists.linuxfoundation.org&#xA;&gt; https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&#xA;&gt;&#xA;-------------- next part --------------&#xA;An HTML attachment was scrubbed...&#xA;URL: &lt;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20151020/2655d737/attachment.html&gt;</html></oembed>