Bitcoin Stack Alternate is a query and reply website for Bitcoin crypto-currency fanatics. It solely takes a minute to enroll.
Anyone can ask a query
Anyone can reply
The most effective solutions are voted up and rise to the highest
Requested
Considered
87 instances
I am engaged on a “mild consumer” for ION (Identification Overlay Community), and I might wish to see if there’s a higher technique to seize the OP_RETURN information that it wants to be able to construct state.
At the moment I’m iterating by means of each block beginning at a selected top after which iterating by means of every transaction and every transaction output to be able to discover the OP_RETURN signature that I’m searching for.
Is there a greater technique to accomplish this by requesting all OP_RETURN information solely? The bandwidth necessities for downloading all the block information is a bottleneck for what I might love to do, however I do not assume what I am searching for is feasible with solely the Bitcoin Wire protocol.
I’ve no expertise of this however from a superficial take a look at BIP-37 I believe this form of factor would possibly be potential utilizing bloom filters.
Filter matching algorithm
The filter could be examined towards arbitrary items of knowledge, to see if that information was inserted by the consumer. Due to this fact the query arises of what items of knowledge must be inserted/examined.To find out if a transaction matches the filter, the next algorithm is used. As soon as a match is discovered the algorithm aborts.
- Take a look at the hash of the transaction itself.
- For every output, check every information component of the output script. This implies every hash and key within the output script is examined independently. Vital: if an output matches while testing a transaction, the node would possibly must replace the filter by inserting the serialized COutPoint construction. See beneath for extra particulars.
- For every enter, check the serialized COutPoint construction.
- For every enter, check every information component of the enter script (be aware: enter scripts solely ever comprise information parts).
- In any other case there isn’t any match.
On this manner addresses, keys and script hashes (for P2SH outputs) can all be added to the filter. You can too match towards courses of transactions which can be marked with well-known information parts in both inputs or outputs, for instance, to implement numerous types of Good property.
(my emphasis)
See additionally https://en.bitcoin.it/wiki/Protocol_documentation#filterload.2C_filteradd.2C_filterclear.2C_merkleblock
Nah.. simply did it. To hurry issues up you possibly can obtain the tx index, saving an RPC name. That will increase the chain measurement by round 60GB.
Traversing all blocks (round 450K as Op_return was launched in March 2014) goes to take 100 days on a 16GB 4-core with SSD.
Tom Donnelly is a brand new contributor to this website. Take care in asking for clarification, commenting, and answering.
Try our Code of Conduct.
