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
One of the best solutions are voted up and rise to the highest
Requested
Seen
121 occasions
I am engaged on a “mild consumer” for ION (Identification Overlay Community), and I would prefer to see if there’s a higher technique to seize the OP_RETURN information that it wants to be able to construct state.
At present I’m iterating by means of each block beginning at a selected peak after which iterating by means of every transaction and every transaction output to be able to discover the OP_RETURN signature that I’m in search of.
Is there a greater strategy 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 would love to do, however I do not suppose what I am in search of is feasible with solely the Bitcoin Wire protocol.
I’ve no expertise of this however from a superficial have a look at BIP-37 I think this form of factor may be doable utilizing bloom filters.
Filter matching algorithm
The filter may be examined towards arbitrary items of information, to see if that information was inserted by the consumer. Due to this fact the query arises of what items of information ought to 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, take a look at every information component of the output script. This implies every hash and key within the output script is examined independently. Essential: if an output matches while testing a transaction, the node may have to replace the filter by inserting the serialized COutPoint construction. See beneath for extra particulars.
- For every enter, take a look at the serialized COutPoint construction.
- For every enter, take a look at every information component of the enter script (observe: enter scripts solely ever comprise information components).
- In any other case there is no such thing as a match.
On this manner addresses, keys and script hashes (for P2SH outputs) can all be added to the filter. It’s also possible to match towards lessons of transactions which might be marked with well-known information components in both inputs or outputs, for instance, to implement varied 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’ll be able to obtain the tx index, saving an RPC name. That will increase the chain dimension 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.