How do I list all unique scripts from blockchain?

2

2

How do I list all unique scripts in the block chain, and their count (n-times-used)?

vi.su.

Posted 2013-03-05T05:02:28.597

Reputation: 1 714

Answers

1

If you are looking for actual input scripts then the answer is simple: if there are n outputs being claimed then there are exactly n distinct scripts that are used exactly once. This is because each script includes a signature for a particular output that is being claimed, and they should be unique (that is excluding random collision, which are extremely unlikely).

If you are looking for output scripts then the number of distinct scripts is likely to be the number of addresses that received an incoming transaction, as they contain the addresses that may claim the output.

This is ofcourse just for the standard transactions in which you put up a claiming condition by requiring a single signature from an address and then provide the matching signature when claiming it.

More interesting could be the number of distinct script formats. That is counting the unique types of scripts, for example by just replacing all signatures and hashes with a placeholder and then counting them.

As far as I know blockchain.info does not currently offer such a functionality, but they might be interested to include it.

cdecker

Posted 2013-03-05T05:02:28.597

Reputation: 7 878

Like this item, "scriptPubKey":"OP_DUP OP_HASH160 2d56f654aa5353bc05587a30e3f16e15cf7aaf99 OP_EQUALVERIFY OP_CHECKSIG"vi.su. 2013-03-06T10:49:40.347

That would be the second option, which would have a new script for each address that ever received an incoming transaction.cdecker 2013-03-06T11:34:28.007