Received: from sog-mx-1.v43.ch3.sourceforge.com ([172.29.43.191] helo=mx.sourceforge.net) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1SsY7r-0005sD-EJ for bitcoin-development@lists.sourceforge.net; Sat, 21 Jul 2012 11:45:35 +0000 Received-SPF: pass (sog-mx-1.v43.ch3.sourceforge.com: domain of gmail.com designates 74.125.82.175 as permitted sender) client-ip=74.125.82.175; envelope-from=mh.in.england@gmail.com; helo=mail-we0-f175.google.com; Received: from mail-we0-f175.google.com ([74.125.82.175]) by sog-mx-1.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1SsY7q-0004hM-I9 for bitcoin-development@lists.sourceforge.net; Sat, 21 Jul 2012 11:45:35 +0000 Received: by weyr6 with SMTP id r6so3407542wey.34 for ; Sat, 21 Jul 2012 04:45:28 -0700 (PDT) MIME-Version: 1.0 Received: by 10.180.79.229 with SMTP id m5mr21692901wix.13.1342871128420; Sat, 21 Jul 2012 04:45:28 -0700 (PDT) Sender: mh.in.england@gmail.com Received: by 10.216.19.13 with HTTP; Sat, 21 Jul 2012 04:45:28 -0700 (PDT) In-Reply-To: <1340132998.6065.7.camel@bmthinkpad> References: <1339766346.31489.49.camel@bmthinkpad> <1339771184.31489.53.camel@bmthinkpad> <1340132998.6065.7.camel@bmthinkpad> Date: Sat, 21 Jul 2012 13:45:28 +0200 X-Google-Sender-Auth: VYrGfT87KRu259-weWtXB-EAl7Q Message-ID: From: Mike Hearn To: Matt Corallo Content-Type: text/plain; charset=UTF-8 X-Spam-Score: -1.5 (-) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (mh.in.england[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-Headers-End: 1SsY7q-0004hM-I9 Cc: Bitcoin Development Subject: Re: [Bitcoin-development] New P2P commands for diagnostics, SPV clients X-BeenThere: bitcoin-development@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jul 2012 11:45:35 -0000 One thing that occurred to me recently is that it'd be useful if filters could contain exact matches as well as Bloom filters. Specifically I'm thinking of things like my bond network proposal where some outputs may be marked as special using script fragments like "BOND" 2DROP. This would allow systems that are only interested in data and transactions relevant to bonds to exact-filter the chain on that marker, and then when a transaction is discovered, add the hash of that transaction to a parallel Bloom filter, ensuring you can see any transactions that connect to it. The spec as provided by Jeff doesn't specify how filters are matched against transactions. I propose the following algorithm: For each TX: - Check if the hash of the tx itself matches the filter - For each input: - For each script data element check if it is found in the filter - Check if the COutPoint.hash value is in the filter (let's you select txns that connect to arbitrary txns of interest) - For each output - For each script data element check if it is found in the filter