<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div>Thanks for the clarification. Yes, I referred to CompactSize using the lingo of <a href="https://en.bitcoin.it/wiki/Protocol_documentation">https://en.bitcoin.it/wiki/Protocol_documentation</a></div><div><br></div><div>I am not sure if it is current concern. Apparently an exception is thrown if non-canonical CompactSize in a transaction s parsed.</div><div>Is it ensured that transactions are always parsed before computing their hash?</div><div><br></div><div apple-content-edited="true">
<div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">Tamas Blummer</div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br></div></div><div><div>On Feb 1, 2015, at 11:44 AM, Wladimir &lt;<a href="mailto:laanwj@gmail.com">laanwj@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><br>On Sun, 1 Feb 2015, Tamas Blummer wrote:<br><br><blockquote type="cite">I wonder of consequences if var_int is used in its longer than necessary forms (e.g encoding 1 as 0xfd0100 instead of 0x01)<br></blockquote><br>In serialize.h lingo you are talking about CompactSize, not VarInt.<br><br>CompactSizes indeed have redundancy in their representation, i.e. the same number can be represented as up to four different byte sequences.<br><br>VARINTs have a different format that (AFAIK) isn't used anywhere in the block chain. See WriteVarInt / ReadVarInt. These were designed to not have any redundancy in their representation.<br><br><blockquote type="cite">This is already of interest if applying size limit to a block, since transaction count is var_int but is not part of the hashed header or the<br>merkle tree.<br></blockquote><br>Are you sure that this is a current concern? Non-canonical CompactSizes are forbidden - in serialize.h this is flagged in ReadCompactSize.<br><br>Wladimir<br><br><br></blockquote></div><br></body></html>