1

I'm trying to parse hex representation of scriptSig, in normal transactions there are variable int, r&s, pubkey. But some are really weird, like those ones:

6a26d2ecb67f27d1fa5524763b49029d7106e91e3cc05743073461a719776192
23befff6eea3dded0e34574af65c266c9398e7d7d9d07022bf1cd526c5cdbc94
825baed503ce5d28bf7332b6dac4751aaceea5cf2df9148b90cbc61894b65261
8e8b01b99048ee68bfe378dd7eb7fc8c1d5b1864aa74a76f4dc97ed38fbfe15e

I was not able to find any information on all types of transactions, their structure and how to decode them. There's always something new and non-standard still Bitcoin Core somehow decodes it.

Unfortunately I barely can read C++ code and sources of Bitcoin Core, but maybe there are any ruby\python\php code which I can use or at least understand how to decode each and every script on the blockchain? Or any documentation which describes all various valid scripts?

  • I know this isn't what you're looking for, but personal experience has taught me that the best reference for anything script-related is usually the Bitcoin Core code, itself. That's why it's called the "reference client". If you want to get into the low-level parts of the Bitcoin protocol, it's probably worth becoming more comfortable with C/C++. That said, I'm sure somebody will suggest a library that does what you want. – Jestin Jun 13 '16 at 19:23
  • python-bitcoinlib has support for parsing scripts. In the CScript module. You may be able to pretty print them using that library. – renlord Jun 14 '16 at 6:00
  • thanks guys, any documents about it except en.bitcoin.it/wiki/Script ? – nateless Jun 15 '16 at 0:18
  • I don't use it but bitcoin-ruby seems to have implemented Script as well: github.com/lian/bitcoin-ruby/blob/master/lib/bitcoin/script.rb – Andreas Blaesus Oct 12 '18 at 6:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.