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

<pre><code>6a26d2ecb67f27d1fa5524763b49029d7106e91e3cc05743073461a719776192
23befff6eea3dded0e34574af65c266c9398e7d7d9d07022bf1cd526c5cdbc94
825baed503ce5d28bf7332b6dac4751aaceea5cf2df9148b90cbc61894b65261
8e8b01b99048ee68bfe378dd7eb7fc8c1d5b1864aa74a76f4dc97ed38fbfe15e
</code></pre>

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

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

CC BY-SA 3.0
2016-06-13T19:23:54.323Z
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
CC BY-SA 3.0
2016-06-14T06:00:16.613Z
python-bitcoinlib has support for parsing scripts. In the CScript module. You may be able to pretty print them using that library.
rny
CC BY-SA 3.0
2016-06-15T00:18:53.413Z
thanks guys, any documents about it except https://en.bitcoin.it/wiki/Script ?
nateless
CC BY-SA 4.0
2018-10-12T06:55:31.863Z
I don't use it but bitcoin-ruby seems to have implemented Script as well: https://github.com/lian/bitcoin-ruby/blob/master/lib/bitcoin/script.rb
Andreas Blaesus
<blockchain><script><python><ruby>
Is there any library to process scriptSig script in transaction, and other scripts?
nateless
# Is there any library to process scriptSig script in transaction, and other scripts?

(Asked by: username_0 on 2016-06-13)

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?

**Tags:** blockchain, script, python, ruby

> **Comments:**
> **username_1**: 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.  
> **username_2**: python-bitcoinlib has support for parsing scripts. In the CScript module. You may be able to pretty print them using that library.  
> **username_0**: thanks guys, any documents about it except https://en.bitcoin.it/wiki/Script ?  
> **username_3**: I don't use it but bitcoin-ruby seems to have implemented Script as well: https://github.com/lian/bitcoin-ruby/blob/master/lib/bitcoin/script.rb  

---

## 0 answers

