<p>If you are looking for actual input scripts then the answer is simple: if there are <code>n</code> outputs being claimed then there are exactly <code>n</code> 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).</p>

<p>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.</p>

<p>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.</p>

<p>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.</p>

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

CC BY-SA 3.0
2013-03-06T10:49:40.347Z
Like this item, "scriptPubKey":"OP_DUP OP_HASH160 2d56f654aa5353bc05587a30e3f16e15cf7aaf99 OP_EQUALVERIFY OP_CHECKSIG"
vi.su.
CC BY-SA 3.0
2013-03-06T11:34:28.007Z
That would be the second option, which would have a new script for each address that ever received an incoming transaction.
cdecker
CC BY-SA 3.0
2013-03-06T10:12:58.700Z
2013-03-06T10:12:58.700Z
cdecker
<p>How do I list all unique scripts in the block chain, and their count (n-times-used)?</p>

<bitcoind><script>
How do I list all unique scripts from blockchain?
vi.su.
# How do I list all unique scripts from blockchain?

(Asked by: username_0 on 2013-03-05)

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

**Tags:** bitcoind, script


---

## 1 answers

### Answer by username_1 on 2013-03-06. Score: 1 | Accepted answer

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.

> **Comments:**
> **username_0**: Like this item, "scriptPubKey":"OP_DUP OP_HASH160 2d56f654aa5353bc05587a30e3f16e15cf7aaf99 OP_EQUALVERIFY OP_CHECKSIG"  
> **username_1**: That would be the second option, which would have a new script for each address that ever received an incoming transaction.  

---

