<oembed><type>rich</type><version>1.0</version><title>Andrea [ARCHIVE] wrote</title><author_name>Andrea [ARCHIVE] (npub18r…8qr6z)</author_name><author_url>https://yabu.me/npub18rpmnsgdeefa9vxvg4sewhx70wjmnhtkcpdxuecyrlyg7ref4eyqd8qr6z</author_url><provider_name>njump</provider_name><provider_url>https://yabu.me</provider_url><html>📅 Original date posted:2018-06-27&#xA;📝 Original message:Hi William, Andrew, list,&#xA;&#xA;As noted by William there are some types missing in the global-types definition, because the number of each map for I/O must be known to the parser in order to use the correct definitions for the types. At the moment a parser reading a key-value record does not know whether it should read it as per-input type or per-output, a way to address this is to declare in advance the number of maps and ensure they are ordered (inputs first). If you haven&#39;t already worked out some types for that i propose using:&#xA;&#xA;Number of inputs&#xA;- key (None, only the type): PSBT_GLOBAL_INPUT_NUMBER = 0x01  &#xA;- value: Varint &#xA;&#xA;Number of outputs&#xA;- key (none, only the type): PSBT_GLOBAL_OUTPUT_NUMBER = 0x02&#xA;- value: Varint&#xA;&#xA;On another note I think we can set a hard limit on the size of the PSBT, currently is &#39;legal&#39; to produce a very large PSBT with an excessive number of Inputs and Outputs. By excessive I mean that even in the best case scenario (using the smallest possible scriptPubKey as in P2WPKH) it is possible to create a PSBT that would certainly create an invalid transaction (because of its size) when finalized. I haven&#39;t found anything related to this in the previous discussions, please ignore this if it was already proposed/discussed.&#xA;&#xA;&#xA;Cheers, Andrea.&#xA;&#xA;‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐&#xA;&#xA;On June 27, 2018 8:09 AM, William Casarin via bitcoin-dev &lt;bitcoin-dev at lists.linuxfoundation.org&gt; wrote:&#xA;&#xA;&gt; ​​&#xA;&gt; &#xA;&gt; Hey Andrew,&#xA;&gt; &#xA;&gt; If I&#39;m reading the spec right: the way it is designed right now, you&#xA;&gt; &#xA;&gt; could create hundreds of thousands of zero bytes in the input or output&#xA;&gt; &#xA;&gt; key-value arrays. As far as I can tell this would be considered valid,&#xA;&gt; &#xA;&gt; as it is simply a large array of empty dictionaries. Is this right? I&#39;m&#xA;&gt; &#xA;&gt; worried about buffer overflows in cases where someone sends a large blob&#xA;&gt; &#xA;&gt; of zeros to an unsuspecting implementation.&#xA;&gt; &#xA;&gt; Also, the extensibility section reads:&#xA;&gt; &#xA;&gt; &gt; Additional key-value maps with different types for the key-value pairs&#xA;&gt; &gt; &#xA;&gt; &gt; can be added on to the end of the format.&#xA;&gt; &#xA;&gt; &#34;different types for the key-value pairs&#34;, is this referring to new&#xA;&gt; &#xA;&gt; types beyond the current global, input and output types?&#xA;&gt; &#xA;&gt; &gt; The number of each map that follows must be specified in the globals&#xA;&gt; &gt; &#xA;&gt; &gt; section&#xA;&gt; &#xA;&gt; Is this out of date? Since there is only one type in the global section&#xA;&gt; &#xA;&gt; now (tx).&#xA;&gt; &#xA;&gt; &gt; so that parsers will know when to use different definitions of the&#xA;&gt; &gt; &#xA;&gt; &gt; data types&#xA;&gt; &#xA;&gt; I&#39;m not sure what this means.&#xA;&gt; &#xA;&gt; Thanks!&#xA;&gt; &#xA;&gt; Will&#xA;&gt; &#xA;&gt; &#xA;&gt; ------------------------------------------------&#xA;&gt; &#xA;&gt; https://jb55.com&#xA;&gt; &#xA;&gt; bitcoin-dev mailing list&#xA;&gt; &#xA;&gt; bitcoin-dev at lists.linuxfoundation.org&#xA;&gt; &#xA;&gt; https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev</html></oembed>