<oembed><type>rich</type><version>1.0</version><author_name>npub1m230cem2yh3mtdzkg32qhj73uytgkyg5ylxsu083n3tpjnajxx4qqa2np2</author_name><author_url>https://nostr.ae/npub1m230cem2yh3mtdzkg32qhj73uytgkyg5ylxsu083n3tpjnajxx4qqa2np2</author_url><provider_name>njump</provider_name><provider_url>https://nostr.ae</provider_url><html>📅 Original date posted:2013-07-18&#xA;📝 Original message:On Wed, Jul 17, 2013 at 02:29:26PM +0200, Mike Hearn wrote:&#xA;&gt; Partial UTXO sets is a neat idea. Unfortunately my intuition is that many&#xA;&gt; SPV wallets only remain open for &lt;1 minute at a time because the user wants&#xA;&gt; to see they received money, or to send it. It&#39;d be neat to get some&#xA;&gt; telemetry from the Android wallet for this - I will ask Andreas to let&#xA;&gt; users opt in to usage statistics.&#xA;&#xA;Good idea.&#xA;&#xA;&gt; So for anti-DoS I think smart prioritisation heuristics are the way to go&#xA;&gt; again. Perhaps by letting clients have an &#34;identity&#34; that they provide to a&#xA;&gt; node when it&#39;s load shedding. Clients that have been seen before, have a&#xA;&gt; track record of not being abusive etc get priority and new clients that&#xA;&gt; were never seen before get dropped. Coming up with a way to do that whilst&#xA;&gt; preserving privacy sounds like an interesting cryptographic challenge.&#xA;&#xA;SPV clients behaving normally are highly abusive: they use up maximum&#xA;node resources with minimum cost to themselves. (nodes doing an initial&#xA;block download are similar now, although with partial mode they can&#xA;contribute back to the network sooner)&#xA;&#xA;We can&#39;t win if the attacker has more upstream bandwidth than we have&#xA;downstream, but fortunately botnets are generally comprised of computers&#xA;on asymetric residential connections. Thus our goal is to prevent the&#xA;attacker from using lots of downstream bandwidth, and more importantly,&#xA;from consuming more memory and similar resources than we posess.&#xA;Annoyingly the raw # of TCP connections is very much a limited resource&#xA;due to constraints on the # of ports a process can handle, and&#xA;constraints imposed by stateful firewalls, and memory used by kernel&#xA;buffers.&#xA;&#xA;Anything that allows for more incoming connections with less memory&#xA;usage is a good thing - bloom filters are limited to 32KiB and the&#xA;per-peer test if a INV item needs to be relayed to a peer is fairly&#xA;cheap, but we also have other buffers like pending INV messages and so&#xA;on. EC2 micro instances, as an example, often need -maxconnections&#xA;limited or they run out of memory - we&#39;ve probably got room for&#xA;improvement; removing mapRelay and just grabbing relayed txs from the&#xA;mempool comes to mind.&#xA;&#xA;&#xA;More generally a good thing to do would be to force incoming peers to&#xA;use up RAM to make a connection. We can do that with a proof-of-data&#xA;posession engineered such that unless you store the data in high-speed&#xA;memory you will have your connection dropped. Per peer a node can pick a&#xA;nonce k and define j_i=H(k+i), sending the peer a set J=(j_0...j_n) to&#xA;store in RAM. With f(k, n, i) as a pseudo-random sequence generator we&#xA;create nonce x and ask our peer to compute J&#39;(x, m) = j_f(x, n, 0) ^ ...&#xA;^ j_f(x, n, m)) and give us the result. (^ as the XOR operator) Because&#xA;we know the nonce k we can do that cheaply, calculating it on the fly,&#xA;but our peers have no choice but to store J and retrieve it on demand.&#xA;If they store J in RAM they can do so quickly; if they store J on disk&#xA;they can&#39;t. We then prioritize peers by how fast they respond to these&#xA;requests, both measuring ping times, and forcing attackers trying to&#xA;connect to large numbers of peers to posess large amounts of relatively&#xA;expensive RAM. This is particularly nice because we&#39;ve can make it&#xA;significantly more expensive for anyone to peer to every node in the&#xA;Bitcoin network simultaneously to do things like watch transaction&#xA;propagation in real-time.&#xA;&#xA;A more sophisticated approach would be possible if there existed a&#xA;version of H() with a computational trap-door - that is if there existed&#xA;H&#39;(s, i)=H(i) where H&#39; had significantly faster running time than H(),&#xA;but required knowledge of a secret. Our peers would then be able to&#xA;answer our challenges quickly only if they stored the intermediate&#xA;results in a lookup table, while we could check those challenges cheaply&#xA;without that table.&#xA;&#xA;Adam: you&#39;re our local crypto-expert, what can we use for H&#39;? Seems that&#xA;maybe some kind of asymmetric crypto system would work by requiring the&#xA;peer to crack weak secret keys that we generate deterministicly.&#xA;&#xA;-- &#xA;&#39;peter&#39;[:-1]@petertodd.org&#xA;-------------- next part --------------&#xA;A non-text attachment was scrubbed...&#xA;Name: signature.asc&#xA;Type: application/pgp-signature&#xA;Size: 490 bytes&#xA;Desc: Digital signature&#xA;URL: &lt;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20130718/edcced21/attachment.sig&gt;</html></oembed>