9

I'm studying scripts and am looking for strange or unusual scripts that have appeared in any of the *coin networks..(outside the standard ones listed on this page)

  • Is any one person, or website listing non-standard transactions that are not generated by the default client?

Ideally there would be an analysis of the script and what's going on, but I'm not picky. I'd even settle for a command line method to extract this data and discover it myself.

My goal is to learn what contracts are occurring in each network and determine the frequency of each. (How popular is multi-sig tx over time)

Alternatively, I can use this as a tool to learn how people are using the scripting language.

2

4 Answers 4

2

Blockchain Info has a list of strange transactions that its nodes received but were unable to verify.

1
  • They all look like p2pool transactions.
    – q9f
    Commented Jan 1, 2014 at 12:58
1

I have been looking into the same thing lately to build a "Bitcoin Bestiary" with strange transactions. I have downloaded bitcoin tools ( https://github.com/gavinandresen/bitcointools ). It has an option to trace non-standard transactions: dbdump.py --search-blocks=NONSTANDARD_CSCRIPTS

I have built on that a python program to study my local blk000x.dat files with the blockchain info. BCDataStream and deserialize come from bitcoin tools.

#!/usr/bin/env python 

from BCDataStream import *
import deserialize

def extract_script(d):

 for t in d['transactions']:


     for txOut in t['txOut']:
          print  "Prev hash: "+(d['hashPrev'][::-1]).encode('hex')+" Script: "+deserialize.decode_script(txOut['scriptPubKey'])+'\n'   


 return None


def findlock(filename):

    f = open(filename, 'r')

    magic=f.read(4)
    magicref='f9beb4d9'.decode('hex')

    while magic:
        size=f.read(4)[::-1].encode('hex')
        N=int(size,16)

        blk = deserialize.BCDataStream()
        blk.write(f.read(N))
        d=deserialize.parse_Block(blk)
        extract_script(d)

        magic=f.read(4)

    f.close()
    return None

def test():
     findlock('blk0001.dat')
     findlock('blk0002.dat')
     findlock('blk0003.dat')


if __name__ == '__main__':
    test()

The program dumps the Script in all transactions with the previous block number (I have to improve that, but you can later find the right block). The whole file is about 3 GB.

In my Linux terminal I redirect the output to a scripts.txt file and then use grep to find commands, like:

grep 'IF ' scripts.txt > IF.txt

MIN, IF, DROP, SWAP, for instance, show interesting things. Some of them are errors (see https://bitcointalk.org/index.php?topic=67158.0), some I don't know.

0

Lacking any other resource to track notable transaction, the following answer is made CW so that anyone can edit it and update as needed.

  • Block 728: The most common payment type is pubkey-hash which first appeared here. [source]
0

Local script to find them + preprocessed data

https://bitcoin.stackexchange.com/a/5890/21282 published a local script, and https://bitcoin.stackexchange.com/a/5886/21282 published a list, but here is both together:

The script is based on the nice https://github.com/alecalve/python-bitcoin-blockchain-parser Python library which parses blk files without the need for a server.

Then at known_op_signatures.json the output data is organized as follows:

[
  {
    "count": 1122142242,
    "ioidx": 0,
    "sample": "74c1a6dd6e88f73035143f8fc7420b5c395d28300a70bb35b943f7f2eddc656d",
    "sig": [
      null,
      null
    ]
  },
  {
    "count": 1103133457,
    "ioidx": 0,
    "sample": "6f7cf9580f1c2dfb3c4d5d043cdbb128c640e3f20161245aa7372e9666168516",
    "sig": [
      "OP_DUP",
      "OP_HASH160",
      null,
      "OP_EQUALVERIFY",
      "OP_CHECKSIG"
    ]
  },

So you can see we have at toplevel a list of transaction types, sorted by occurrence count.

In the transaction signature sig, null indicates a literal number constant. This way, only operands matter, and the script groups all transactions of a given type by operand alone to keep the data size manageable.

For example, the most common transaction type, with 1122142242 occurrences was:

    "sig": [
      null,
      null
    ]

i.e. two literals, which is the input script of a P2PKH transaction.

The second most common one was:

"sig": [
  "OP_DUP",
  "OP_HASH160",
  null,
  "OP_EQUALVERIFY",
  "OP_CHECKSIG"
]

which is the output scrip of a P2PKH transaction.

By quickly scrolling through the list, you will quickly see that, unsurprisingly, there are extremely few non-standard transactions.

Overviews of the non-standard scripts

https://www.quantabytes.com/articles/a-survey-of-bitcoin-transaction-types provides a nice summary. Other sources:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.